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>
85 tex_mode_(GL_MODULATE),
88 show_vnormals_(false),
89 show_fnormals_(false),
94#if defined(OM_USE_OSG) && OM_USE_OSG
109 bool set_texture( QImage& _texsrc );
111 void enable_strips();
112 void disable_strips();
115 Mesh& mesh() {
return mesh_; }
116 const Mesh& mesh()
const {
return mesh_; }
121 virtual void draw_scene(
const std::string& _draw_mode)
override;
130 { glVertex3fv( &mesh_.point( _vh )[0] ); }
133 { glVertex3fv( &_p[0] ); }
136 { glNormal3fv( &mesh_.normal( _vh )[0] ); }
139 { glTexCoord2fv( &mesh_.texcoord(_vh)[0] ); }
142 { glColor3ubv( &mesh_.color(_vh)[0] ); }
147 { glNormal3fv( &mesh_.normal( _fh )[0] ); }
150 { glColor3ubv( &mesh_.color(_fh)[0] ); }
153 int _f=GL_FRONT_AND_BACK,
int _m=GL_DIFFUSE )
155 OpenMesh::Vec3f c=OpenMesh::color_cast<OpenMesh::Vec3f>(mesh_.color(_fh));
158 glMaterialfv(_f, _m, &m[0]);
164 void compute_strips(
void)
175 virtual void keyPressEvent( QKeyEvent* _event)
override;
185 MyStripifier strips_;
195#if defined(OM_INCLUDE_TEMPLATES)
196# define OPENMESH_MESHVIEWERWIDGET_TEMPLATES
197# include "MeshViewerWidgetT_impl.hh"
This file provides some macros containing attribute usage.
Definition MeshViewerWidgetT.hh:72
MeshViewerWidgetT(QWidget *_parent=0)
default constructor
Definition MeshViewerWidgetT.hh:81
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:100
Definition QGLViewerWidget.hh:75
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::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition PolyMeshT.hh:136
Kernel::FaceHandle FaceHandle
Scalar type.
Definition PolyMeshT.hh:139
Kernel::Point Point
Coordinate type.
Definition PolyMeshT.hh:112
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