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

Use Hausdorff distance to control decimation. More...

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

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

Public Types

typedef Mesh::Scalar Scalar
 
typedef Mesh::Point Point
 
typedef Mesh::FaceHandle FaceHandle
 
typedef std::vector< Point > Points
 
- 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 (ModHausdorffT, MeshT, Hausdorff)
 
 ModHausdorffT (MeshT &_mesh, Scalar _error_tolerance=FLT_MAX)
 Constructor. More...
 
 ~ModHausdorffT ()
 Destructor. More...
 
Scalar tolerance () const
 get max error tolerance More...
 
void set_tolerance (Scalar _e)
 set max error tolerance More...
 
virtual void initialize () override
 reset per-face point lists More...
 
virtual float collapse_priority (const CollapseInfo &_ci) override
 compute Hausdorff error for one-ring More...
 
virtual void postprocess_collapse (const CollapseInfo &_ci) override
 re-distribute points More...
 
void set_error_tolerance_factor (double _factor) override
 set the percentage of tolerance More...
 
- 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 Member Functions

Scalar distPointTriangleSquared (const Point &_p, const Point &_v0, const Point &_v1, const Point &_v2)
 squared distance from point _p to triangle (_v0, _v1, _v2) More...
 
Scalar compute_sqr_error (FaceHandle _fh, const Point &_p) const
 compute max error for face _fh w.r.t. its point list and _p More...
 

Private Attributes

Points tmp_points_
 Temporary point storage. More...
 
Meshmesh_
 
Scalar tolerance_
 
OpenMesh::FPropHandleT< Points > points_
 

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::ModHausdorffT< MeshT >

Use Hausdorff distance to control decimation.

This module computes the aspect ratio.

In binary mode, the collapse is legal if:

  • The distance after the collapse is lower than the given tolerance

No continuous mode

Definition at line 79 of file ModHausdorffT.hh.

Member Typedef Documentation

◆ FaceHandle

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

Definition at line 86 of file ModHausdorffT.hh.

◆ Point

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

Definition at line 85 of file ModHausdorffT.hh.

◆ Points

template<class MeshT >
typedef std::vector<Point> OpenMesh::Decimater::ModHausdorffT< MeshT >::Points

Definition at line 87 of file ModHausdorffT.hh.

◆ Scalar

template<class MeshT >
typedef Mesh::Scalar OpenMesh::Decimater::ModHausdorffT< MeshT >::Scalar

Definition at line 84 of file ModHausdorffT.hh.

Constructor & Destructor Documentation

◆ ModHausdorffT()

template<class MeshT >
OpenMesh::Decimater::ModHausdorffT< MeshT >::ModHausdorffT ( MeshT _mesh,
Scalar  _error_tolerance = FLT_MAX 
)
inlineexplicit

Constructor.

Definition at line 90 of file ModHausdorffT.hh.

◆ ~ModHausdorffT()

template<class MeshT >
OpenMesh::Decimater::ModHausdorffT< MeshT >::~ModHausdorffT ( )
inline

Destructor.

Definition at line 96 of file ModHausdorffT.hh.

Member Function Documentation

◆ collapse_priority()

template<class MeshT >
float OpenMesh::Decimater::ModHausdorffT< MeshT >::collapse_priority ( const CollapseInfo _ci)
overridevirtual

compute Hausdorff error for one-ring

This mod only allows collapses if the Hausdorff distance after a collapse is lower than the given tolerance.

Parameters
_ciCollapse info data
Returns
Binary return, if collapse is legal or illegal

Definition at line 204 of file ModHausdorffT_impl.hh.

◆ compute_sqr_error()

template<class MeshT >
ModHausdorffT< MeshT >::Scalar OpenMesh::Decimater::ModHausdorffT< MeshT >::compute_sqr_error ( FaceHandle  _fh,
const Point &  _p 
) const
private

compute max error for face _fh w.r.t. its point list and _p

Definition at line 356 of file ModHausdorffT_impl.hh.

◆ distPointTriangleSquared()

template<class MeshT >
ModHausdorffT< MeshT >::Scalar OpenMesh::Decimater::ModHausdorffT< MeshT >::distPointTriangleSquared ( const Point &  _p,
const Point &  _v0,
const Point &  _v1,
const Point &  _v2 
)
private

squared distance from point _p to triangle (_v0, _v1, _v2)

Definition at line 70 of file ModHausdorffT_impl.hh.

◆ initialize()

template<class MeshT >
void OpenMesh::Decimater::ModHausdorffT< MeshT >::initialize ( void  )
overridevirtual

reset per-face point lists

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

Definition at line 189 of file ModHausdorffT_impl.hh.

◆ postprocess_collapse()

template<class MeshT >
void OpenMesh::Decimater::ModHausdorffT< MeshT >::postprocess_collapse ( const CollapseInfo _ci)
overridevirtual

re-distribute points

Definition at line 280 of file ModHausdorffT_impl.hh.

◆ set_error_tolerance_factor()

template<class MeshT >
void OpenMesh::Decimater::ModHausdorffT< MeshT >::set_error_tolerance_factor ( double  _factor)
overridevirtual

set the percentage of tolerance

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

Definition at line 265 of file ModHausdorffT_impl.hh.

◆ set_tolerance()

template<class MeshT >
void OpenMesh::Decimater::ModHausdorffT< MeshT >::set_tolerance ( Scalar  _e)
inline

set max error tolerance

Definition at line 106 of file ModHausdorffT.hh.

◆ tolerance()

template<class MeshT >
Scalar OpenMesh::Decimater::ModHausdorffT< MeshT >::tolerance ( ) const
inline

get max error tolerance

Definition at line 101 of file ModHausdorffT.hh.

Member Data Documentation

◆ mesh_

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

Definition at line 144 of file ModHausdorffT.hh.

◆ points_

template<class MeshT >
OpenMesh::FPropHandleT<Points> OpenMesh::Decimater::ModHausdorffT< MeshT >::points_
private

Definition at line 147 of file ModHausdorffT.hh.

◆ tmp_points_

template<class MeshT >
Points OpenMesh::Decimater::ModHausdorffT< MeshT >::tmp_points_
private

Temporary point storage.

Definition at line 142 of file ModHausdorffT.hh.

◆ tolerance_

template<class MeshT >
Scalar OpenMesh::Decimater::ModHausdorffT< MeshT >::tolerance_
private

Definition at line 145 of file ModHausdorffT.hh.


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