53#ifndef OPENMESH_DECIMATER_DECIMATERT_HH
54#define OPENMESH_DECIMATER_DECIMATERT_HH
61#include <OpenMesh/Core/Utils/Property.hh>
77template <
typename MeshT >
86 typedef std::vector< Module* > ModuleList;
87 typedef typename ModuleList::iterator ModuleListIterator;
109 size_t decimate(
size_t _n_collapses = 0 ,
bool _only_selected =
false);
121 size_t decimate_to(
size_t _n_vertices ,
bool _only_selected =
false)
123 return ( (_n_vertices < this->
mesh().n_vertices()) ?
124 decimate( this->
mesh().n_vertices() - _n_vertices , _only_selected ) : 0 );
140 size_t decimate_to_faces(
size_t _n_vertices=0,
size_t _n_faces=0 ,
bool _only_selected =
false);
155 : mesh_(_mesh), prio_(_prio), pos_(_pos)
159 less( VertexHandle _vh0, VertexHandle _vh1 )
160 {
return mesh_.property(prio_, _vh0) < mesh_.property(prio_, _vh1); }
163 greater( VertexHandle _vh0, VertexHandle _vh1 )
164 {
return mesh_.property(prio_, _vh0) > mesh_.property(prio_, _vh1); }
167 get_heap_position(VertexHandle _vh)
168 {
return mesh_.property(pos_, _vh); }
171 set_heap_position(VertexHandle _vh,
int _pos)
172 { mesh_.property(pos_, _vh) = _pos; }
187 void heap_vertex(VertexHandle _vh);
196 #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
197 std::unique_ptr<DeciHeap> heap_;
199 std::auto_ptr<DeciHeap> heap_;
213#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_DECIMATER_DECIMATERT_CC)
214#define OPENMESH_DECIMATER_TEMPLATES
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
Handle for a vertex entity.
Definition: Handles.hh:121
Handle for a halfedge entity.
Definition: Handles.hh:128
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition: PolyMeshT.hh:136
Kernel::HalfedgeHandle HalfedgeHandle
Scalar type.
Definition: PolyMeshT.hh:137
Definition: BaseDecimaterT.hh:86
Mesh & mesh()
access mesh. used in modules.
Definition: BaseDecimaterT.hh:138
Stores information about a halfedge collapse.
Definition: CollapseInfoT.hh:74
Decimater framework.
Definition: DecimaterT.hh:79
size_t decimate(size_t _n_collapses=0, bool _only_selected=false)
Perform a number of collapses on the mesh.
Definition: DecimaterT_impl.hh:150
size_t decimate_to_faces(size_t _n_vertices=0, size_t _n_faces=0, bool _only_selected=false)
Attempts to decimate the mesh until a desired vertex or face complexity is achieved.
Definition: DecimaterT_impl.hh:259
~DecimaterT()
Destructor.
Definition: DecimaterT_impl.hh:92
size_t decimate_to(size_t _n_vertices, bool _only_selected=false)
Decimate the mesh to a desired target vertex complexity.
Definition: DecimaterT.hh:121
DecimaterT(Mesh &_mesh)
Constructor.
Definition: DecimaterT_impl.hh:72
Heap interface.
Definition: DecimaterT.hh:149
Base class for all decimation modules.
Definition: ModBaseT.hh:193
An efficient, highly customizable heap.
Definition: HeapT.hh:139