6 #ifndef OPENMESHAPPS_MESHVIEWERWIDGETT_HH
7 #define OPENMESHAPPS_MESHVIEWERWIDGETT_HH
13 #include <OpenMesh/Core/IO/MeshIO.hh>
14 #include <OpenMesh/Core/IO/Options.hh>
15 #include <OpenMesh/Core/Utils/GenProg.hh>
16 #include <OpenMesh/Core/Utils/color_cast.hh>
17 #include <OpenMesh/Core/Mesh/Attributes.hh>
18 #include <OpenMesh/Tools/Utils/StripifierT.hh>
19 #include <OpenMesh/Tools/Utils/Timer.hh>
20 #include <QMessageBox>
59 typedef OpenMesh::StripifierT<Mesh> MyStripifier;
67 tex_mode_(GL_MODULATE),
70 show_vnormals_(false),
75 #if defined(OM_USE_OSG) && OM_USE_OSG
88 virtual bool open_audio(
const char *_filename );
93 void disable_strips();
96 Mesh& mesh() {
return mesh_; }
97 const Mesh& mesh()
const {
return mesh_; }
102 virtual void draw_scene(
const std::string& _draw_mode);
110 void glVertex(
const typename Mesh::VertexHandle _vh )
111 { glVertex3fv( &mesh_.point( _vh )[0] ); }
113 void glVertex(
const typename Mesh::Point& _p )
114 { glVertex3fv( &_p[0] ); }
116 void glNormal(
const typename Mesh::VertexHandle _vh )
117 { glNormal3fv( &mesh_.normal( _vh )[0] ); }
119 void glTexCoord(
const typename Mesh::VertexHandle _vh )
120 { glTexCoord2fv( &mesh_.texcoord(_vh)[0] ); }
122 void glColor(
const typename Mesh::VertexHandle _vh )
123 { glColor3ubv( &mesh_.color(_vh)[0] ); }
127 void glNormal(
const typename Mesh::FaceHandle _fh )
128 { glNormal3fv( &mesh_.normal( _fh )[0] ); }
130 void glColor(
const typename Mesh::FaceHandle _fh )
131 { glColor3ubv( &mesh_.color(_fh)[0] ); }
133 void glMaterial(
const typename Mesh::FaceHandle _fh,
134 int _f=GL_FRONT_AND_BACK,
int _m=GL_DIFFUSE )
136 OpenMesh::Vec3f c=OpenMesh::color_cast<OpenMesh::Vec3f>(mesh_.color(_fh));
137 OpenMesh::Vec4f m( c[0], c[1], c[2], 1.0f );
139 glMaterialfv(_f, _m, &m[0]);
145 void compute_strips(
void)
156 virtual void keyPressEvent( QKeyEvent* _event);
163 OpenMesh::IO::Options opt_;
166 MyStripifier strips_;
171 OpenMesh::FPropHandleT< typename Mesh::Point > fp_normal_base_;
183 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESHAPPS_MESHVIEWERWIDGET_CC)
184 # define OPENMESH_MESHVIEWERWIDGET_TEMPLATES
188 #endif // OPENMESHAPPS_MESHVIEWERWIDGETT_HH defined