Commit c9b4db16 authored by Jan Möbius's avatar Jan Möbius

Documentation and renamed mean to cog

parent f6a9889b
Pipeline #288 passed with stage
......@@ -46,7 +46,7 @@ namespace align{
template< class MeshT >
void moveToMean(MeshT& _mesh) {
void moveToCOG(MeshT& _mesh) {
ACG::Vec3d mean(0.0);
for (typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) {
......
namespace align{
/** \brief Move Mesh into center of gravity
*
* @param _mesh Mesh to modify
*/
template< class MeshT >
void moveToMean(MeshT& _mesh);
void moveToCOG(MeshT& _mesh);
/** \brief Rotate a mesh such that its largest PCA axis is aligned to x and second largest aligned to y
*
* @param _mesh Mesh to modify
*/
template< class MeshT >
void rotate(MeshT& _mesh);
/** \brief Move mesh such that its bounding box center is in the origin
*
* @param _mesh Mesh to modify
*/
template< class MeshT >
void moveCenterOfBBToOrigin(MeshT& _mesh);
/** \brief Scale mesh such that it has length 1 on each separate axis
*
* @param _mesh Mesh to modify
*/
template< class MeshT >
void scaleToUnitCubeNonUniform(MeshT& _mesh);
/** \brief Scale mesh such that it has length 1 on the largest axis (keeps ratios of axis)
*
* @param _mesh Mesh to modify
*/
template< class MeshT >
void scaleToUnitCubeUniform(MeshT& _mesh);
......
......@@ -81,17 +81,17 @@ void PluginAlignMeshes::scaleToUnitCubeNonUniform() {
TriMesh& mesh = * PluginFunctions::triMesh(*o_it);
align::moveToMean( mesh );
align::moveToCOG( mesh );
align::scaleToUnitCubeNonUniform( mesh );
align::moveToMean( mesh );
align::moveToCOG( mesh );
} else if(o_it->dataType() == DATA_POLY_MESH) {
PolyMesh& mesh = * PluginFunctions::polyMesh(*o_it);
align::moveToMean( mesh );
align::moveToCOG( mesh );
align::scaleToUnitCubeNonUniform( mesh );
align::moveToMean( mesh );
align::moveToCOG( mesh );
}
......@@ -110,17 +110,17 @@ void PluginAlignMeshes::scaleToUnitCubeUniform() {
TriMesh& mesh = * PluginFunctions::triMesh(*o_it);
align::moveToMean( mesh );
align::moveToCOG( mesh );
align::scaleToUnitCubeUniform( mesh );
align::moveToMean( mesh );
align::moveToCOG( mesh );
} else if(o_it->dataType() == DATA_POLY_MESH) {
PolyMesh& mesh = * PluginFunctions::polyMesh(*o_it);
align::moveToMean( mesh );
align::moveToCOG( mesh );
align::scaleToUnitCubeUniform( mesh );
align::moveToMean( mesh );
align::moveToCOG( mesh );
}
......@@ -139,14 +139,14 @@ void PluginAlignMeshes::alignMeshes() {
TriMesh& mesh = * PluginFunctions::triMesh(*o_it);
align::moveToMean( mesh );
align::moveToCOG( mesh );
align::rotate( mesh );
} else if(o_it->dataType() == DATA_POLY_MESH) {
PolyMesh& mesh = * PluginFunctions::polyMesh(*o_it);
align::moveToMean( mesh );
align::moveToCOG( mesh );
align::rotate( mesh );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment