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

Use Normal deviation to control decimation. More...

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

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

Public Types

typedef Mesh::Scalar Scalar
 
typedef Mesh::Point Point
 
typedef Mesh::Normal Normal
 
typedef Mesh::VertexHandle VertexHandle
 
typedef Mesh::FaceHandle FaceHandle
 
typedef Mesh::EdgeHandle EdgeHandle
 
typedef NormalConeT< Normal > NormalCone
 
- Public Types inherited from OpenMesh::Decimater::ModBaseT< MeshT >
enum  { ILLEGAL_COLLAPSE = -1 , LEGAL_COLLAPSE = 0 }
 
typedef MeshT Mesh
 
typedef CollapseInfoT< MeshTCollapseInfo
 

Public Member Functions

 DECIMATING_MODULE (ModNormalDeviationT, MeshT, NormalDeviation)
 
 ModNormalDeviationT (MeshT &_mesh, float _max_dev=180.0)
 Constructor. More...
 
 ~ModNormalDeviationT ()
 Destructor. More...
 
Scalar normal_deviation () const
 Get normal deviation ( 0 .. 360 ) More...
 
void set_normal_deviation (Scalar _s)
 Set normal deviation ( 0 .. 360 ) More...
 
void initialize () override
 Allocate and init normal cones. More...
 
float collapse_priority (const CollapseInfo &_ci) override
 Control normals when Decimating. More...
 
void set_error_tolerance_factor (double _factor) override
 set the percentage of normal deviation More...
 
void postprocess_collapse (const CollapseInfo &_ci) override
 
- Public Member Functions inherited from OpenMesh::Decimater::ModBaseT< MeshT >
virtual ~ModBaseT ()
 Virtual desctructor. More...
 
virtual const std::string & name () const
 Set module's name. More...
 
bool is_binary (void) const
 Returns true if criteria returns a binary value. More...
 
void set_binary (bool _b)
 Set whether module is binary or not. More...
 
virtual void initialize ()
 Initialize module-internal stuff. More...
 
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)
 

Private Attributes

Meshmesh_
 
Scalar normal_deviation_
 
OpenMesh::FPropHandleT< NormalConenormal_cones_
 

Additional Inherited Members

- Protected Member Functions inherited from OpenMesh::Decimater::ModBaseT< MeshT >
 ModBaseT (MeshT &_mesh, bool _is_binary)
 
MeshTmesh ()
 Access the mesh associated with the decimater. More...
 
- Protected Attributes inherited from OpenMesh::Decimater::ModBaseT< MeshT >
double error_tolerance_factor_
 

Detailed Description

template<class MeshT>
class OpenMesh::Decimater::ModNormalDeviationT< MeshT >

Use Normal deviation to control decimation.

The module tracks the normals while decimating a normal cone consisting of all normals of the faces collapsed together is computed and if a collapse would increase the size of the cone to a value greater than the given value the collapse will be illegal.

In binary and mode, the collapse is legal if:

  • The normal deviation after the collapse is lower than the given value

In continuous mode the maximal deviation is returned

Definition at line 88 of file ModNormalDeviationT.hh.

Member Typedef Documentation

◆ EdgeHandle

template<class MeshT >
typedef Mesh::EdgeHandle OpenMesh::Decimater::ModNormalDeviationT< MeshT >::EdgeHandle

Definition at line 99 of file ModNormalDeviationT.hh.

◆ FaceHandle

template<class MeshT >
typedef Mesh::FaceHandle OpenMesh::Decimater::ModNormalDeviationT< MeshT >::FaceHandle

Definition at line 98 of file ModNormalDeviationT.hh.

◆ Normal

Definition at line 96 of file ModNormalDeviationT.hh.

◆ NormalCone

template<class MeshT >
typedef NormalConeT<Normal> OpenMesh::Decimater::ModNormalDeviationT< MeshT >::NormalCone

Definition at line 100 of file ModNormalDeviationT.hh.

◆ Point

template<class MeshT >
typedef Mesh::Point OpenMesh::Decimater::ModNormalDeviationT< MeshT >::Point

Definition at line 95 of file ModNormalDeviationT.hh.

◆ Scalar

Definition at line 94 of file ModNormalDeviationT.hh.

◆ VertexHandle

template<class MeshT >
typedef Mesh::VertexHandle OpenMesh::Decimater::ModNormalDeviationT< MeshT >::VertexHandle

Definition at line 97 of file ModNormalDeviationT.hh.

Constructor & Destructor Documentation

◆ ModNormalDeviationT()

template<class MeshT >
OpenMesh::Decimater::ModNormalDeviationT< MeshT >::ModNormalDeviationT ( MeshT _mesh,
float  _max_dev = 180.0 
)
inlineexplicit

Constructor.

Definition at line 107 of file ModNormalDeviationT.hh.

◆ ~ModNormalDeviationT()

Destructor.

Definition at line 125 of file ModNormalDeviationT.hh.

Member Function Documentation

◆ collapse_priority()

template<class MeshT >
float OpenMesh::Decimater::ModNormalDeviationT< MeshT >::collapse_priority ( const CollapseInfo _ci)
inlineoverride

Control normals when Decimating.

Binary and Cont. mode.

The module tracks the normals while decimating a normal cone consisting of all normals of the faces collapsed together is computed and if a collapse would increase the size of the cone to a value greater than the given value the collapse will be illegal.

Parameters
_ciCollapse info data
Returns
Half of the normal cones size (radius in radians)

Definition at line 168 of file ModNormalDeviationT.hh.

◆ initialize()

template<class MeshT >
void OpenMesh::Decimater::ModNormalDeviationT< MeshT >::initialize ( void  )
inlineoverridevirtual

Allocate and init normal cones.

Reimplemented from OpenMesh::Decimater::ModBaseT< MeshT >.

Definition at line 143 of file ModNormalDeviationT.hh.

◆ normal_deviation()

template<class MeshT >
Scalar OpenMesh::Decimater::ModNormalDeviationT< MeshT >::normal_deviation ( ) const
inline

Get normal deviation ( 0 .. 360 )

Definition at line 132 of file ModNormalDeviationT.hh.

◆ postprocess_collapse()

template<class MeshT >
void OpenMesh::Decimater::ModNormalDeviationT< MeshT >::postprocess_collapse ( const CollapseInfo _ci)
inlineoverride

Definition at line 219 of file ModNormalDeviationT.hh.

◆ set_error_tolerance_factor()

template<class MeshT >
void OpenMesh::Decimater::ModNormalDeviationT< MeshT >::set_error_tolerance_factor ( double  _factor)
inlineoverridevirtual

set the percentage of normal deviation

Reimplemented from OpenMesh::Decimater::ModBaseT< MeshT >.

Definition at line 206 of file ModNormalDeviationT.hh.

◆ set_normal_deviation()

template<class MeshT >
void OpenMesh::Decimater::ModNormalDeviationT< MeshT >::set_normal_deviation ( Scalar  _s)
inline

Set normal deviation ( 0 .. 360 )

Definition at line 137 of file ModNormalDeviationT.hh.

Member Data Documentation

◆ mesh_

template<class MeshT >
Mesh& OpenMesh::Decimater::ModNormalDeviationT< MeshT >::mesh_
private

Definition at line 249 of file ModNormalDeviationT.hh.

◆ normal_cones_

Definition at line 251 of file ModNormalDeviationT.hh.

◆ normal_deviation_

template<class MeshT >
Scalar OpenMesh::Decimater::ModNormalDeviationT< MeshT >::normal_deviation_
private

Definition at line 250 of file ModNormalDeviationT.hh.


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