50#ifndef OPENMESHAPPS_MESHVIEWERWIDGETT_HH
51#define OPENMESHAPPS_MESHVIEWERWIDGETT_HH
57#include <OpenMesh/Core/IO/MeshIO.hh>
58#include <OpenMesh/Core/IO/Options.hh>
59#include <OpenMesh/Core/Utils/GenProg.hh>
60#include <OpenMesh/Core/Utils/color_cast.hh>
62#include <OpenMesh/Tools/Utils/StripifierT.hh>
64#include <OpenMesh/Apps/QtViewer/QGLViewerWidget.hh>
89 tex_mode_(GL_MODULATE),
92 show_vnormals_(false),
97#if defined(OM_USE_OSG) && OM_USE_OSG
112 bool set_texture( QImage& _texsrc );
114 void enable_strips();
115 void disable_strips();
118 Mesh& mesh() {
return mesh_; }
119 const Mesh& mesh()
const {
return mesh_; }
124 virtual void draw_scene(
const std::string& _draw_mode);
133 { glVertex3fv( &mesh_.point( _vh )[0] ); }
136 { glVertex3fv( &_p[0] ); }
139 { glNormal3fv( &mesh_.normal( _vh )[0] ); }
142 { glTexCoord2fv( &mesh_.texcoord(_vh)[0] ); }
145 { glColor3ubv( &mesh_.color(_vh)[0] ); }
150 { glNormal3fv( &mesh_.normal( _fh )[0] ); }
153 { glColor3ubv( &mesh_.color(_fh)[0] ); }
156 int _f=GL_FRONT_AND_BACK,
int _m=GL_DIFFUSE )
158 OpenMesh::Vec3f c=OpenMesh::color_cast<OpenMesh::Vec3f>(mesh_.color(_fh));
161 glMaterialfv(_f, _m, &m[0]);
167 void compute_strips(
void)
178 virtual void keyPressEvent( QKeyEvent* _event);
188 MyStripifier strips_;
198#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESHAPPS_MESHVIEWERWIDGET_CC)
199# define OPENMESH_MESHVIEWERWIDGET_TEMPLATES
200# include "MeshViewerWidgetT.cc"
This file provides some macros containing attribute usage.
Definition: MeshViewerWidgetT.hh:77
MeshViewerWidgetT(QWidget *_parent=0)
default constructor
Definition: MeshViewerWidgetT.hh:85
virtual bool open_texture(const char *_filename)
load texture
Definition: MeshViewerWidgetT.cc:212
virtual bool open_mesh(const char *_filename, OpenMesh::IO::Options _opt)
open mesh
Definition: MeshViewerWidgetT.cc:83
virtual void draw_openmesh(const std::string &_drawmode)
draw the mesh
Definition: MeshViewerWidgetT.cc:290
virtual void draw_scene(const std::string &_draw_mode)
inherited drawing method
Definition: MeshViewerWidgetT.cc:578
~MeshViewerWidgetT()
destructor
Definition: MeshViewerWidgetT.hh:103
Definition: QGLViewerWidget.hh:74
QAction * add_draw_mode(const std::string &_s)
add draw mode to popup menu, and return the QAction created
Definition: QGLViewerWidget.cc:642
Set options for reader/writer modules.
Definition: Options.hh:96
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition: PolyMeshT.hh:139
Kernel::FaceHandle FaceHandle
Scalar type.
Definition: PolyMeshT.hh:142
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:115
This class decomposes a triangle mesh into several triangle strips.
Definition: StripifierT.hh:85
void clear()
delete all strips
Definition: StripifierT.hh:105
size_t stripify()
Compute triangle strips, returns number of strips.
Definition: StripifierT.cc:87