OpenMesh
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenMesh::Decimater::ModBaseT< DecimaterType > Class Template Reference

Base class for all decimation modules. More...

#include <OpenMesh/Tools/Decimater/ModBaseT.hh>

Inheritance diagram for OpenMesh::Decimater::ModBaseT< DecimaterType >:

List of all members.

Public Types

enum  { ILLEGAL_COLLAPSE = -1, LEGAL_COLLAPSE = 0 }
typedef DecimaterType::Mesh Mesh
typedef CollapseInfoT< Mesh > CollapseInfo

Public Member Functions

virtual ~ModBaseT ()
 Virtual desctructor.
virtual const std::string & name () const
 Set module's name (using DECIMATER_MODNAME macro)
bool is_binary (void) const
 Returns true if criteria returns a binary value.
void set_binary (bool _b)
 Set whether module is binary or not.
virtual void initialize ()
 Initialize module-internal stuff.
virtual float collapse_priority (const CollapseInfoT< Mesh > &)
 Return collapse priority.
virtual void preprocess_collapse (const CollapseInfoT< Mesh > &)
 Before _from_vh has been collapsed into _to_vh, this method will be called.
virtual void postprocess_collapse (const CollapseInfoT< Mesh > &)
 After _from_vh has been collapsed into _to_vh, this method will be called.

Protected Member Functions

 ModBaseT (DecimaterType &_dec, bool _is_binary)
 Default constructor.
Mesh & mesh ()
 Access the mesh associated with the decimater.

Detailed Description

template<typename DecimaterType>
class OpenMesh::Decimater::ModBaseT< DecimaterType >

Base class for all decimation modules.

Each module has to implement this interface.
To build your own module you have to 
-# derive from this class.
-# create the basic settings with DECIMATING_MODULE().
-# override collapse_priority(), if necessary.
-# override initialize(), if necessary.
-# override postprocess_collapse(), if necessary.

A module has two major working modes:
-# binary mode
-# non-binary mode

In the binary mode collapse_priority() checks a constraint and
returns LEGAL_COLLAPSE or ILLEGAL_COLLAPSE.

In the non-binary mode the module computes a float error value in
the range [0, inf) and returns it. In the case a constraint has
been set, e.g. the error must be lower than a upper bound, and the
constraint is violated, collapse_priority() must return
ILLEGAL_COLLAPSE.

\see collapse_priority()
Todo:
"Tutorial on building a custom decimation module."

Member Enumeration Documentation

template<typename DecimaterType>
anonymous enum
Enumerator:
ILLEGAL_COLLAPSE 

indicates an illegal collapse

LEGAL_COLLAPSE 

indicates a legal collapse


Constructor & Destructor Documentation

template<typename DecimaterType>
OpenMesh::Decimater::ModBaseT< DecimaterType >::ModBaseT ( DecimaterType &  _dec,
bool  _is_binary 
)
inlineprotected

Default constructor.

See also:
Mesh Decimation Framework

Member Function Documentation

template<typename DecimaterType>
virtual float OpenMesh::Decimater::ModBaseT< DecimaterType >::collapse_priority ( const CollapseInfoT< Mesh > &  )
inlinevirtual

Return collapse priority.

In the binary mode collapse_priority() checks a constraint and returns LEGAL_COLLAPSE or ILLEGAL_COLLAPSE.

In the non-binary mode the module computes a float error value in the range [0, inf) and returns it. In the case a constraint has been set, e.g. the error must be lower than a upper bound, and the constraint is violated, collapse_priority() must return ILLEGAL_COLLAPSE.

Returns:
Collapse priority in the range [0,inf), LEGAL_COLLAPSE or ILLEGAL_COLLAPSE.

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

acg pic Project OpenMesh, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .