Developer Documentation
|
#include <libs_required/OpenMesh/src/OpenMesh/Tools/Smoother/SmootherT.hh>
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. | |
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 | |
Mesh & | mesh_ |
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_ |
Base class for smoothing algorithms.
Definition at line 81 of file SmootherT.hh.
enum OpenMesh::Smoother::SmootherT::Component |
Enumerator | |
---|---|
Tangential |
Smooth tangential direction. |
Normal |
Smooth normal direction. |
Tangential_and_Normal |
Smooth tangential and normal direction. |
Definition at line 92 of file SmootherT.hh.
OpenMesh::Smoother::SmootherT< Mesh >::SmootherT | ( | Mesh & | _mesh | ) |
constructor & destructor
_mesh | Reference a triangle or poly mesh |
Definition at line 78 of file SmootherT.cc.
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 295 of file SmootherT.cc.
void OpenMesh::Smoother::SmootherT< Mesh >::initialize | ( | Component | _comp, |
Continuity | _cont | ||
) |
Initialize smoother
_comp | Determine component to smooth |
_cont | Determine Continuity |
Definition at line 127 of file SmootherT.cc.
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.
_err | Maximal error |
Definition at line 283 of file SmootherT.cc.
|
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 157 of file SmootherT.cc.
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.
_err | Factor scaling the bounding box diagonal |
Definition at line 253 of file SmootherT.cc.
|
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.
_state | true : If features are selected on the mesh, they will be left unmodified false : Features will be ignored |
Definition at line 172 of file SmootherT.hh.