43 #ifndef OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH
44 #define OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH
49 #if !defined(OM_USE_OSG)
59 #include <OpenMesh/Core/IO/MeshIO.hh>
62 # include <OpenMesh/Tools/Kernel_OSG/TriMesh_OSGArrayKernelT.hh>
63 # define DEFAULT_TRAITS Kernel_OSG::Traits
64 # define TRIMESH_KERNEL Kernel_OSG::TriMesh_OSGArrayKernelT
68 # include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
69 # define DEFAULT_TRAITS DefaultTraits
70 # define TRIMESH_KERNEL TriMesh_ArrayKernelT
73 #include <OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh>
83 using namespace OpenMesh;
85 struct MyTraits :
public DEFAULT_TRAITS
91 typedef TRIMESH_KERNEL<MyTraits>
mesh_t;
105 typedef Decimater::DecimaterT<mesh_t> decimater_t;
106 typedef Decimater::ModQuadricT< mesh_t >::Handle mod_quadric_t;
107 typedef Decimater::ModNormalFlippingT< mesh_t >::Handle mod_nf_t;
110 typedef std::auto_ptr< decimater_t > decimater_o;
119 timer_ =
new QTimer(
this);
121 connect( timer_, SIGNAL(timeout()), SLOT(animate()) );
143 if ( (rc = inherited_t::open_mesh( _filename, _opt )) )
145 std::cout <<
"prepare decimater" << std::endl;
147 decimater_ = decimater_o (
new decimater_t ( mesh() ) );
149 decimater_->add(mod_quadric_);
150 decimater_->module(mod_quadric_).set_binary(
false);
152 decimater_->add(mod_nf_);
154 decimater_->initialize();
161 void animate(
void );
165 virtual void keyPressEvent(QKeyEvent* _event);
173 decimater_o decimater_;
174 mod_quadric_t mod_quadric_;
182 #endif // OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH defined
~DecimaterViewerWidget()
destructor
Definition: DecimaterViewerWidget.hh:132
Set options for reader/writer modules.
Definition: Options.hh:88
Definition: DecimaterViewerWidget.hh:97
Definition: MeshViewerWidget.hh:73
#define FaceAttributes(_i)
Macro for defining the face attributes. See Specifying your MyMesh.
Definition: Traits.hh:86
DecimaterViewerWidget(QWidget *_parent=0)
default constructor
Definition: DecimaterViewerWidget.hh:113
bool open_mesh(const char *_filename, OpenMesh::IO::Options _opt)
open mesh
Definition: DecimaterViewerWidget.hh:139
Triangle mesh based on the ArrayKernel.
Definition: TriMesh_ArrayKernelT.hh:91
#define VertexAttributes(_i)
Macro for defining the vertex attributes. See Specifying your MyMesh.
Definition: Traits.hh:77
This file defines the default traits and some convenience macros.
Definition: MeshViewerWidgetT.hh:69
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:80