Developer Documentation
OpenMesh::Smoother::SmootherT< Mesh > Class Template Referenceabstract

#include <OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Tools/Smoother/SmootherT.hh>

Inheritance diagram for OpenMesh::Smoother::SmootherT< Mesh >:
OpenMesh::Utils::Noncopyable OpenMesh::Smoother::LaplaceSmootherT< Mesh > OpenMesh::Smoother::JacobiLaplaceSmootherT< Mesh >

Public Types

enum  Component { Tangential , Normal , Tangential_and_Normal }
 
enum  Continuity { C0 , C1 , C2 }
 
typedef Mesh::Scalar Scalar
 
typedef Mesh::Point Point
 
typedef Mesh::Normal NormalType
 
typedef Mesh::VertexHandle VertexHandle
 
typedef Mesh::EdgeHandle EdgeHandle
 

Public Member Functions

 SmootherT (Mesh &_mesh)
 constructor & destructor More...
 
Initialization and algorithm execution
void initialize (Component _comp, Continuity _cont)
 
virtual void smooth (unsigned int _n)
 Do _n smoothing iterations. More...
 
Error control functions
void set_relative_local_error (Scalar _err)
 Set local error relative to bounding box. More...
 
void set_absolute_local_error (Scalar _err)
 Set local error as an absolute value. More...
 
void disable_local_error_check ()
 Disable error control of the smoother. More...
 
void skip_features (bool _state)
 enable or disable feature handling More...
 

Protected Member Functions

virtual void compute_new_positions_C0 ()=0
 
virtual void compute_new_positions_C1 ()=0
 
const Point & orig_position (VertexHandle _vh) const
 
const NormalType & orig_normal (VertexHandle _vh) const
 
const Point & new_position (VertexHandle _vh) const
 
void set_new_position (VertexHandle _vh, const Point &_p)
 
bool is_active (VertexHandle _vh) const
 
Component component () const
 
Continuity continuity () const
 

Protected Attributes

Meshmesh_
 
bool skip_features_
 

Private Member Functions

void set_active_vertices ()
 Find active vertices. Resets tagged status ! More...
 
void compute_new_positions ()
 
void project_to_tangent_plane ()
 
void local_error_check ()
 
void move_points ()
 

Private Attributes

Scalar tolerance_
 
Scalar normal_deviation_
 
Component component_
 
Continuity continuity_
 
OpenMesh::VPropHandleT< Point > original_positions_
 
OpenMesh::VPropHandleT< NormalType > original_normals_
 
OpenMesh::VPropHandleT< Point > new_positions_
 
OpenMesh::VPropHandleT< bool > is_active_
 

Detailed Description

template<class Mesh>
class OpenMesh::Smoother::SmootherT< Mesh >

Base class for smoothing algorithms.

Definition at line 76 of file SmootherT.hh.

Member Typedef Documentation

◆ EdgeHandle

template<class Mesh >
typedef Mesh::EdgeHandle OpenMesh::Smoother::SmootherT< Mesh >::EdgeHandle

Definition at line 84 of file SmootherT.hh.

◆ NormalType

template<class Mesh >
typedef Mesh::Normal OpenMesh::Smoother::SmootherT< Mesh >::NormalType

Definition at line 82 of file SmootherT.hh.

◆ Point

template<class Mesh >
typedef Mesh::Point OpenMesh::Smoother::SmootherT< Mesh >::Point

Definition at line 81 of file SmootherT.hh.

◆ Scalar

template<class Mesh >
typedef Mesh::Scalar OpenMesh::Smoother::SmootherT< Mesh >::Scalar

Definition at line 80 of file SmootherT.hh.

◆ VertexHandle

template<class Mesh >
typedef Mesh::VertexHandle OpenMesh::Smoother::SmootherT< Mesh >::VertexHandle

Definition at line 83 of file SmootherT.hh.

Member Enumeration Documentation

◆ Component

Enumerator
Tangential 

Smooth tangential direction.

Normal 

Smooth normal direction.

Tangential_and_Normal 

Smooth tangential and normal direction.

Definition at line 87 of file SmootherT.hh.

◆ Continuity

template<class Mesh >
enum OpenMesh::Smoother::SmootherT::Continuity

Definition at line 93 of file SmootherT.hh.

Constructor & Destructor Documentation

◆ SmootherT()

template<class Mesh >
OpenMesh::Smoother::SmootherT< Mesh >::SmootherT ( Mesh _mesh)

constructor & destructor

Parameters
_meshReference a triangle or poly mesh

Definition at line 72 of file SmootherT_impl.hh.

◆ ~SmootherT()

template<class Mesh >
OpenMesh::Smoother::SmootherT< Mesh >::~SmootherT
virtual

Definition at line 100 of file SmootherT_impl.hh.

Member Function Documentation

◆ component()

template<class Mesh >
Component OpenMesh::Smoother::SmootherT< Mesh >::component ( ) const
inlineprotected

Definition at line 221 of file SmootherT.hh.

◆ compute_new_positions()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::compute_new_positions
private

Definition at line 328 of file SmootherT_impl.hh.

◆ continuity()

template<class Mesh >
Continuity OpenMesh::Smoother::SmootherT< Mesh >::continuity ( ) const
inlineprotected

Definition at line 222 of file SmootherT.hh.

◆ disable_local_error_check()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::disable_local_error_check

Disable error control of the smoother.

This function disables the error control of the smoother.

Definition at line 289 of file SmootherT_impl.hh.

◆ initialize()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::initialize ( Component  _comp,
Continuity  _cont 
)

