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< decimater_t > mod_quadric_t;
107 typedef Decimater::ModNormalFlippingT< decimater_t > mod_nf_t;
110 typedef std::auto_ptr< decimater_t > decimater_o;
111 typedef std::auto_ptr< mod_quadric_t > mod_quadric_o;
112 typedef std::auto_ptr< mod_nf_t > mod_nf_o;
118 timer_ =
new QTimer(
this);
120 connect( timer_, SIGNAL(timeout()), SLOT(animate()) );
142 if ( (rc = inherited_t::open_mesh( _filename, _opt )) )
144 std::cout <<
"prepare decimater" << std::endl;
148 decimater_o tmp(
new decimater_t ( mesh() ) );
152 mod_quadric_o tmp(
new mod_quadric_t( *decimater_ ) );
156 mod_nf_o tmp(
new mod_nf_t ( *decimater_ ) );
160 decimater_->initialize();
167 void animate(
void );
171 virtual void keyPressEvent(QKeyEvent* _event);
179 decimater_o decimater_;
180 mod_quadric_o mod_quadric_;
188 #endif // OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH defined