53 #ifndef OPENMESH_DECIMATER_DECIMATERT_HH 54 #define OPENMESH_DECIMATER_DECIMATERT_HH 61 #include <OpenMesh/Core/Utils/Property.hh> 77 template <
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);
145 typedef typename Mesh::HalfedgeHandle HalfedgeHandle;
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; }
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 218 #endif // OPENMESH_DECIMATER_DECIMATERT_HH defined
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.
DecimaterT(Mesh &_mesh)
Constructor.
Mesh & mesh()
access mesh. used in modules.
size_t decimate(size_t _n_collapses=0, bool _only_selected=false)
Perform a number of collapses on the mesh.
void heap_vertex(VertexHandle _vh)
Insert vertex in heap.
size_t decimate_to(size_t _n_vertices, bool _only_selected=false)
Decimate the mesh to a desired target vertex complexity.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.