45 #ifndef OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH 46 #define OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH 51 #if !defined(OM_USE_OSG) 61 #include <OpenMesh/Core/IO/MeshIO.hh> 64 # include <OpenMesh/Tools/Kernel_OSG/TriMesh_OSGArrayKernelT.hh> 65 # define DEFAULT_TRAITS Kernel_OSG::Traits 66 # define TRIMESH_KERNEL Kernel_OSG::TriMesh_OSGArrayKernelT 70 # include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh> 71 # define DEFAULT_TRAITS DefaultTraits 72 # define TRIMESH_KERNEL TriMesh_ArrayKernelT 75 #include <OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh> 87 struct MyTraits :
public DEFAULT_TRAITS
93 typedef TRIMESH_KERNEL<MyTraits> mesh_t;
107 typedef Decimater::DecimaterT<mesh_t> decimater_t;
108 typedef Decimater::ModQuadricT< mesh_t >::Handle mod_quadric_t;
109 typedef Decimater::ModNormalFlippingT< mesh_t >::Handle mod_nf_t;
112 #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) 113 typedef std::unique_ptr< decimater_t > decimater_o;
115 typedef std::auto_ptr< decimater_t > decimater_o;
127 timer_ =
new QTimer(
this);
129 connect( timer_, SIGNAL(timeout()), SLOT(animate()) );
151 if ( (rc = inherited_t::open_mesh( _filename, _opt )) )
153 std::cout <<
"prepare decimater" << std::endl;
155 decimater_ = decimater_o (
new decimater_t ( mesh() ) );
157 decimater_->add(mod_quadric_);
158 decimater_->module(mod_quadric_).set_binary(
false);
160 decimater_->add(mod_nf_);
162 decimater_->initialize();
169 void animate(
void );
173 virtual void keyPressEvent(QKeyEvent* _event)
override;
181 decimater_o decimater_;
182 mod_quadric_t mod_quadric_;
190 #endif // OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH defined
Add normals to mesh item (vertices/faces)
#define VertexAttributes(_i)
Macro for defining the vertex attributes. See Specifying your MyMesh.
Set options for reader/writer modules.
#define FaceAttributes(_i)
Macro for defining the face attributes. See Specifying your MyMesh.