Developer Documentation
OpenMesh::Decimater::BaseDecimaterT< MeshT > Class Template Reference
Inheritance diagram for OpenMesh::Decimater::BaseDecimaterT< MeshT >:
OpenMesh::Utils::Noncopyable OpenMesh::Decimater::DecimaterT< MeshT > OpenMesh::Decimater::McDecimaterT< MeshT > OpenMesh::Decimater::MixedDecimaterT< MeshT > OpenMesh::Decimater::MixedDecimaterT< MeshT >

Public Types

typedef BaseDecimaterT< MeshTSelf
 
typedef MeshT Mesh
 
typedef CollapseInfoT< MeshTCollapseInfo
 
typedef ModBaseT< MeshTModule
 
typedef std::vector< Module * > ModuleList
 
typedef ModuleList::iterator ModuleListIterator
 

Public Member Functions

 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...
 

Protected Member Functions

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 ()
 

Private Attributes

Meshmesh_
 reference to mesh More...
 
ModuleList bmodules_
 list of binary modules More...
 
Modulecmodule_
 the current priority module More...
 
ModuleList all_modules_
 list of all allocated modules (including cmodule_ and all of bmodules_) More...
 
bool initialized_
 Flag if all modules were initialized. More...
 
Observerobserver_
 observer More...
 

Detailed Description

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

Definition at line 85 of file BaseDecimaterT.hh.

Member Typedef Documentation

◆ CollapseInfo

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

Definition at line 91 of file BaseDecimaterT.hh.

◆ Mesh

Definition at line 90 of file BaseDecimaterT.hh.

◆ Module

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

Definition at line 92 of file BaseDecimaterT.hh.

◆ ModuleList

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

Definition at line 93 of file BaseDecimaterT.hh.

◆ ModuleListIterator

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

Definition at line 94 of file BaseDecimaterT.hh.

◆ Self

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

Definition at line 89 of file BaseDecimaterT.hh.

Constructor & Destructor Documentation

◆ BaseDecimaterT()

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

Definition at line 69 of file BaseDecimaterT_impl.hh.

◆ ~BaseDecimaterT()

Definition at line 81 of file BaseDecimaterT_impl.hh.

Member Function Documentation

◆ add()

template<typename MeshT >
template<typename _Module >
bool OpenMesh::Decimater::BaseDecimaterT< MeshT >::add ( ModHandleT< _Module > &  _mh)
inline

add module to decimater

Definition at line 142 of file BaseDecimaterT.hh.

◆ collapse_priority()

template<class Mesh >
float OpenMesh::Decimater::BaseDecimaterT< Mesh >::collapse_priority ( const CollapseInfo _ci)
protected

Calculate priority of an halfedge collapse (using the modules)

Definition at line 154 of file BaseDecimaterT_impl.hh.

◆ info()

template<class Mesh >
void OpenMesh::Decimater::BaseDecimaterT< Mesh >::info ( std::ostream &  _os)

Print information about modules to _os.

Definition at line 205 of file BaseDecimaterT_impl.hh.

◆ initialize()

template<class Mesh >
bool OpenMesh::Decimater::BaseDecimaterT< Mesh >::initialize ( void  )

Initialize decimater and decimating modules.

Return values: true ok false No ore more than one non-binary module exist. In that case the decimater is uninitialized!

Definition at line 236 of file BaseDecimaterT_impl.hh.

◆ is_collapse_legal()

template<class Mesh >
bool OpenMesh::Decimater::BaseDecimaterT< Mesh >::is_collapse_legal ( const CollapseInfo _ci)
protected

Is an edge collapse legal? Performs topological test only. The method evaluates the status bit Locked, Deleted, and Feature.

Attention
The method temporarily sets the bit Tagged. After usage the bit will be disabled!

Definition at line 100 of file BaseDecimaterT_impl.hh.

◆ is_initialized()

template<typename MeshT >
bool OpenMesh::Decimater::BaseDecimaterT< MeshT >::is_initialized ( ) const
inline

Returns whether decimater has been successfully initialized.

Definition at line 111 of file BaseDecimaterT.hh.

◆ mesh()

template<typename MeshT >
Mesh & OpenMesh::Decimater::BaseDecimaterT< MeshT >::mesh ( )
inline

access mesh. used in modules.

Definition at line 138 of file BaseDecimaterT.hh.

◆ module()

template<typename MeshT >
template<typename Module >
Module & OpenMesh::Decimater::BaseDecimaterT< MeshT >::module ( ModHandleT< Module > &  _mh)
inline

