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);
181 decimater_o decimater_;
182 mod_quadric_t mod_quadric_;
190 #endif // OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH defined #define VertexAttributes(_i)
Macro for defining the vertex attributes. See Specifying your MyMesh.
Definition: Traits.hh:79
DecimaterViewerWidget(QWidget *_parent=0)
default constructor
Definition: DecimaterViewerWidget.hh:121
#define FaceAttributes(_i)
Macro for defining the face attributes. See Specifying your MyMesh.
Definition: Traits.hh:88
This file defines the default traits and some convenience macros.
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:82
bool open_mesh(const char *_filename, OpenMesh::IO::Options _opt)
open mesh
Definition: DecimaterViewerWidget.hh:147
Definition: DecimaterViewerWidget.hh:99
Triangle mesh based on the ArrayKernel.
Definition: PolyMesh_ArrayKernelT.hh:73
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
Definition: MeshViewerWidgetT.hh:70
Set options for reader/writer modules.
Definition: Options.hh:90
~DecimaterViewerWidget()
destructor
Definition: DecimaterViewerWidget.hh:140
Definition: MeshViewerWidget.hh:75