Developer Documentation
OpenMesh::Decimater::DecimaterT< MeshT > Class Template Reference

#include <OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Tools/Decimater/DecimaterT.hh>

Inheritance diagram for OpenMesh::Decimater::DecimaterT< MeshT >:
OpenMesh::Decimater::BaseDecimaterT< MeshT > OpenMesh::Utils::Noncopyable OpenMesh::Decimater::MixedDecimaterT< MeshT >

Classes

class  HeapInterface
 Heap interface. More...
 

Public Types

typedef DecimaterT< MeshTSelf
 
typedef MeshT Mesh
 
typedef CollapseInfoT< MeshTCollapseInfo
 
typedef ModBaseT< MeshTModule
 
typedef std::vector< Module * > ModuleList
 
typedef ModuleList::iterator ModuleListIterator
 
typedef Mesh::VertexHandle VertexHandle
 
typedef Mesh::HalfedgeHandle HalfedgeHandle
 
typedef Utils::HeapT< VertexHandle, HeapInterfaceDeciHeap
 
- Public Types inherited from OpenMesh::Decimater::BaseDecimaterT< MeshT >
typedef BaseDecimaterT< MeshTSelf
 
typedef MeshT Mesh
 
typedef CollapseInfoT< MeshTCollapseInfo
 
typedef ModBaseT< MeshTModule
 
typedef std::vector< Module * > ModuleList
 
typedef ModuleList::iterator ModuleListIterator
 

Public Member Functions

 DecimaterT (Mesh &_mesh)
 Constructor. More...
 
 ~DecimaterT ()
 Destructor. More...
 
size_t decimate (size_t _n_collapses=0, bool _only_selected=false)
 Perform a number of collapses on the mesh. More...
 
size_t decimate_to (size_t _n_vertices, bool _only_selected=false)
 Decimate the mesh to a desired target vertex complexity. More...
 
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. More...
 
- Public Member Functions inherited from OpenMesh::Decimater::BaseDecimaterT< MeshT >
 BaseDecimaterT (Mesh &_mesh)
 
bool initialize ()
 
bool is_initialized () const
 Returns whether decimater has been successfully initialized. More...
 
void info (std::ostream &_os)
 Print information about modules to _os. More...
 
void set_observer (Observer *_o)
 Add observer. More...
 
Observerobserver ()
 Get current observer of a decimater. More...
 
Meshmesh ()
 access mesh. used in modules. More...
 
template<typename _Module >
bool add (ModHandleT< _Module > &_mh)
 add module to decimater More...
 
template<typename _Module >
bool remove (ModHandleT< _Module > &_mh)
 remove module More...
 
template<typename Module >
Modulemodule (ModHandleT< Module > &_mh)
 get module referenced by handle _mh More...
 

Private Member Functions

void heap_vertex (VertexHandle _vh)
 Insert vertex in heap. More...
 

Private Attributes

Meshmesh_
 
std::auto_ptr< DeciHeapheap_
 
VPropHandleT< HalfedgeHandle > collapse_target_
 
VPropHandleT< float > priority_
 
VPropHandleT< int > heap_position_
 

Additional Inherited Members

- Protected Member Functions inherited from OpenMesh::Decimater::BaseDecimaterT< MeshT >
bool notify_observer (size_t _n_collapses)
 returns false, if abort requested by observer More...
 
void set_uninitialized ()
 Reset the initialized flag, and clear the bmodules_ and cmodule_. More...
 
void update_modules (CollapseInfo &_ci)
 
bool is_collapse_legal (const CollapseInfo &_ci)
 
float collapse_priority (const CollapseInfo &_ci)
 Calculate priority of an halfedge collapse (using the modules) More...
 
void preprocess_collapse (CollapseInfo &_ci)
 Pre-process a collapse. More...
 
void postprocess_collapse (CollapseInfo &_ci)
 Post-process a collapse. More...
 
void set_error_tolerance_factor (double _factor)
 
void reset ()
 

Detailed Description

template<typename MeshT>
class OpenMesh::Decimater::DecimaterT< MeshT >

Decimater framework.

See also
BaseModT, Mesh Decimation Framework

Definition at line 78 of file DecimaterT.hh.

Member Typedef Documentation

◆ CollapseInfo

template<typename MeshT >
typedef CollapseInfoT<MeshT> OpenMesh::Decimater::DecimaterT< MeshT >::CollapseInfo

Definition at line 84 of file DecimaterT.hh.

◆ DeciHeap

template<typename MeshT >
typedef Utils::HeapT<VertexHandle, HeapInterface> OpenMesh::Decimater::DecimaterT< MeshT >::DeciHeap

Definition at line 181 of file DecimaterT.hh.

◆ HalfedgeHandle

template<typename MeshT >
typedef Mesh::HalfedgeHandle OpenMesh::Decimater::DecimaterT< MeshT >::HalfedgeHandle

Definition at line 145 of file DecimaterT.hh.

◆ Mesh

