Commit 302bfd51 authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'alignMeshesRefactoring' into 'master'

refactorAlignMeshes

DONE: change icons of the new buttons and remove redundant functionality from align meshes plugin
also added an icon for align meshes.

ready to be merged
merry Christmas!

See merge request !49
parents 649bafb7 09614050
Pipeline #676 passed with stage
......@@ -127,66 +127,6 @@ void moveCenterOfBBToOrigin(MeshT& _mesh) {
}
}
template< class MeshT >
void scaleToUnitCubeNonUniform(MeshT& _mesh) {
ACG::Vec3d min(DBL_MAX);
ACG::Vec3d max(-DBL_MAX);
for (typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) {
min.minimize(_mesh.point(*v_it));
max.maximize(_mesh.point(*v_it));
}
const ACG::Vec3d diagonal = max - min;
const double maxDiag = std::max(std::max(diagonal[0],diagonal[1]),diagonal[2]);
OpenMesh::MPropHandleT<ACG::Vec3d> origDiagonal;
if (!_mesh.get_property_handle(origDiagonal, "origDiagonal"))
_mesh.add_property(origDiagonal, "origDiagonal");
_mesh.mproperty(origDiagonal).set_persistent(true);
_mesh.property(origDiagonal) = diagonal;
for (typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) {
_mesh.point(*v_it)[0] /= diagonal[0];
_mesh.point(*v_it)[1] /= diagonal[1];
_mesh.point(*v_it)[2] /= diagonal[2];
}
}
template< class MeshT >
void scaleToUnitCubeUniform(MeshT& _mesh) {
ACG::Vec3d min(DBL_MAX);
ACG::Vec3d max(-DBL_MAX);
for (typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) {
min.minimize(_mesh.point(*v_it));
max.maximize(_mesh.point(*v_it));
}
const ACG::Vec3d diagonal = max - min;
const double maxDiag = std::max(std::max(diagonal[0],diagonal[1]),diagonal[2]);
OpenMesh::MPropHandleT<ACG::Vec3d> origDiagonal;
if (!_mesh.get_property_handle(origDiagonal, "origDiagonal"))
_mesh.add_property(origDiagonal, "origDiagonal");
_mesh.mproperty(origDiagonal).set_persistent(true);
_mesh.property(origDiagonal) = diagonal;
for (typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) {
_mesh.point(*v_it)[0] /= maxDiag;
_mesh.point(*v_it)[1] /= maxDiag;
_mesh.point(*v_it)[2] /= maxDiag;
}
}
} // namespace align
#define ALIGNT_CC
......@@ -22,20 +22,6 @@ void rotate(MeshT& _mesh);
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);
} // namespace align
......
......@@ -53,81 +53,17 @@ toolBox_(0) {
}
PluginAlignMeshes::~PluginAlignMeshes() {
delete toolIcon_;
}
void PluginAlignMeshes::initializePlugin() {
toolBox_ = new AlignMeshesToolbox();
emit addToolbox("Align Meshes", toolBox_);
toolIcon_ = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"alignMeshes.png");
emit addToolbox("Align Meshes", toolBox_, toolIcon_);
connect(toolBox_->alignMeshesButton, SIGNAL(pressed()), SLOT(alignMeshes()));
connect(toolBox_->scaleToUnitCubeUniformButton, SIGNAL(pressed()), SLOT(scaleToUnitCubeUniform()));
connect(toolBox_->scaleToUnitCubeNonUniformButton, SIGNAL(pressed()), SLOT(scaleToUnitCubeNonUniform()));
}
void PluginAlignMeshes::scaleToUnitCubeNonUniform() {
for (PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS, DATA_TRIANGLE_MESH | DATA_POLY_MESH ); o_it
!= PluginFunctions::objectsEnd(); ++o_it) {
if(o_it->dataType() == DATA_TRIANGLE_MESH){
TriMesh& mesh = * PluginFunctions::triMesh(*o_it);
align::moveToCOG( mesh );
align::scaleToUnitCubeNonUniform( mesh );
align::moveToCOG( mesh );
emit log(LOGINFO,"Moved Triangle mesh scaleToUnitCubeNonUniform");
} else if(o_it->dataType() == DATA_POLY_MESH) {
PolyMesh& mesh = * PluginFunctions::polyMesh(*o_it);
align::moveToCOG( mesh );
align::scaleToUnitCubeNonUniform( mesh );
align::moveToCOG( mesh );
emit log(LOGINFO,"Moved poly mesh scaleToUnitCubeNonUniform");
}
emit updatedObject(o_it->id(), UPDATE_GEOMETRY);
}
}
void PluginAlignMeshes::scaleToUnitCubeUniform() {
for (PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS, DATA_TRIANGLE_MESH); o_it
!= PluginFunctions::objectsEnd(); ++o_it) {
if(o_it->dataType() == DATA_TRIANGLE_MESH){
TriMesh& mesh = * PluginFunctions::triMesh(*o_it);
align::moveToCOG( mesh );
align::scaleToUnitCubeUniform( mesh );
align::moveToCOG( mesh );
emit log(LOGINFO,"Moved Triangle mesh scaleToUnitCubeUniform");
} else if(o_it->dataType() == DATA_POLY_MESH) {
PolyMesh& mesh = * PluginFunctions::polyMesh(*o_it);
align::moveToCOG( mesh );
align::scaleToUnitCubeUniform( mesh );
align::moveToCOG( mesh );
emit log(LOGINFO,"Moved poly mesh scaleToUnitCubeUniform");
}
emit updatedObject(o_it->id(), UPDATE_GEOMETRY);
}
}
void PluginAlignMeshes::alignMeshes() {
......
......@@ -80,7 +80,7 @@ signals:
void log(QString _message);
// ToolboxInterface
void addToolbox(QString _name, QWidget* _widget);
void addToolbox(QString _name, QWidget* _widget, QIcon* _icon);
public slots:
......@@ -88,8 +88,6 @@ public slots:
QString version() { return QString("1.0"); }
void alignMeshes();
void scaleToUnitCubeUniform();
void scaleToUnitCubeNonUniform();
private slots:
......@@ -98,6 +96,7 @@ private slots:
private:
AlignMeshesToolbox* toolBox_;
QIcon* toolIcon_;
};
......
......@@ -16,22 +16,6 @@
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QPushButton" name="scaleToUnitCubeUniformButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Scale meshes &lt;span style=&quot; color:#000000;&quot;&gt;such that their biggest boundingbox axis size is 1.0. The aspect ratio of the mesh is kept.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="statusTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Scale meshes &lt;span style=&quot; color:#000000;&quot;&gt;such that their biggest boundingbox axis size is 1.0. The aspect ratio of the mesh is kept.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Scale meshes &lt;span style=&quot; color:#000000;&quot;&gt;such that their biggest boundingbox axis size is 1.0. The aspect ratio of the mesh is kept.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Scale Meshes to Unit Cube Uniformly</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="alignMeshesButton">
<property name="toolTip">
......@@ -48,22 +32,6 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="scaleToUnitCubeNonUniformButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Scale meshes such that their boundingbox axis sizes are all 1.0. The aspect ratio of the mesh is &lt;span style=&quot; font-weight:600;&quot;&gt;not&lt;/span&gt; kept.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="statusTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Scale meshes such that their boundingbox axis sizes are all 1.0. The aspect ratio of the mesh is &lt;span style=&quot; font-weight:600;&quot;&gt;not&lt;/span&gt; kept.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Scale meshes such that their boundingbox axis sizes are all 1.0. The aspect ratio of the mesh is &lt;span style=&quot; font-weight:600;&quot;&gt;not&lt;/span&gt; kept.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Scale Meshes to Unit Cube Non-Uniformly</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
......
......@@ -347,6 +347,14 @@ void MovePlugin::initializePlugin()
tool_->unifyBoundingBoxDiagonal->setWhatsThis(QString(tr("Rescale objects such that its bounding box diagonal has length one."))
+whatsThis.generateLink("unifyBB"));
connect(tool_->unifyBoundingBoxLongest,SIGNAL(clicked() ),this,SLOT(slotUnifyBoundingBoxLongestAxis()));
tool_->unifyBoundingBoxLongest->setIcon( QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "unifyBB_longest.png") );
tool_->unifyBoundingBoxLongest->setIconSize(QSize(48,48));
connect(tool_->unifyBoundingBoxAll,SIGNAL(clicked() ),this,SLOT(slotUnifyBoundingBoxAllAxis()));
tool_->unifyBoundingBoxAll->setIcon( QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "unifyBB_all.png") );
tool_->unifyBoundingBoxAll->setIconSize(QSize(48,48));
lastActiveManipulator_ = -1;
toolIcon_ = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"move-toolBox.png");
......@@ -1845,6 +1853,21 @@ void MovePlugin::slotMoveToOrigin() {
*
*/
void MovePlugin::slotUnifyBoundingBoxDiagonal()
{
unifyBoundingBox(MovePlugin::DIAGONAL);
}
void MovePlugin::slotUnifyBoundingBoxLongestAxis()
{
unifyBoundingBox((MovePlugin::LONGEST_AXIS));
}
void MovePlugin::slotUnifyBoundingBoxAllAxis()
{
unifyBoundingBox(MovePlugin::ALL_AXIS);
}
void MovePlugin::unifyBoundingBox(Unificationtype u)
{
bool useCommonBB = false;
ACG::Vec3d bb_min = ACG::Vec3d(FLT_MAX,FLT_MAX,FLT_MAX);
......@@ -1912,37 +1935,37 @@ void MovePlugin::slotUnifyBoundingBoxDiagonal()
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it) {
if ( useCommonBB ) {
if ( o_it->dataType( DATA_TRIANGLE_MESH ) )
unifyBBDiag(*PluginFunctions::triMesh(*o_it),bb_min,bb_max);
unifyBB(*PluginFunctions::triMesh(*o_it),bb_min,bb_max, u);
else if ( o_it->dataType( DATA_POLY_MESH ) )
unifyBBDiag(*PluginFunctions::polyMesh(*o_it),bb_min,bb_max);
unifyBB(*PluginFunctions::polyMesh(*o_it),bb_min,bb_max, u);
#ifdef ENABLE_TSPLINEMESH_SUPPORT
else if ( o_it->dataType( DATA_TSPLINE_MESH ) )
unifyBBDiag(*PluginFunctions::tsplineMesh(*o_it),bb_min,bb_max);
unifyBB(*PluginFunctions::tsplineMesh(*o_it),bb_min,bb_max, u);
#endif
#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT
else if ( o_it->dataType( DATA_HEXAHEDRAL_MESH ) )
unifyBBDiagVolumeMesh(*PluginFunctions::hexahedralMesh(*o_it),(PluginFunctions::hexahedralMeshObject(*o_it)->normals()),bb_min,bb_max);
unifyBBVolumeMesh(*PluginFunctions::hexahedralMesh(*o_it),(PluginFunctions::hexahedralMeshObject(*o_it)->normals()),bb_min,bb_max, u);
#endif
#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT
else if ( o_it->dataType( DATA_POLYHEDRAL_MESH ) )
unifyBBDiagVolumeMesh(*PluginFunctions::polyhedralMesh(*o_it),(PluginFunctions::polyhedralMeshObject(*o_it)->normals()),bb_min,bb_max);
unifyBBVolumeMesh(*PluginFunctions::polyhedralMesh(*o_it),(PluginFunctions::polyhedralMeshObject(*o_it)->normals()),bb_min,bb_max, u);
#endif
} else {
if ( o_it->dataType( DATA_TRIANGLE_MESH ) )
unifyBBDiag(*PluginFunctions::triMesh(*o_it));
unifyBB(*PluginFunctions::triMesh(*o_it), u);
else if ( o_it->dataType( DATA_POLY_MESH ) )
unifyBBDiag(*PluginFunctions::polyMesh(*o_it));
unifyBB(*PluginFunctions::polyMesh(*o_it), u);
#ifdef ENABLE_TSPLINEMESH_SUPPORT
else if ( o_it->dataType( DATA_TSPLINE_MESH ) )
unifyBBDiag(*PluginFunctions::tsplineMesh(*o_it));
unifyBB(*PluginFunctions::tsplineMesh(*o_it), u);
#endif
#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT
else if ( o_it->dataType( DATA_HEXAHEDRAL_MESH ) )
unifyBBDiagVolumeMesh(*PluginFunctions::hexahedralMesh(*o_it),(PluginFunctions::hexahedralMeshObject(*o_it)->normals()));
unifyBBVolumeMesh(*PluginFunctions::hexahedralMesh(*o_it),(PluginFunctions::hexahedralMeshObject(*o_it)->normals()), u);
#endif
#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT
else if ( o_it->dataType( DATA_POLYHEDRAL_MESH ) )
unifyBBDiagVolumeMesh(*PluginFunctions::polyhedralMesh(*o_it),(PluginFunctions::polyhedralMeshObject(*o_it)->normals()));
unifyBBVolumeMesh(*PluginFunctions::polyhedralMesh(*o_it),(PluginFunctions::polyhedralMeshObject(*o_it)->normals()), u);
#endif
}
......@@ -2288,7 +2311,7 @@ void MovePlugin::getBBVolumeMesh( VolumeMeshT& _mesh, ACG::Vec3d& _bb_min, ACG::
* @param _normalAttrib the normal attribute
*/
template< typename VolumeMeshT >
void MovePlugin::unifyBBDiagVolumeMesh(VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib)
void MovePlugin::unifyBBVolumeMesh(VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib, Unificationtype u)
{
// no vertices?
if( _mesh.n_vertices() == 0) return;
......@@ -2296,24 +2319,42 @@ void MovePlugin::unifyBBDiagVolumeMesh(VolumeMeshT& _mesh, OpenVolumeMesh::Norma
ACG::Vec3d bb_min, bb_max;
getBBVolumeMesh( _mesh, bb_min, bb_max );
unifyBBDiagVolumeMesh( _mesh, _normalAttrib, bb_min, bb_max );
unifyBBVolumeMesh( _mesh, _normalAttrib, bb_min, bb_max, u );
}
//------------------------------------------------------------------------------
/** \brief Scales object such that bounding box diagonal has unit length
/** \brief Scales object such that bounding box to have unit length as specified by parameter u
*
* @param _mesh the mesh
* @param _normalAttrib the normal attribute
* @param _bb_min Lower left corner of bounding box
* @param _bb_max Upper right corner of bounding box
* @param u the unification type (Diagonal, longest axis, all axis)
*/
template< typename VolumeMeshT >
void MovePlugin::unifyBBDiagVolumeMesh( VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max )
void MovePlugin::unifyBBVolumeMesh( VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max, Unificationtype u)
{
ACG::Vec3d bb_center = 0.5 * (_bb_min + _bb_max) ;
ACG::Vec3d bb_diagonal = _bb_max-_bb_min;
double bb_longestAxis = bb_diagonal.max();
ACG::Vec3d scale;
switch(u)
{
case MovePlugin::DIAGONAL :
scale = ACG::Vec3d(1.0/(_bb_max-_bb_min).norm());
break;
case MovePlugin::LONGEST_AXIS :
scale = ACG::Vec3d(1.0/(bb_longestAxis));
break;
case MovePlugin::ALL_AXIS :
scale = ACG::Vec3d(ACG::Vec3d(1.0)/bb_diagonal);
break;
default:
scale = ACG::Vec3d(1.0/(_bb_max-_bb_min).norm());
}
double scale = 1.0/(_bb_max-_bb_min).norm();
for( OpenVolumeMesh::VertexIter v_it = _mesh.vertices_begin(); v_it!=_mesh.vertices_end(); ++v_it)
_mesh.set_vertex(*v_it, (_mesh.vertex(*v_it) - bb_center) * scale + bb_center);
......@@ -2325,12 +2366,13 @@ void MovePlugin::unifyBBDiagVolumeMesh( VolumeMeshT& _mesh, OpenVolumeMesh::Norm
//------------------------------------------------------------------------------
/** \brief scale mesh to have a boundingboxdiagonal of one
/** \brief scale mesh to have a boundingbox axis('s) or diagonal of one
*
* @param _mesh the mesh
* @param u the unification type (Diagonal, longest axis, all axis)
*/
template< typename MeshT >
void MovePlugin::unifyBBDiag(MeshT& _mesh )
void MovePlugin::unifyBB(MeshT& _mesh , Unificationtype u)
{
typename MeshT::VertexIter v_it = _mesh.vertices_begin();
typename MeshT::VertexIter v_end = _mesh.vertices_end();
......@@ -2348,8 +2390,24 @@ void MovePlugin::unifyBBDiag(MeshT& _mesh )
}
typename MeshT::Point bb_center = 0.5 * (bb_min + bb_max) ;
ACG::Vec3d bb_diagonal = bb_max-bb_min;
typename MeshT::Scalar bb_longestAxis = bb_diagonal.max();
typename MeshT::Scalar scale = 1.0/(bb_max-bb_min).norm();
ACG::Vec3d scale;
switch(u)
{
case MovePlugin::DIAGONAL :
scale = ACG::Vec3d(1.0/(bb_max-bb_min).norm());
break;
case MovePlugin::LONGEST_AXIS :
scale = ACG::Vec3d(1.0 / bb_longestAxis);
break;
case MovePlugin::ALL_AXIS :
scale = ACG::Vec3d(ACG::Vec3d(1.0)/bb_diagonal);
break;
default:
scale = ACG::Vec3d(1.0/(bb_max-bb_min).norm());
}
for( v_it = _mesh.vertices_begin(); v_it!=v_end; ++v_it)
{
......@@ -2388,19 +2446,35 @@ void MovePlugin::getBB( MeshT& _mesh, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max
}
/** \brief Scales object such that bounding box diagonal has unit length
/** \brief Scales object such that bounding box axis('s) or diagonal have unit length
*
* @param _mesh the mesh
* @param _bb_min Lower left corner of bounding box
* @param _bb_max Upper right corner of bounding box
* @param u the unification type (Diagonal, longest axis, all axis)
*/
template< typename MeshT >
void MovePlugin::unifyBBDiag( MeshT& _mesh, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max )
void MovePlugin::unifyBB(MeshT& _mesh, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max , Unificationtype u)
{
typename MeshT::Point bb_center = 0.5 * (_bb_min + _bb_max) ;
typename MeshT::Scalar scale = 1.0/(_bb_max-_bb_min).norm();
ACG::Vec3d bb_diagonal = _bb_max-_bb_min;
typename MeshT::Scalar bb_longestAxis = bb_diagonal.max();
ACG::Vec3d scale;
switch(u)
{
case MovePlugin::DIAGONAL :
scale = ACG::Vec3d(1.0/(_bb_max-_bb_min).norm());
break;
case MovePlugin::LONGEST_AXIS :
scale = ACG::Vec3d(1.0 / bb_longestAxis);
break;
case MovePlugin::ALL_AXIS :
scale = ACG::Vec3d(ACG::Vec3d(1.0)/bb_diagonal);
break;
default:
scale = ACG::Vec3d(1.0/(_bb_max-_bb_min).norm());
}
typename MeshT::VertexIter v_it;
......
......@@ -202,6 +202,13 @@ public:
int axisA_;
int axisB_;
enum Unificationtype
{
DIAGONAL,
LONGEST_AXIS,
ALL_AXIS
};
private slots:
/// Position of manipulator in tab changed
......@@ -237,6 +244,12 @@ public:
/// Scale Boundingbox Diagonal to unit size
void slotUnifyBoundingBoxDiagonal();
/// Scale Boundingbox longest axis to unit size (keeps aspect ratio)
void slotUnifyBoundingBoxLongestAxis();
/// Scale all Boundingbox axis to unit size
void slotUnifyBoundingBoxAllAxis();
void slotEnableSelectionMode();
void slotEnableObjectMode();
......@@ -338,6 +351,8 @@ public:
private:
void unifyBoundingBox(Unificationtype u);
///Transform a mesh with the given transformation matrix
template< typename MeshT >
void transformMesh(ACG::Matrix4x4d _mat , MeshT& _mesh );
......@@ -368,11 +383,11 @@ public:
/// scale volume mesh to have a boundingboxdiagonal of one
template< typename VolumeMeshT >
void unifyBBDiagVolumeMesh(VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib);
void unifyBBVolumeMesh(VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib, Unificationtype u = MovePlugin::DIAGONAL);
/// Scales volume mesh such that bounding box diagonal has unit length
template< typename VolumeMeshT >
void unifyBBDiagVolumeMesh( VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max );
void unifyBBVolumeMesh( VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib<VolumeMeshT>& _normalAttrib, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max, Unificationtype u = MovePlugin::DIAGONAL );
#endif
/** Get the Matrix of the last active Manipulator ( Identity if not found or hidden Manipulator )
......@@ -390,7 +405,7 @@ public:
/// scale mesh to have a boundingboxdiagonal of one
template< typename MeshT >
void unifyBBDiag(MeshT& _mesh );
void unifyBB(MeshT& _mesh , Unificationtype u = MovePlugin::DIAGONAL);
/// get bounding box diagonal of a mesh
template< typename MeshT >
......@@ -398,7 +413,7 @@ public:
/// Scales object such that bounding box diagonal has unit length
template< typename MeshT >
void unifyBBDiag( MeshT& _mesh, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max );
void unifyBB( MeshT& _mesh, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max, Unificationtype u = MovePlugin::DIAGONAL );
/// Size for the manipulators
double manip_size_;
......
......@@ -38,7 +38,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
......@@ -89,6 +89,32 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="unifyBoundingBoxLongest">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Normalize Bounding box longest axis of objects&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Normalize Bounding box longest axis of objects&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Unify Boundingbox Longest Axis</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="unifyBoundingBoxAll">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Normalize Bounding box all axis of objects&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Normalize Bounding box all axis of objects&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Unify Boundingbox All Axis</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
......
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