get module referenced by handle _mh

Definition at line 181 of file BaseDecimaterT.hh.

◆ notify_observer()

template<typename MeshT >
bool OpenMesh::Decimater::BaseDecimaterT< MeshT >::notify_observer ( size_t  _n_collapses)
inlineprotected

returns false, if abort requested by observer

Definition at line 191 of file BaseDecimaterT.hh.

◆ observer()

template<typename MeshT >
Observer * OpenMesh::Decimater::BaseDecimaterT< MeshT >::observer ( )
inline

Get current observer of a decimater.

Definition at line 132 of file BaseDecimaterT.hh.

◆ postprocess_collapse()

template<class Mesh >
void OpenMesh::Decimater::BaseDecimaterT< Mesh >::postprocess_collapse ( CollapseInfo _ci)
protected

Post-process a collapse.

Definition at line 167 of file BaseDecimaterT_impl.hh.

◆ preprocess_collapse()

template<class Mesh >
void OpenMesh::Decimater::BaseDecimaterT< Mesh >::preprocess_collapse ( CollapseInfo _ci)
protected

Pre-process a collapse.

Definition at line 179 of file BaseDecimaterT_impl.hh.

◆ remove()

template<typename MeshT >
template<typename _Module >
bool OpenMesh::Decimater::BaseDecimaterT< MeshT >::remove ( ModHandleT< _Module > &  _mh)
inline

remove module

Definition at line 158 of file BaseDecimaterT.hh.

◆ reset()

template<typename MeshT >
void OpenMesh::Decimater::BaseDecimaterT< MeshT >::reset ( )
inlineprotected

Reset the status of this class

You have to call initialize again!!

Definition at line 248 of file BaseDecimaterT.hh.

◆ set_error_tolerance_factor()

template<class Mesh >
void OpenMesh::Decimater::BaseDecimaterT< Mesh >::set_error_tolerance_factor ( double  _factor)
protected

This provides a function that allows the setting of a percentage of the original constraint of the modules

Note that some modules might re-initialize in their set_error_tolerance_factor function as necessary

Parameters
_factorhas to be in the closed interval between 0.0 and 1.0

Definition at line 191 of file BaseDecimaterT_impl.hh.

◆ set_observer()

template<typename MeshT >
void OpenMesh::Decimater::BaseDecimaterT< MeshT >::set_observer ( Observer _o)
inline

Add observer.

You can set an observer which is used as a callback to check the decimators progress and to abort it if necessary.

Parameters
_oObserver to be used

Definition at line 126 of file BaseDecimaterT.hh.

◆ set_uninitialized()

template<typename MeshT >
void OpenMesh::Decimater::BaseDecimaterT< MeshT >::set_uninitialized ( )
inlineprotected

Reset the initialized flag, and clear the bmodules_ and cmodule_.

Definition at line 202 of file BaseDecimaterT.hh.

◆ update_modules()

template<typename MeshT >
void OpenMesh::Decimater::BaseDecimaterT< MeshT >::update_modules ( CollapseInfo _ci)
inlineprotected

Definition at line 208 of file BaseDecimaterT.hh.

Member Data Documentation

◆ all_modules_

template<typename MeshT >
ModuleList OpenMesh::Decimater::BaseDecimaterT< MeshT >::all_modules_
private

list of all allocated modules (including cmodule_ and all of bmodules_)

Definition at line 264 of file BaseDecimaterT.hh.

◆ bmodules_

template<typename MeshT >
ModuleList OpenMesh::Decimater::BaseDecimaterT< MeshT >::bmodules_
private

list of binary modules

Definition at line 258 of file BaseDecimaterT.hh.

◆ cmodule_

template<typename MeshT >
Module* OpenMesh::Decimater::BaseDecimaterT< MeshT >::cmodule_
private

the current priority module

Definition at line 261 of file BaseDecimaterT.hh.

◆ initialized_

template<typename MeshT >
bool OpenMesh::Decimater::BaseDecimaterT< MeshT >::initialized_
private

Flag if all modules were initialized.

Definition at line 267 of file BaseDecimaterT.hh.

◆ mesh_

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

reference to mesh

Definition at line 255 of file BaseDecimaterT.hh.

◆ observer_

template<typename MeshT >
Observer* OpenMesh::Decimater::BaseDecimaterT< MeshT >::observer_
private

observer

Definition at line 270 of file BaseDecimaterT.hh.


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