58#ifndef OPENMESH_DECIMATER_DECIMATERT_HH
59#define OPENMESH_DECIMATER_DECIMATERT_HH
66#include <OpenMesh/Core/Utils/Property.hh>
82template <
typename MeshT >
91 typedef std::vector< Module* > ModuleList;
92 typedef typename ModuleList::iterator ModuleListIterator;
126 return ( (_n_vertices < this->
mesh().n_vertices()) ?
127 decimate( this->
mesh().n_vertices() - _n_vertices ) : 0 );
154 HeapInterface(Mesh& _mesh,
157 : mesh_(_mesh), prio_(_prio), pos_(_pos)
161 less( VertexHandle _vh0, VertexHandle _vh1 )
162 {
return mesh_.property(prio_, _vh0) < mesh_.property(prio_, _vh1); }
165 greater( VertexHandle _vh0, VertexHandle _vh1 )
166 {
return mesh_.property(prio_, _vh0) > mesh_.property(prio_, _vh1); }
169 get_heap_position(VertexHandle _vh)
170 {
return mesh_.property(pos_, _vh); }
173 set_heap_position(VertexHandle _vh,
int _pos)
174 { mesh_.property(pos_, _vh) = _pos; }
189 void heap_vertex(VertexHandle _vh);
198 #if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
199 std::unique_ptr<DeciHeap> heap_;
201 std::auto_ptr<DeciHeap> heap_;
215#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_DECIMATER_DECIMATERT_CC)
216#define OPENMESH_DECIMATER_TEMPLATES
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:64
Software related to mesh decimation.
AttribKernel::VertexHandle VertexHandle
Definition PolyMeshT.hh:139
AttribKernel::HalfedgeHandle HalfedgeHandle
Definition PolyMeshT.hh:140
Handle representing a vertex property.
Definition Property.hh:488
Mesh & mesh()
access mesh. used in modules.
Definition BaseDecimaterT.hh:143
Stores information about a halfedge collapse.
Definition CollapseInfoT.hh:80
size_t decimate_to(size_t _n_vertices)
Decimate the mesh to a desired target vertex complexity.
Definition DecimaterT.hh:124
size_t decimate_to_faces(size_t _n_vertices=0, size_t _n_faces=0)
Attempts to decimate the mesh until a desired vertex or face complexity is achieved.
Definition DecimaterT.cc:260
~DecimaterT()
Destructor.
Definition DecimaterT.cc:98
DecimaterT(Mesh &_mesh)
Constructor.
Definition DecimaterT.cc:78
size_t decimate(size_t _n_collapses=0)
Perform a number of collapses on the mesh.
Definition DecimaterT.cc:156
Base class for all decimation modules.
Definition ModBaseT.hh:198
An efficient, highly customizable heap.
Definition HeapT.hh:144