50 #ifndef OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH 51 #define OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH 56 #if !defined(OM_USE_OSG) 66 #include <OpenMesh/Core/IO/MeshIO.hh> 69 # include <OpenMesh/Tools/Kernel_OSG/TriMesh_OSGArrayKernelT.hh> 70 # define DEFAULT_TRAITS Kernel_OSG::Traits 71 # define TRIMESH_KERNEL Kernel_OSG::TriMesh_OSGArrayKernelT 75 # include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh> 76 # define DEFAULT_TRAITS DefaultTraits 77 # define TRIMESH_KERNEL TriMesh_ArrayKernelT 80 #include <OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh> 92 struct MyTraits :
public DEFAULT_TRAITS
98 typedef TRIMESH_KERNEL<MyTraits>
mesh_t;
112 typedef Decimater::DecimaterT<mesh_t> decimater_t;
113 typedef Decimater::ModQuadricT< mesh_t >::Handle mod_quadric_t;
114 typedef Decimater::ModNormalFlippingT< mesh_t >::Handle mod_nf_t;
117 #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) 118 typedef std::unique_ptr< decimater_t > decimater_o;
120 typedef std::auto_ptr< decimater_t > decimater_o;
132 timer_ =
new QTimer(
this);
134 connect( timer_, SIGNAL(timeout()), SLOT(animate()) );
156 if ( (rc = inherited_t::open_mesh( _filename, _opt )) )
158 std::cout <<
"prepare decimater" << std::endl;
160 decimater_ = decimater_o (
new decimater_t ( mesh() ) );
162 decimater_->add(mod_quadric_);
163 decimater_->module(mod_quadric_).set_binary(
false);
165 decimater_->add(mod_nf_);
167 decimater_->initialize();
174 void animate(
void );
178 virtual void keyPressEvent(QKeyEvent* _event);
186 decimater_o decimater_;
187 mod_quadric_t mod_quadric_;
195 #endif // OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH defined Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
Definition: DecimaterViewerWidget.hh:104
Definition: MeshViewerWidgetT.hh:76
#define VertexAttributes(_i)
Macro for defining the vertex attributes. See Specifying your MyMesh.
Definition: Traits.hh:84
~DecimaterViewerWidget()
destructor
Definition: DecimaterViewerWidget.hh:145
DecimaterViewerWidget(QWidget *_parent=0)
default constructor
Definition: DecimaterViewerWidget.hh:126
Triangle mesh based on the ArrayKernel.
Definition: PolyMesh_ArrayKernelT.hh:78
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:87
Definition: MeshViewerWidget.hh:80
Set options for reader/writer modules.
Definition: Options.hh:95
This file defines the default traits and some convenience macros.
bool open_mesh(const char *_filename, OpenMesh::IO::Options _opt)
open mesh
Definition: DecimaterViewerWidget.hh:152
#define FaceAttributes(_i)
Macro for defining the face attributes. See Specifying your MyMesh.
Definition: Traits.hh:93