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] ); }
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
MeshViewerWidgetT(QWidget *_parent=0)
default constructor
Kernel::Point Point
Coordinate type.
~MeshViewerWidgetT()
destructor
Set options for reader/writer modules.
size_t stripify()
Compute triangle strips, returns number of strips.
QAction * add_draw_mode(const std::string &_s)
add draw mode to popup menu, and return the QAction created
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
virtual bool open_mesh(const char *_filename, OpenMesh::IO::Options _opt)
open mesh
virtual void draw_scene(const std::string &_draw_mode)
inherited drawing method
virtual void draw_openmesh(const std::string &_drawmode)
draw the mesh
void clear()
delete all strips
virtual bool open_texture(const char *_filename)
load texture