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),
88 show_fnormals_(false),
93#if defined(OM_USE_OSG) && OM_USE_OSG
108 bool set_texture( QImage& _texsrc );
110 void enable_strips();
111 void disable_strips();
114 Mesh& mesh() {
return mesh_; }
115 const Mesh& mesh()
const {
return mesh_; }
120 virtual void draw_scene(
const std::string& _draw_mode)
override;
128 void glVertex(
const typename Mesh::VertexHandle _vh )
129 { glVertex3fv( &mesh_.point( _vh )[0] ); }
131 void glVertex(
const typename Mesh::Point& _p )
132 { glVertex3fv( &_p[0] ); }
134 void glNormal(
const typename Mesh::VertexHandle _vh )
135 { glNormal3fv( &mesh_.normal( _vh )[0] ); }
137 void glTexCoord(
const typename Mesh::VertexHandle _vh )
138 { glTexCoord2fv( &mesh_.texcoord(_vh)[0] ); }
140 void glColor(
const typename Mesh::VertexHandle _vh )
141 { glColor3ubv( &mesh_.color(_vh)[0] ); }
146 { glNormal3fv( &mesh_.normal( _fh )[0] ); }
149 { glColor3ubv( &mesh_.color(_fh)[0] ); }
152 int _f=GL_FRONT_AND_BACK,
int _m=GL_DIFFUSE )
154 OpenMesh::Vec3f c=OpenMesh::color_cast<OpenMesh::Vec3f>(mesh_.color(_fh));
157 glMaterialfv(_f, _m, &m[0]);
163 void compute_strips(
void)
174 virtual void keyPressEvent( QKeyEvent* _event)
override;
184 MyStripifier strips_;
194#if defined(OM_INCLUDE_TEMPLATES)
195# define OPENMESH_MESHVIEWERWIDGET_TEMPLATES
196# include "MeshViewerWidgetT_impl.hh"
This file provides some macros containing attribute usage.
Definition: MeshViewerWidgetT.hh:71
MeshViewerWidgetT(QWidget *_parent=0)
default constructor
Definition: MeshViewerWidgetT.hh:80
virtual bool open_texture(const char *_filename)
load texture
Definition: MeshViewerWidgetT_impl.hh:206
virtual bool open_mesh(const char *_filename, OpenMesh::IO::Options _opt)
open mesh
Definition: MeshViewerWidgetT_impl.hh:75
virtual void draw_scene(const std::string &_draw_mode) override
inherited drawing method
Definition: MeshViewerWidgetT_impl.hh:572
virtual void draw_openmesh(const std::string &_drawmode)
draw the mesh
Definition: MeshViewerWidgetT_impl.hh:284
~MeshViewerWidgetT()
destructor
Definition: MeshViewerWidgetT.hh:99
Definition: QGLViewerWidget.hh:73
QAction * add_draw_mode(const std::string &_s)
add draw mode to popup menu, and return the QAction created
Definition: QGLViewerWidget.cc:650
Set options for reader/writer modules.
Definition: Options.hh:92
Kernel::FaceHandle FaceHandle
Scalar type.
Definition: PolyMeshT.hh:139
This class decomposes a triangle mesh into several triangle strips.
Definition: StripifierT.hh:80
void clear()
delete all strips
Definition: StripifierT.hh:100
size_t stripify()
Compute triangle strips, returns number of strips.
Definition: StripifierT_impl.hh:82