Developer Documentation
MeshFunctions Namespace Reference

Namespace providing different Mesh editing functions. More...

Functions

template<typename MeshT , typename VectorT >
bool get_boundary (MeshT &_mesh, typename MeshT::VertexHandle _vh, std::vector< std::pair< VectorT, typename MeshT::VertexHandle > > &_boundary)
 
template<typename MeshT , typename VectorT >
bool get_boundary (MeshT &_mesh, std::vector< std::pair< VectorT, typename MeshT::VertexHandle > > &_boundary)
 
template<typename MeshT , typename VectorT >
void smooth_boundary (MeshT &_mesh, typename MeshT::VertexHandle _vh)
 
template<typename MeshT >
bool neighbour (const MeshT &_mesh, const typename MeshT::FaceHandle _fh1, const typename MeshT::FaceHandle _fh2)
 
template<class MeshT , typename VectorT >
bool cut_face (const VectorT &_porigin, const VectorT &_pnormal, const MeshT &_mesh, const typename MeshT::FaceHandle &_fh)
 
template<typename MeshT >
double calc_area (const MeshT &_mesh)
 
template<typename MeshT >
double calc_angle_around (const MeshT &_mesh, const typename MeshT::VertexHandle _vh)
 
template<typename MeshT >
void transformMesh (ACG::Matrix4x4d _matrix, MeshT &_mesh)
 
template<typename MeshT >
void transformHandleVertices (ACG::Matrix4x4d _matrix, MeshT &_mesh)
 

Detailed Description

Namespace providing different Mesh editing functions.

Function Documentation

template<typename MeshT >
double MeshFunctions::calc_angle_around ( const MeshT &  _mesh,
const typename MeshT::VertexHandle  _vh 
)

Get the sum of the angles around a vertex

Parameters
_meshMesh to work on
_vhVertex
Returns
Sum of angles around the vertex

Definition at line 216 of file MeshFunctions.cc.

template<typename MeshT >
double MeshFunctions::calc_area ( const MeshT &  _mesh)

Get the area of a mesh ( sum over all triangle areas)

Parameters
_meshMesh to calculate area
Returns
Area spanned by the mesh

Definition at line 198 of file MeshFunctions.cc.

template<class MeshT , typename VectorT >
bool MeshFunctions::cut_face ( const VectorT _porigin,
const VectorT _pnormal,
const MeshT &  _mesh,
const typename MeshT::FaceHandle &  _fh 
)

Checks if plane cuts the face

Parameters
_poriginPlanes origin
_pnormalPlane normal
_meshMesh
_fhFacehandle of face
Returns
triangle cut by plane?

Definition at line 175 of file MeshFunctions.cc.

template<typename MeshT , typename VectorT >
bool MeshFunctions::get_boundary ( MeshT &  _mesh,
typename MeshT::VertexHandle  _vh,
std::vector< std::pair< VectorT, typename MeshT::VertexHandle > > &  _boundary 
)

get one boundary at the vertex

Parameters
_meshMesh
_vhVertex handle of one vertex of the boundary
_boundaryCoords and vertex handles of the boundary

Definition at line 82 of file MeshFunctions.cc.

template<typename MeshT , typename VectorT >
bool MeshFunctions::get_boundary ( MeshT &  _mesh,
std::vector< std::pair< VectorT, typename MeshT::VertexHandle > > &  _boundary 
)

get boundary of a mesh (assumes that there is only one boundary!!

Parameters
_meshMesh
_boundaryCoords and vertex handles of the boundary
Returns
Found a boundary?

Definition at line 121 of file MeshFunctions.cc.

template<typename MeshT >
bool MeshFunctions::neighbour ( const MeshT &  _mesh,
const typename MeshT::FaceHandle  _fh1,
const typename MeshT::FaceHandle  _fh2 
)

Checks for two faces if they are adjazent

Parameters
_meshMesh
_fh1First Face
_fh2Second Face

Definition at line 162 of file MeshFunctions.cc.

template<typename MeshT , typename VectorT >
void MeshFunctions::smooth_boundary ( MeshT &  _mesh,
typename MeshT::VertexHandle  _vh 
)

function to smooth a boundary of a given mesh by moving each vertex to the mean Position of its adjazent verticies

Parameters
_meshMesh to work on
_vhVertex handle on the boundary

Definition at line 145 of file MeshFunctions.cc.

template<typename MeshT >
void MeshFunctions::transformHandleVertices ( ACG::Matrix4x4d  _matrix,
MeshT &  _mesh 
)

Transform handle vertices only

Parameters
_matrixThe transformation matrix
_meshThe mesh that is to be transformed

Definition at line 275 of file MeshFunctions.cc.

template<typename MeshT >
void MeshFunctions::transformMesh ( ACG::Matrix4x4d  _matrix,
MeshT &  _mesh 
)

Transform geometry of the mesh using the specified transformation matrix.

Parameters
_matrixThe transformation matrix
_meshThe mesh that is to be transformed

Definition at line 237 of file MeshFunctions.cc.