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);
132 void glVertex(
const typename Mesh::VertexHandle _vh )
133 { glVertex3fv( &mesh_.point( _vh )[0] ); }
135 void glVertex(
const typename Mesh::Point& _p )
136 { glVertex3fv( &_p[0] ); }
138 void glNormal(
const typename Mesh::VertexHandle _vh )
139 { glNormal3fv( &mesh_.normal( _vh )[0] ); }
141 void glTexCoord(
const typename Mesh::VertexHandle _vh )
142 { glTexCoord2fv( &mesh_.texcoord(_vh)[0] ); }
144 void glColor(
const typename Mesh::VertexHandle _vh )
145 { glColor3ubv( &mesh_.color(_vh)[0] ); }
149 void glNormal(
const typename Mesh::FaceHandle _fh )
150 { glNormal3fv( &mesh_.normal( _fh )[0] ); }
152 void glColor(
const typename Mesh::FaceHandle _fh )
153 { glColor3ubv( &mesh_.color(_fh)[0] ); }
155 void glMaterial(
const typename Mesh::FaceHandle _fh,
156 int _f=GL_FRONT_AND_BACK,
int _m=GL_DIFFUSE )
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"
203 #endif // OPENMESHAPPS_MESHVIEWERWIDGETT_HH defined
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:95
Definition: MeshViewerWidgetT.hh:76
~MeshViewerWidgetT()
destructor
Definition: MeshViewerWidgetT.hh:103
This file provides some macros containing attribute usage.
Definition: QGLViewerWidget.hh:73
virtual void draw_openmesh(const std::string &_drawmode)
draw the mesh
Definition: MeshViewerWidgetT.cc:290
void clear()
delete all strips
Definition: StripifierT.hh:105
virtual bool open_texture(const char *_filename)
load texture
Definition: MeshViewerWidgetT.cc:212
size_t stripify()
Compute triangle strips, returns number of strips.
Definition: StripifierT.cc:87
This class decomposes a triangle mesh into several triangle strips.
Definition: StripifierT.hh:84
MeshViewerWidgetT(QWidget *_parent=0)
default constructor
Definition: MeshViewerWidgetT.hh:85
virtual void draw_scene(const std::string &_draw_mode)
inherited drawing method
Definition: MeshViewerWidgetT.cc:578
virtual bool open_mesh(const char *_filename, OpenMesh::IO::Options _opt)
open mesh
Definition: MeshViewerWidgetT.cc:83