Initialize smoother

Parameters
_compDetermine component to smooth
_contDetermine Continuity

Definition at line 121 of file SmootherT_impl.hh.

◆ is_active()

template<class Mesh >
bool OpenMesh::Smoother::SmootherT< Mesh >::is_active ( VertexHandle  _vh) const
inlineprotected

Definition at line 218 of file SmootherT.hh.

◆ local_error_check()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::local_error_check
private

Definition at line 382 of file SmootherT_impl.hh.

◆ move_points()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::move_points
private

Definition at line 416 of file SmootherT_impl.hh.

◆ new_position()

template<class Mesh >
const Point & OpenMesh::Smoother::SmootherT< Mesh >::new_position ( VertexHandle  _vh) const
inlineprotected

Definition at line 212 of file SmootherT.hh.

◆ orig_normal()

template<class Mesh >
const NormalType & OpenMesh::Smoother::SmootherT< Mesh >::orig_normal ( VertexHandle  _vh) const
inlineprotected

Definition at line 209 of file SmootherT.hh.

◆ orig_position()

template<class Mesh >
const Point & OpenMesh::Smoother::SmootherT< Mesh >::orig_position ( VertexHandle  _vh) const
inlineprotected

Definition at line 206 of file SmootherT.hh.

◆ project_to_tangent_plane()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::project_to_tangent_plane
private

Definition at line 352 of file SmootherT_impl.hh.

◆ set_absolute_local_error()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::set_absolute_local_error ( Scalar  _err)

Set local error as an absolute value.

Set the maximal error tolerance of the smoother to the given value.

Parameters
_errMaximal error

Definition at line 277 of file SmootherT_impl.hh.

◆ set_active_vertices()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::set_active_vertices
private

Find active vertices. Resets tagged status !

This function recomputes the set of active vertices, which will be touched by the smoother. If nothing on the mesh is selected, all vertices which are not locked, feature or boundary will be marked as active and moved by the smoother. If vertices are selected, than only the selected ones, excluding the locked, feature and boundary vertices will be moved.

The function is called first when running the smoother.

Definition at line 151 of file SmootherT_impl.hh.

◆ set_new_position()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::set_new_position ( VertexHandle  _vh,
const Point &  _p 
)
inlineprotected

Definition at line 215 of file SmootherT.hh.

◆ set_relative_local_error()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::set_relative_local_error ( Scalar  _err)

Set local error relative to bounding box.

This function sets a maximal error tolerance for the smoother as a fraction of the bounding box of the mesh. First the bounding box diagonal is computed. Then the error is set as the length of the diagonal multiplied with the given factor.

Parameters
_errFactor scaling the bounding box diagonal

Definition at line 247 of file SmootherT_impl.hh.

◆ skip_features()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::skip_features ( bool  _state)
inline

enable or disable feature handling

This function can be used to control if features on the mesh should be preserved. If enabled, the smoother will keep features and does not modify them. Features can be set via OpenMesh status flags (request status and set primitives as features). Feature flag can be set for vertices edges and faces.

Parameters
_statetrue : If features are selected on the mesh, they will be left unmodified
false : Features will be ignored

Definition at line 167 of file SmootherT.hh.

◆ smooth()

template<class Mesh >
void OpenMesh::Smoother::SmootherT< Mesh >::smooth ( unsigned int  _n)
virtual

Do _n smoothing iterations.

Reimplemented in OpenMesh::Smoother::JacobiLaplaceSmootherT< Mesh >.

Definition at line 301 of file SmootherT_impl.hh.

Member Data Documentation

◆ component_

template<class Mesh >
Component OpenMesh::Smoother::SmootherT< Mesh >::component_
private

Definition at line 234 of file SmootherT.hh.

◆ continuity_

template<class Mesh >
Continuity OpenMesh::Smoother::SmootherT< Mesh >::continuity_
private

Definition at line 235 of file SmootherT.hh.

◆ is_active_

template<class Mesh >
OpenMesh::VPropHandleT<bool> OpenMesh::Smoother::SmootherT< Mesh >::is_active_
private

Definition at line 240 of file SmootherT.hh.

◆ mesh_

template<class Mesh >
Mesh& OpenMesh::Smoother::SmootherT< Mesh >::mesh_
protected

Definition at line 226 of file SmootherT.hh.

◆ new_positions_

template<class Mesh >
OpenMesh::VPropHandleT<Point> OpenMesh::Smoother::SmootherT< Mesh >::new_positions_
private

Definition at line 239 of file SmootherT.hh.

◆ normal_deviation_

template<class Mesh >
Scalar OpenMesh::Smoother::SmootherT< Mesh >::normal_deviation_
private

Definition at line 233 of file SmootherT.hh.

◆ original_normals_

template<class Mesh >
OpenMesh::VPropHandleT<NormalType> OpenMesh::Smoother::SmootherT< Mesh >::original_normals_
private

Definition at line 238 of file SmootherT.hh.

◆ original_positions_

template<class Mesh >
OpenMesh::VPropHandleT<Point> OpenMesh::Smoother::SmootherT< Mesh >::original_positions_
private

Definition at line 237 of file SmootherT.hh.

◆ skip_features_

template<class Mesh >
bool OpenMesh::Smoother::SmootherT< Mesh >::skip_features_
protected

Definition at line 227 of file SmootherT.hh.

◆ tolerance_

template<class Mesh >
Scalar OpenMesh::Smoother::SmootherT< Mesh >::tolerance_
private

Definition at line 232 of file SmootherT.hh.


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