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

Additional modules

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12855 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 01b415f9
......@@ -234,6 +234,16 @@ void DecimaterPlugin::updateNumTriangles(int _value) {
//-----------------------------------------------------------------------------
/** \brief initialization slot called from the toolbox
*
*/
void DecimaterPlugin::slot_init() {
}
//-----------------------------------------------------------------------------
/** \brief decimation called from the toolbox
*
*/
......@@ -253,25 +263,33 @@ void DecimaterPlugin::slot_decimate() {
DecimaterType decimater_object(*mesh);
// constraint handles for decimation
ModQuadricH hModQuatric;
ModNormalFlippingH hModNormalFlipping;
ModHausdorffH hModHausdorff;
ModAspectRatioH hModAspectRatio;
ModEdgeLengthH hModEdgeLength;
ModHausdorffH hModHausdorff;
ModIndependentH hModIndependent;
ModNormalDeviationH hModNormalDeviation;
ModAspectRatioH hModAspectRatio;
ModEdgeLengthH hModEdgeLength;
ModNormalFlippingH hModNormalFlipping;
ModQuadricH hModQuadric;
ModRoundnessH hModRoundness;
// remove old constraints first
decimater_object.remove(hModQuatric);
decimater_object.remove(hModAspectRatio);
decimater_object.remove(hModEdgeLength);
decimater_object.remove(hModHausdorff);
decimater_object.remove(hModIndependent);
decimater_object.remove(hModNormalDeviation);
decimater_object.remove(hModNormalFlipping);
decimater_object.remove(hModAspectRatio);
decimater_object.remove(hModEdgeLength);
decimater_object.remove(hModQuadric);
decimater_object.remove(hModRoundness);
// TODO: Use all modules correctly from here!
// priority module: quadrics, normal dev or edge length
if (tool_->rbByDistance->isChecked()) {
decimater_object.add(hModQuatric);
decimater_object.module(hModQuatric).set_binary(false);
decimater_object.add(hModQuadric);
decimater_object.module(hModQuadric).set_binary(false);
} else if (tool_->rbByNormalDeviation->isChecked()) {
decimater_object.add(hModNormalDeviation);
decimater_object.module(hModNormalDeviation).set_binary(false);
......@@ -312,7 +330,7 @@ void DecimaterPlugin::slot_decimate() {
// roundness
if (tool_->aspectRatio->value() >= 0.0 && hModAspectRatio.is_valid())
decimater_object.module(hModAspectRatio).set_roundness(tool_->aspectRatio->value());
decimater_object.module(hModAspectRatio).set_aspect_ratio(tool_->aspectRatio->value());
// edge length
if (tool_->edgeLength->value() >= 0.0 && hModEdgeLength.is_valid())
......
......@@ -61,6 +61,8 @@
#include <OpenMesh/Tools/Decimater/ModNormalDeviationT.hh>
#include <OpenMesh/Tools/Decimater/ModEdgeLengthT.hh>
#include <OpenMesh/Tools/Decimater/ModAspectRatioT.hh>
#include <OpenMesh/Tools/Decimater/ModRoundnessT.hh>
#include <OpenMesh/Tools/Decimater/ModIndependentSetsT.hh>
//== CLASS DEFINITION =========================================================
......@@ -104,12 +106,14 @@ private:
typedef OpenMesh::Decimater::DecimaterT< TriMesh > DecimaterType;
typedef OpenMesh::Decimater::ModQuadricT< DecimaterType >::Handle ModQuadricH;
typedef OpenMesh::Decimater::ModNormalFlippingT< DecimaterType >::Handle ModNormalFlippingH;
typedef OpenMesh::Decimater::ModHausdorffT< DecimaterType >::Handle ModHausdorffH;
typedef OpenMesh::Decimater::ModAspectRatioT< DecimaterType >::Handle ModAspectRatioH;
typedef OpenMesh::Decimater::ModEdgeLengthT< DecimaterType >::Handle ModEdgeLengthH;
typedef OpenMesh::Decimater::ModHausdorffT< DecimaterType >::Handle ModHausdorffH;
typedef OpenMesh::Decimater::ModIndependentSetsT< DecimaterType >::Handle ModIndependentH;
typedef OpenMesh::Decimater::ModNormalDeviationT< DecimaterType >::Handle ModNormalDeviationH;
typedef OpenMesh::Decimater::ModAspectRatioT< DecimaterType >::Handle ModAspectRatioH;
typedef OpenMesh::Decimater::ModEdgeLengthT< DecimaterType >::Handle ModEdgeLengthH;
typedef OpenMesh::Decimater::ModNormalFlippingT< DecimaterType >::Handle ModNormalFlippingH;
typedef OpenMesh::Decimater::ModQuadricT< DecimaterType >::Handle ModQuadricH;
typedef OpenMesh::Decimater::ModRoundnessT< DecimaterType >::Handle ModRoundnessH;
private slots:
......@@ -118,6 +122,9 @@ private slots:
void slotObjectUpdated(int _identifier , const UpdateType _type);
void slotObjectSelectionChanged(int _identifier);
/// initialization called from button in toolbox
void slot_init();
/// decimating called from button in toolbox
void slot_decimate();
......
......@@ -74,6 +74,15 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Maximum Hausdorff distance after a collapse to the original mesh.</string>
</property>
<property name="statusTip">
<string>Maximum Hausdorff distance after a collapse to the original mesh.</string>
</property>
<property name="whatsThis">
<string>Maximum Hausdorff distance after a collapse to the original mesh.</string>
</property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
......@@ -160,6 +169,16 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Collapse smallest edge first, but don't collapse edges longer than given value</string>
</property>
<property name="statusTip">
<string>Collapse smallest edge first, but don't collapse edges longer than given value</string>
</property>
<property name="whatsThis">
<string>Collapse smallest edge first, but
don't collapse edges longer than given value</string>
</property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
......@@ -202,6 +221,15 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Stop when the given number of triangles is reached</string>
</property>
<property name="statusTip">
<string>Stop when the given number of triangles is reached</string>
</property>
<property name="whatsThis">
<string>Stop when the given number of triangles is reached</string>
</property>
<property name="minimum">
<number>1</number>
</property>
......
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