template<typename MeshT >
typedef MeshT OpenMesh::Decimater::DecimaterT< MeshT >::Mesh

Definition at line 83 of file DecimaterT.hh.

◆ Module

template<typename MeshT >
typedef ModBaseT<MeshT> OpenMesh::Decimater::DecimaterT< MeshT >::Module

Definition at line 85 of file DecimaterT.hh.

◆ ModuleList

template<typename MeshT >
typedef std::vector< Module* > OpenMesh::Decimater::DecimaterT< MeshT >::ModuleList

Definition at line 86 of file DecimaterT.hh.

◆ ModuleListIterator

template<typename MeshT >
typedef ModuleList::iterator OpenMesh::Decimater::DecimaterT< MeshT >::ModuleListIterator

Definition at line 87 of file DecimaterT.hh.

◆ Self

template<typename MeshT >
typedef DecimaterT< MeshT > OpenMesh::Decimater::DecimaterT< MeshT >::Self

Definition at line 82 of file DecimaterT.hh.

◆ VertexHandle

template<typename MeshT >
typedef Mesh::VertexHandle OpenMesh::Decimater::DecimaterT< MeshT >::VertexHandle

Definition at line 144 of file DecimaterT.hh.

Constructor & Destructor Documentation

◆ DecimaterT()

template<class Mesh >
OpenMesh::Decimater::DecimaterT< Mesh >::DecimaterT ( Mesh _mesh)
explicit

Constructor.

Definition at line 72 of file DecimaterT_impl.hh.

◆ ~DecimaterT()

Destructor.

Definition at line 92 of file DecimaterT_impl.hh.

Member Function Documentation

◆ decimate()

template<class Mesh >
size_t OpenMesh::Decimater::DecimaterT< Mesh >::decimate ( size_t  _n_collapses = 0,
bool  _only_selected = false 
)

Perform a number of collapses on the mesh.

Parameters
_n_collapsesDesired number of collapses. If zero (default), attempt to do as many collapses as possible.
_only_selectedOnly consider vertices which are selected for decimation
Returns
Number of collapses that were actually performed.
Note
This operation only marks the removed mesh elements for deletion. In order to actually remove the decimated elements from the mesh, a subsequent call to ArrayKernel::garbage_collection() is required.

Definition at line 150 of file DecimaterT_impl.hh.

◆ decimate_to()

template<typename MeshT >
size_t OpenMesh::Decimater::DecimaterT< MeshT >::decimate_to ( size_t  _n_vertices,
bool  _only_selected = false 
)
inline

Decimate the mesh to a desired target vertex complexity.

Parameters
_n_verticesTarget complexity, i.e. desired number of remaining vertices after decimation.
_only_selectedOnly consider vertices which are selected for decimation
Returns
Number of collapses that were actually performed.
Note
This operation only marks the removed mesh elements for deletion. In order to actually remove the decimated elements from the mesh, a subsequent call to ArrayKernel::garbage_collection() is required.

Definition at line 121 of file DecimaterT.hh.

◆ decimate_to_faces()

template<class Mesh >
size_t OpenMesh::Decimater::DecimaterT< Mesh >::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.

Parameters
_n_verticesTarget vertex complexity.
_n_facesTarget face complexity.
_only_selectedOnly consider vertices which are selected for decimation
Returns
Number of collapses that were actually performed.
Note
Decimation stops as soon as either one of the two complexity bounds is satisfied.
This operation only marks the removed mesh elements for deletion. In order to actually remove the decimated elements from the mesh, a subsequent call to ArrayKernel::garbage_collection() is required.

Definition at line 259 of file DecimaterT_impl.hh.

◆ heap_vertex()

template<class Mesh >
void OpenMesh::Decimater::DecimaterT< Mesh >::heap_vertex ( VertexHandle  _vh)
private

Insert vertex in heap.

Definition at line 104 of file DecimaterT_impl.hh.

Member Data Documentation

◆ collapse_target_

template<typename MeshT >
VPropHandleT<HalfedgeHandle> OpenMesh::Decimater::DecimaterT< MeshT >::collapse_target_
private

Definition at line 203 of file DecimaterT.hh.

◆ heap_

template<typename MeshT >
std::auto_ptr<DeciHeap> OpenMesh::Decimater::DecimaterT< MeshT >::heap_
private

Definition at line 199 of file DecimaterT.hh.

◆ heap_position_

template<typename MeshT >
VPropHandleT<int> OpenMesh::Decimater::DecimaterT< MeshT >::heap_position_
private

Definition at line 205 of file DecimaterT.hh.

◆ mesh_

template<typename MeshT >
Mesh& OpenMesh::Decimater::DecimaterT< MeshT >::mesh_
private

Definition at line 193 of file DecimaterT.hh.

◆ priority_

template<typename MeshT >
VPropHandleT<float> OpenMesh::Decimater::DecimaterT< MeshT >::priority_
private

Definition at line 204 of file DecimaterT.hh.


The documentation for this class was generated from the following files: