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;
116 timer_ =
new QTimer(
this);
118 connect( timer_, SIGNAL(timeout()), SLOT(animate()) );
140 if ( (rc = inherited_t::open_mesh( _filename, _opt )) )
142 std::cout <<
"prepare decimater" << std::endl;
146 decimater_o tmp(
new decimater_t ( mesh() ) );
150 decimater_->add(mod_quadric_);
151 decimater_->module(mod_quadric_).set_binary(
false);
153 decimater_->add(mod_nf_);
155 decimater_->initialize();
162 void animate(
void );
166 virtual void keyPressEvent(QKeyEvent* _event);
174 decimater_o decimater_;
175 mod_quadric_t mod_quadric_;
183 #endif // OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH defined