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>
93typedef TRIMESH_KERNEL<MyDecimaterViewerWidgetTraits>
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()) );
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_;
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
@ Normal
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:82
Definition: DecimaterViewerWidget.hh:88
Definition: DecimaterViewerWidget.hh:100
~DecimaterViewerWidget()
destructor
Definition: DecimaterViewerWidget.hh:140
bool open_mesh(const char *_filename, OpenMesh::IO::Options _opt) override
open mesh
Definition: DecimaterViewerWidget.hh:147
DecimaterViewerWidget(QWidget *_parent=0)
default constructor
Definition: DecimaterViewerWidget.hh:121
Definition: MeshViewerWidgetT.hh:71
virtual bool open_mesh(const char *_filename, OpenMesh::IO::Options _opt)
open mesh
Definition: MeshViewerWidgetT_impl.hh:75
Set options for reader/writer modules.
Definition: Options.hh:92
Triangle mesh based on the ArrayKernel.
Definition: TriMesh_ArrayKernelT.hh:96
This file defines the default traits and some convenience macros.