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) { ...@@ -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 /** \brief decimation called from the toolbox
* *
*/ */
...@@ -253,25 +263,33 @@ void DecimaterPlugin::slot_decimate() { ...@@ -253,25 +263,33 @@ void DecimaterPlugin::slot_decimate() {
DecimaterType decimater_object(*mesh); DecimaterType decimater_object(*mesh);
// constraint handles for decimation // constraint handles for decimation
ModQuadricH hModQuatric; ModAspectRatioH hModAspectRatio;
ModNormalFlippingH hModNormalFlipping; ModEdgeLengthH hModEdgeLength;
ModHausdorffH hModHausdorff; ModHausdorffH hModHausdorff;
ModIndependentH hModIndependent;
ModNormalDeviationH hModNormalDeviation; ModNormalDeviationH hModNormalDeviation;
ModAspectRatioH hModAspectRatio; ModNormalFlippingH hModNormalFlipping;
ModEdgeLengthH hModEdgeLength; ModQuadricH hModQuadric;
ModRoundnessH hModRoundness;
// remove old constraints first // remove old constraints first
decimater_object.remove(hModQuatric); decimater_object.remove(hModAspectRatio);
decimater_object.remove(hModEdgeLength);
decimater_object.remove(hModHausdorff); decimater_object.remove(hModHausdorff);
decimater_object.remove(hModIndependent);
decimater_object.remove(hModNormalDeviation); decimater_object.remove(hModNormalDeviation);
decimater_object.remove(hModNormalFlipping); decimater_object.remove(hModNormalFlipping);
decimater_object.remove(hModAspectRatio); decimater_object.remove(hModQuadric);
decimater_object.remove(hModEdgeLength); decimater_object.remove(hModRoundness);
// TODO: Use all modules correctly from here!
// priority module: quadrics, normal dev or edge length // priority module: quadrics, normal dev or edge length
if (tool_->rbByDistance->isChecked()) { if (tool_->rbByDistance->isChecked()) {
decimater_object.add(hModQuatric); decimater_object.add(hModQuadric);
decimater_object.module(hModQuatric).set_binary(false); decimater_object.module(hModQuadric).set_binary(false);
} else if (tool_->rbByNormalDeviation->isChecked()) { } else if (tool_->rbByNormalDeviation->isChecked()) {
decimater_object.add(hModNormalDeviation); decimater_object.add(hModNormalDeviation);
decimater_object.module(hModNormalDeviation).set_binary(false); decimater_object.module(hModNormalDeviation).set_binary(false);
...@@ -312,7 +330,7 @@ void DecimaterPlugin::slot_decimate() { ...@@ -312,7 +330,7 @@ void DecimaterPlugin::slot_decimate() {
// roundness // roundness
if (tool_->aspectRatio->value() >= 0.0 && hModAspectRatio.is_valid()) 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 // edge length
if (tool_->edgeLength->value() >= 0.0 && hModEdgeLength.is_valid()) if (tool_->edgeLength->value() >= 0.0 && hModEdgeLength.is_valid())
......
...@@ -61,6 +61,8 @@ ...@@ -61,6 +61,8 @@
#include <OpenMesh/Tools/Decimater/ModNormalDeviationT.hh> #include <OpenMesh/Tools/Decimater/ModNormalDeviationT.hh>
#include <OpenMesh/Tools/Decimater/ModEdgeLengthT.hh> #include <OpenMesh/Tools/Decimater/ModEdgeLengthT.hh>
#include <OpenMesh/Tools/Decimater/ModAspectRatioT.hh> #include <OpenMesh/Tools/Decimater/ModAspectRatioT.hh>
#include <OpenMesh/Tools/Decimater/ModRoundnessT.hh>
#include <OpenMesh/Tools/Decimater/ModIndependentSetsT.hh>
//== CLASS DEFINITION ========================================================= //== CLASS DEFINITION =========================================================
...@@ -104,12 +106,14 @@ private: ...@@ -104,12 +106,14 @@ private:
typedef OpenMesh::Decimater::DecimaterT< TriMesh > DecimaterType; typedef OpenMesh::Decimater::DecimaterT< TriMesh > DecimaterType;
typedef OpenMesh::Decimater::ModQuadricT< DecimaterType >::Handle ModQuadricH; typedef OpenMesh::Decimater::ModAspectRatioT< DecimaterType >::Handle ModAspectRatioH;
typedef OpenMesh::Decimater::ModNormalFlippingT< DecimaterType >::Handle ModNormalFlippingH; typedef OpenMesh::Decimater::ModEdgeLengthT< DecimaterType >::Handle ModEdgeLengthH;
typedef OpenMesh::Decimater::ModHausdorffT< DecimaterType >::Handle ModHausdorffH; typedef OpenMesh::Decimater::ModHausdorffT< DecimaterType >::Handle ModHausdorffH;
typedef OpenMesh::Decimater::ModIndependentSetsT< DecimaterType >::Handle ModIndependentH;
typedef OpenMesh::Decimater::ModNormalDeviationT< DecimaterType >::Handle ModNormalDeviationH; typedef OpenMesh::Decimater::ModNormalDeviationT< DecimaterType >::Handle ModNormalDeviationH;
typedef OpenMesh::Decimater::ModAspectRatioT< DecimaterType >::Handle ModAspectRatioH; typedef OpenMesh::Decimater::ModNormalFlippingT< DecimaterType >::Handle ModNormalFlippingH;
typedef OpenMesh::Decimater::ModEdgeLengthT< DecimaterType >::Handle ModEdgeLengthH; typedef OpenMesh::Decimater::ModQuadricT< DecimaterType >::Handle ModQuadricH;
typedef OpenMesh::Decimater::ModRoundnessT< DecimaterType >::Handle ModRoundnessH;
private slots: private slots:
...@@ -118,6 +122,9 @@ private slots: ...@@ -118,6 +122,9 @@ private slots:
void slotObjectUpdated(int _identifier , const UpdateType _type); void slotObjectUpdated(int _identifier , const UpdateType _type);
void slotObjectSelectionChanged(int _identifier); void slotObjectSelectionChanged(int _identifier);
/// initialization called from button in toolbox
void slot_init();
/// decimating called from button in toolbox /// decimating called from button in toolbox
void slot_decimate(); void slot_decimate();
......
...@@ -74,6 +74,15 @@ ...@@ -74,6 +74,15 @@
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </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"> <property name="minimum">
<double>-1.000000000000000</double> <double>-1.000000000000000</double>
</property> </property>
...@@ -160,6 +169,16 @@ ...@@ -160,6 +169,16 @@
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </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"> <property name="minimum">
<double>-1.000000000000000</double> <double>-1.000000000000000</double>
</property> </property>
...@@ -202,6 +221,15 @@ ...@@ -202,6 +221,15 @@
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </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"> <property name="minimum">
<number>1</number> <number>1</number>
</property> </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