Commit 9d466f7f authored by Isaak Lim's avatar Isaak Lim

Added the following Mods to the Decimater Plugin:

Aspect Ratio
Edge Length
Independent Sets

Updated DecimaterInfo and the UI accordingly.


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12864 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 614060e0
......@@ -44,10 +44,17 @@
DecimaterInfo::DecimaterInfo() :
normalDeviation_(false),
normalFlipping_(false),
distance_(false),
edgeLength_(false),
aspectRatio_(false),
roundness_(false),
independentSets_(false),
decimationOrder_(DISTANCE),
normalDeviation_value_(0),
distance_value_(0),
edgeLength_value_(0),
aspectRatio_value_(0),
roundness_value_(0) {}
......@@ -79,6 +86,22 @@ void DecimaterInfo::setNormalDeviationConstraint( int _value ){
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::setNormalFlippingConstraint(){
normalFlipping_ = true;
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::setIndependentSetsConstraint(){
independentSets_ = true;
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::setRoundnessConstraint( double _value ){
......@@ -89,6 +112,29 @@ void DecimaterInfo::setRoundnessConstraint( double _value ){
//-----------------------------------------------------------------------------------
void DecimaterInfo::setAspectRatioConstraint( double _value ){
aspectRatio_ = true;
aspectRatio_value_ = _value;
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::setEdgeLengthConstraint( double _value ){
edgeLength_ = true;
edgeLength_value_ = _value;
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::setDecimationOrder( DecimationOrder _order ){
decimationOrder_ = _order;
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::removeDistanceConstraint(){
if ( distance_ ) {
......@@ -98,6 +144,17 @@ void DecimaterInfo::removeDistanceConstraint(){
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::removeEdgeLengthConstraint(){
if ( edgeLength_ ) {
edgeLength_ = false;
edgeLength_value_ = 0;
}
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::removeNormalDeviationConstraint(){
......@@ -109,6 +166,37 @@ void DecimaterInfo::removeNormalDeviationConstraint(){
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::removeNormalFlippingConstraint(){
if ( normalFlipping_ ) {
normalFlipping_ = false;
}
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::removeIndependentSetsConstraint(){
if ( independentSets_ ) {
independentSets_ = false;
}
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::removeAspectRatioConstraint(){
if ( aspectRatio_ ) {
aspectRatio_ = false;
aspectRatio_value_ = 0;
}
}
//-----------------------------------------------------------------------------------
void DecimaterInfo::removeRoundnessConstraint(){
......
......@@ -57,31 +57,56 @@ class DecimaterInfo : public PerObjectData
// Copy function
PerObjectData* copyPerObjectData();
enum DecimationOrder { DISTANCE, NORMALDEV, EDGELENGTH };
void setDistanceConstraint( double _value );
void setNormalDeviationConstraint( int _value );
void setNormalFlippingConstraint();
void setRoundnessConstraint( double _value );
void setAspectRatioConstraint( double _value );
void setEdgeLengthConstraint( double _value );
void setIndependentSetsConstraint();
void setDecimationOrder( DecimationOrder _order );
void removeDistanceConstraint();
void removeNormalDeviationConstraint();
void removeNormalFlippingConstraint();
void removeRoundnessConstraint();
void removeAspectRatioConstraint();
void removeEdgeLengthConstraint();
void removeIndependentSetsConstraint();
// Get/Set methods
bool normalDeviation() { return normalDeviation_; }
bool normalFlipping() { return normalFlipping_; }
bool distance() { return distance_; }
bool roundness() { return roundness_; }
bool aspectRatio() { return aspectRatio_; }
bool edgeLength() { return edgeLength_; }
bool independentSets() { return independentSets_; }
int normalDeviationValue() { return normalDeviation_value_; }
double distanceValue() { return distance_value_; }
double edgeLengthValue() { return edgeLength_value_; }
double aspectRatioValue() { return aspectRatio_value_; }
double roundnessValue() { return roundness_value_; }
private :
bool normalDeviation_;
bool normalFlipping_;
bool distance_;
bool edgeLength_;
bool aspectRatio_;
bool roundness_;
bool independentSets_;
DecimationOrder decimationOrder_;
int normalDeviation_value_;
double distance_value_;
double edgeLength_value_;
double aspectRatio_value_;
double roundness_value_;
};
This diff is collapsed.
......@@ -163,14 +163,19 @@ private slots:
/// roundness slider - spinbox sync
void updateRoundness(int _value);
void updateRoundness(double _value);
void updateAspectRatio(int _value);
void updateAspectRatio(double _value);
/// slider / spinbox updates
void updateDistance ();
void updateNormalDev ();
void updateVertices ();
void updateTriangles ();
void updateEdgeLength ();
/// update number of vertices information
void slotUpdateNumVertices();
void slotUpdateNumTriangles();
//===========================================================================
/** @name Scripting Functions
......
This diff is collapsed.
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