43 #ifndef OPENMESHAPPS_MESHVIEWERWIDGETT_HH
44 #define OPENMESHAPPS_MESHVIEWERWIDGETT_HH
50 #include <OpenMesh/Core/IO/MeshIO.hh>
51 #include <OpenMesh/Core/IO/Options.hh>
52 #include <OpenMesh/Core/Utils/GenProg.hh>
53 #include <OpenMesh/Core/Utils/color_cast.hh>
55 #include <OpenMesh/Tools/Utils/StripifierT.hh>
57 #include <OpenMesh/Apps/QtViewer/QGLViewerWidget.hh>
82 tex_mode_(GL_MODULATE),
85 show_vnormals_(false),
90 #if defined(OM_USE_OSG) && OM_USE_OSG
105 bool set_texture( QImage& _texsrc );
107 void enable_strips();
108 void disable_strips();
111 Mesh& mesh() {
return mesh_; }
112 const Mesh& mesh()
const {
return mesh_; }
117 virtual void draw_scene(
const std::string& _draw_mode);
125 void glVertex(
const typename Mesh::VertexHandle _vh )
126 { glVertex3fv( &mesh_.point( _vh )[0] ); }
128 void glVertex(
const typename Mesh::Point& _p )
129 { glVertex3fv( &_p[0] ); }
131 void glNormal(
const typename Mesh::VertexHandle _vh )
132 { glNormal3fv( &mesh_.normal( _vh )[0] ); }
134 void glTexCoord(
const typename Mesh::VertexHandle _vh )
135 { glTexCoord2fv( &mesh_.texcoord(_vh)[0] ); }
137 void glColor(
const typename Mesh::VertexHandle _vh )
138 { glColor3ubv( &mesh_.color(_vh)[0] ); }
142 void glNormal(
const typename Mesh::FaceHandle _fh )
143 { glNormal3fv( &mesh_.normal( _fh )[0] ); }
145 void glColor(
const typename Mesh::FaceHandle _fh )
146 { glColor3ubv( &mesh_.color(_fh)[0] ); }
148 void glMaterial(
const typename Mesh::FaceHandle _fh,
149 int _f=GL_FRONT_AND_BACK,
int _m=GL_DIFFUSE )
151 OpenMesh::Vec3f c=OpenMesh::color_cast<OpenMesh::Vec3f>(mesh_.color(_fh));
152 OpenMesh::Vec4f m( c[0], c[1], c[2], 1.0f );
154 glMaterialfv(_f, _m, &m[0]);
160 void compute_strips(
void)
171 virtual void keyPressEvent( QKeyEvent* _event);
181 MyStripifier strips_;
191 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESHAPPS_MESHVIEWERWIDGET_CC)
192 # define OPENMESH_MESHVIEWERWIDGET_TEMPLATES
193 # include "MeshViewerWidgetT.cc"
196 #endif // OPENMESHAPPS_MESHVIEWERWIDGETT_HH defined