Developer Documentation

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
OpenMesh::Decimater::ModBaseT< MeshT > Class Template Reference

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

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

## Public Types
enum | { ILLEGAL_COLLAPSE = -1, LEGAL_COLLAPSE = 0 }
typedef MeshT | Mesh
typedef CollapseInfoT< MeshT > | CollapseInfo

## Public Member Functions
virtual | ~ModBaseT ()
| Virtual desctructor.
virtual const std::string & | name () const
| Set module's name.
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< MeshT > &)
virtual void | preprocess_collapse (const CollapseInfoT< MeshT > &)
virtual void | postprocess_collapse (const CollapseInfoT< MeshT > &)
virtual void | set_error_tolerance_factor (double _factor)

## Protected Member Functions
| ModBaseT (MeshT &_mesh, bool _is_binary)
MeshT & | mesh ()
| Access the mesh associated with the decimater.

## Protected Attributes
double | error_tolerance_factor_

## Private Member Functions
| ModBaseT (const ModBaseT &_cpy)
ModBaseT & | operator= (const ModBaseT &)

## Private Attributes
MeshT & | mesh_
bool | is_binary_

## Detailed Description

### template<typename MeshT>
class OpenMesh::Decimater::ModBaseT< MeshT >

Base class for all decimation modules.

Each module has to implement this interface. To build your own module you have to

1. derive from this class.
2. create the basic settings with DECIMATING_MODULE().
3. override collapse_priority(), if necessary.
4. override initialize(), if necessary.
5. override postprocess_collapse(), if necessary.

A module has two major working modes:

1. binary mode
2. 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 also
  collapse_priority()

Todo:
  "Tutorial on building a custom decimation module."

Definition at line 192 of file ModBaseT.hh.

## Member Enumeration Documentation

## ◆ anonymous enum

template<typename MeshT>

anonymous enum

Enumerator
ILLEGAL_COLLAPSE | indicates an illegal collapse
LEGAL_COLLAPSE | indicates a legal collapse

Definition at line 198 of file ModBaseT.hh.

## Constructor & Destructor Documentation

## ◆ ModBaseT()

template<typename MeshT>

OpenMesh::Decimater::ModBaseT< MeshT >::ModBaseT | ( | MeshT & | _mesh,
|  | bool | _is_binary
| ) |  |
| inline protected

Default constructor

See also
  Mesh Decimation Framework

Definition at line 207 of file ModBaseT.hh.

## Member Function Documentation

## ◆ collapse_priority()

template<typename MeshT>

virtual float OpenMesh::Decimater::ModBaseT< MeshT >::collapse_priority | ( | const CollapseInfoT< MeshT > & |  | ) |
| inline virtual

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

Reimplemented in OpenMesh::Decimater::ModNormalDeviationT< MeshT >, OpenMesh::Decimater::ModNormalDeviationT< TriMesh >, OpenMesh::Decimater::ModNormalFlippingT< MeshT >, OpenMesh::Decimater::ModNormalFlippingT< TriMesh >, OpenMesh::Decimater::ModHausdorffT< MeshT >, OpenMesh::Decimater::ModHausdorffT< TriMesh >, OpenMesh::Decimater::ModRoundnessT< MeshT >, OpenMesh::Decimater::ModRoundnessT< TriMesh >, ModBalancerT< D >, OpenMesh::Decimater::ModAspectRatioT< MeshT >, OpenMesh::Decimater::ModAspectRatioT< TriMesh >, OpenMesh::Decimater::ModQuadricT< MeshT >, OpenMesh::Decimater::ModQuadricT< D >, OpenMesh::Decimater::ModQuadricT< TriMesh >, OpenMesh::Decimater::ModEdgeLengthT< MeshT >, and OpenMesh::Decimater::ModEdgeLengthT< TriMesh >.

Definition at line 245 of file ModBaseT.hh.

## ◆ postprocess_collapse()

template<typename MeshT>

virtual void OpenMesh::Decimater::ModBaseT< MeshT >::postprocess_collapse | ( | const CollapseInfoT< MeshT > & |  | ) |
| inline virtual

After _from_vh has been collapsed into _to_vh, this method will be called.

Reimplemented in OpenMesh::Decimater::ModNormalDeviationT< MeshT >, OpenMesh::Decimater::ModNormalDeviationT< TriMesh >, ModBalancerT< D >, OpenMesh::Decimater::ModQuadricT< MeshT >, OpenMesh::Decimater::ModQuadricT< D >, OpenMesh::Decimater::ModQuadricT< TriMesh >, OpenMesh::Decimater::ModProgMeshT< MeshT >, OpenMesh::Decimater::ModHausdorffT< MeshT >, OpenMesh::Decimater::ModHausdorffT< TriMesh >, OpenMesh::Decimater::ModIndependentSetsT< MeshT >, and OpenMesh::Decimater::ModIndependentSetsT< TriMesh >.

Definition at line 257 of file ModBaseT.hh.

## ◆ preprocess_collapse()

template<typename MeshT>

virtual void OpenMesh::Decimater::ModBaseT< MeshT >::preprocess_collapse | ( | const CollapseInfoT< MeshT > & |  | ) |
| inline virtual

Before _from_vh has been collapsed into _to_vh, this method will be called.

Reimplemented in OpenMesh::Decimater::ModAspectRatioT< MeshT >, and OpenMesh::Decimater::ModAspectRatioT< TriMesh >.

Definition at line 251 of file ModBaseT.hh.

## ◆ set_error_tolerance_factor()

template<typename MeshT>

virtual void OpenMesh::Decimater::ModBaseT< MeshT >::set_error_tolerance_factor | ( | double | _factor | ) |
| inline virtual

This provides a function that allows the setting of a percentage of the original contraint.

Note that the module might need to be re-initialized again after setting the percentage

Parameters

  _factor | has to be in the closed interval between 0.0 and 1.0

Reimplemented in OpenMesh::Decimater::ModNormalDeviationT< MeshT >, OpenMesh::Decimater::ModNormalDeviationT< TriMesh >, OpenMesh::Decimater::ModRoundnessT< MeshT >, OpenMesh::Decimater::ModRoundnessT< TriMesh >, OpenMesh::Decimater::ModNormalFlippingT< MeshT >, OpenMesh::Decimater::ModNormalFlippingT< TriMesh >, OpenMesh::Decimater::ModQuadricT< MeshT >, OpenMesh::Decimater::ModQuadricT< D >, OpenMesh::Decimater::ModQuadricT< TriMesh >, OpenMesh::Decimater::ModHausdorffT< MeshT >, OpenMesh::Decimater::ModHausdorffT< TriMesh >, OpenMesh::Decimater::ModAspectRatioT< MeshT >, OpenMesh::Decimater::ModAspectRatioT< TriMesh >, OpenMesh::Decimater::ModEdgeLengthT< MeshT >, and OpenMesh::Decimater::ModEdgeLengthT< TriMesh >.

Definition at line 268 of file ModBaseT.hh.

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

- OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Tools/Decimater/ModBaseT.hh