Developer Documentation
Loading...
Searching...
No Matches
OpenMesh::Decimater::ModAspectRatioT< MeshT > Class Template Reference

Use aspect ratio to control decimation. More...

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

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

Public Types

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

Public Member Functions

 ModAspectRatioT (MeshT &_mesh, float _min_aspect=5.0, bool _is_binary=true)
 constructor
 
 ~ModAspectRatioT ()
 destructor
 
float aspect_ratio () const
 get aspect ratio
 
void set_aspect_ratio (float _f)
 set aspect ratio
 
void initialize () override
 precompute face aspect ratio
 
float collapse_priority (const CollapseInfo &_ci) override
 Returns the collapse priority.
 
void preprocess_collapse (const CollapseInfo &_ci) override
 update aspect ratio of one-ring
 
void set_error_tolerance_factor (double _factor) override
 set percentage of aspect ratio
 
- Public Member Functions inherited from OpenMesh::Decimater::ModBaseT< MeshT >
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 float collapse_priority (const CollapseInfoT< MeshT > &)
 
virtual void preprocess_collapse (const CollapseInfoT< MeshT > &)
 
virtual void postprocess_collapse (const CollapseInfoT< MeshT > &)
 

Private Member Functions

Scalar aspectRatio (const Point &_v0, const Point &_v1, const Point &_v2)
 return aspect ratio (length/height) of triangle
 

Private Attributes

Meshmesh_
 
float min_aspect_
 
FPropHandleT< float > aspect_
 

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.
 
- Protected Attributes inherited from OpenMesh::Decimater::ModBaseT< MeshT >
double error_tolerance_factor_
 

Detailed Description

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

Use aspect ratio to control decimation.

This module computes the aspect ratio.

In binary mode, the collapse is legal if:

  • The aspect ratio after the collapse is greater
  • The aspect ratio after the collapse is greater than the given minimum

In continuous mode the collapse is illegal if:

  • The aspect ratio after the collapse is smaller than the given minimum

Definition at line 81 of file ModAspectRatioT.hh.

Member Typedef Documentation

◆ Point

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

Definition at line 88 of file ModAspectRatioT.hh.

◆ Scalar

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

Definition at line 87 of file ModAspectRatioT.hh.

Constructor & Destructor Documentation

◆ ModAspectRatioT()

template<class MeshT >
OpenMesh::Decimater::ModAspectRatioT< MeshT >::ModAspectRatioT ( MeshT _mesh,
float  _min_aspect = 5.0,
bool  _is_binary = true 
)
inlineexplicit

constructor

Definition at line 91 of file ModAspectRatioT.hh.

◆ ~ModAspectRatioT()

destructor

Definition at line 99 of file ModAspectRatioT.hh.

Member Function Documentation

◆ aspect_ratio()

template<class MeshT >
float OpenMesh::Decimater::ModAspectRatioT< MeshT >::aspect_ratio ( ) const
inline

get aspect ratio

Definition at line 104 of file ModAspectRatioT.hh.

◆ aspectRatio()

template<class MeshT >
ModAspectRatioT< MeshT >::Scalar OpenMesh::Decimater::ModAspectRatioT< MeshT >::aspectRatio ( const Point &  _v0,
const Point &  _v1,
const Point &  _v2 
)
private

return aspect ratio (length/height) of triangle

Definition at line 65 of file ModAspectRatioT_impl.hh.

◆ collapse_priority()

template<class MeshT >
float OpenMesh::Decimater::ModAspectRatioT< MeshT >::collapse_priority ( const CollapseInfo _ci)
override

Returns the collapse priority.

Definition at line 133 of file ModAspectRatioT_impl.hh.

◆ initialize()

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

precompute face aspect ratio

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

Definition at line 96 of file ModAspectRatioT_impl.hh.

◆ preprocess_collapse()

template<class MeshT >
void OpenMesh::Decimater::ModAspectRatioT< MeshT >::preprocess_collapse ( const CollapseInfo _ci)
override

update aspect ratio of one-ring

Definition at line 113 of file ModAspectRatioT_impl.hh.

◆ set_aspect_ratio()

template<class MeshT >
void OpenMesh::Decimater::ModAspectRatioT< MeshT >::set_aspect_ratio ( float  _f)
inline

set aspect ratio

Definition at line 109 of file ModAspectRatioT.hh.

◆ set_error_tolerance_factor()

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

set percentage of aspect ratio

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

Definition at line 183 of file ModAspectRatioT_impl.hh.

Member Data Documentation

◆ aspect_

template<class MeshT >
FPropHandleT<float> OpenMesh::Decimater::ModAspectRatioT< MeshT >::aspect_
private

Definition at line 136 of file ModAspectRatioT.hh.

◆ mesh_

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

Definition at line 134 of file ModAspectRatioT.hh.

◆ min_aspect_

template<class MeshT >
float OpenMesh::Decimater::ModAspectRatioT< MeshT >::min_aspect_
private

Definition at line 135 of file ModAspectRatioT.hh.


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