51 #include <OpenMesh/Core/IO/MeshIO.hh> 52 #include <OpenMesh/Core/IO/Options.hh> 53 #include <OpenMesh/Core/Utils/GenProg.hh> 54 #include <OpenMesh/Core/Utils/color_cast.hh> 56 #include <OpenMesh/Tools/Utils/StripifierT.hh> 58 #include <OpenMesh/Apps/QtViewer/QGLViewerWidget.hh> 84 tex_mode_(GL_MODULATE),
87 show_vnormals_(false),
92 #if defined(OM_USE_OSG) && OM_USE_OSG 107 bool set_texture( QImage& _texsrc );
109 void enable_strips();
110 void disable_strips();
113 Mesh& mesh() {
return mesh_; }
114 const Mesh& mesh()
const {
return mesh_; }
119 virtual void draw_scene(
const std::string& _draw_mode);
128 { glVertex3fv( &mesh_.point( _vh )[0] ); }
131 { glVertex3fv( &_p[0] ); }
134 { glNormal3fv( &mesh_.normal( _vh )[0] ); }
137 { glTexCoord2fv( &mesh_.texcoord(_vh)[0] ); }
140 { glColor3ubv( &mesh_.color(_vh)[0] ); }
144 void glNormal(
const typename Mesh::FaceHandle _fh )
145 { glNormal3fv( &mesh_.normal( _fh )[0] ); }
147 void glColor(
const typename Mesh::FaceHandle _fh )
148 { glColor3ubv( &mesh_.color(_fh)[0] ); }
150 void glMaterial(
const typename Mesh::FaceHandle _fh,
151 int _f=GL_FRONT_AND_BACK,
int _m=GL_DIFFUSE )
156 glMaterialfv(_f, _m, &m[0]);
162 void compute_strips(
void)
173 virtual void keyPressEvent( QKeyEvent* _event);
183 MyStripifier strips_;
193 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESHAPPS_MESHVIEWERWIDGET_CC) 194 # define OPENMESH_MESHVIEWERWIDGET_TEMPLATES 195 # include "MeshViewerWidgetT_impl.hh"
Kernel::Point Point
Coordinate type.
MeshViewerWidgetT(QWidget *_parent=0)
default constructor
QAction * add_draw_mode(const std::string &_s)
add draw mode to popup menu, and return the QAction created
virtual void draw_scene(const std::string &_draw_mode)
inherited drawing method
virtual bool open_mesh(const char *_filename, OpenMesh::IO::Options _opt)
open mesh
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
~MeshViewerWidgetT()
destructor
virtual void draw_openmesh(const std::string &_drawmode)
draw the mesh
size_t stripify()
Compute triangle strips, returns number of strips.
void clear()
delete all strips
Set options for reader/writer modules.
virtual bool open_texture(const char *_filename)
load texture