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>
87 tex_mode_(GL_MODULATE),
90 show_vnormals_(false),
91 show_fnormals_(false),
96#if defined(OM_USE_OSG) && OM_USE_OSG
111 bool set_texture( QImage& _texsrc );
113 void enable_strips();
114 void disable_strips();
117 Mesh& mesh() {
return mesh_; }
118 const Mesh& mesh()
const {
return mesh_; }
123 virtual void draw_scene(
const std::string& _draw_mode)
override;
132 { glVertex3fv( &mesh_.point( _vh )[0] ); }
135 { glVertex3fv( &_p[0] ); }
138 { glNormal3fv( &mesh_.normal( _vh )[0] ); }
141 { glTexCoord2fv( &mesh_.texcoord(_vh)[0] ); }
144 { glColor3ubv( &mesh_.color(_vh)[0] ); }
149 { glNormal3fv( &mesh_.normal( _fh )[0] ); }
152 { glColor3ubv( &mesh_.color(_fh)[0] ); }
155 int _f=GL_FRONT_AND_BACK,
int _m=GL_DIFFUSE )
157 OpenMesh::Vec3f c=OpenMesh::color_cast<OpenMesh::Vec3f>(mesh_.color(_fh));
160 glMaterialfv(_f, _m, &m[0]);
166 void compute_strips(
void)
177 virtual void keyPressEvent( QKeyEvent* _event)
override;
187 MyStripifier strips_;
197#if defined(OM_INCLUDE_TEMPLATES)
198# define OPENMESH_MESHVIEWERWIDGET_TEMPLATES
199# include "MeshViewerWidgetT_impl.hh"
This file provides some macros containing attribute usage.
Definition MeshViewerWidgetT.hh:74
MeshViewerWidgetT(QWidget *_parent=0)
default constructor
Definition MeshViewerWidgetT.hh:83
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:102
Definition QGLViewerWidget.hh:77
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::Point Point
Coordinate type.
Definition PolyMeshT.hh:112
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