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< MeshT > Self
 
typedef MeshT Mesh
 
typedef CollapseInfoT< MeshT > CollapseInfo
 
typedef ModBaseT< MeshT > Module
 
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.
 
void info (std::ostream &_os)
 Print information about modules to _os.
 
void set_observer (Observer *_o)
 Add observer. More...
 
Observerobserver ()
 Get current observer of a decimater.
 
Mesh & mesh ()
 access mesh. used in modules.
 
template<typename _Module >
bool add (ModHandleT< _Module > &_mh)
 add module to decimater
 
template<typename _Module >
bool remove (ModHandleT< _Module > &_mh)
 remove module
 
template<typename Module >
Modulemodule (ModHandleT< Module > &_mh)
 get module referenced by handle _mh
 

Protected Member Functions

bool notify_observer (size_t _n_collapses)
 returns false, if abort requested by observer
 
void set_uninitialized ()
 Reset the initialized flag, and clear the bmodules_ and cmodule_.
 
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)
 
void preprocess_collapse (CollapseInfo &_ci)
 Pre-process a collapse.
 
void postprocess_collapse (CollapseInfo &_ci)
 Post-process a collapse.
 
void set_error_tolerance_factor (double _factor)
 
void reset ()
 

Private Attributes

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

Detailed Description

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

Definition at line 85 of file BaseDecimaterT.hh.

Member Function Documentation

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

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


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