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

Possibility to clamp the color coding to specify range that should get visualized




git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14016 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e882cc4f
......@@ -185,6 +185,8 @@ void MeshComparePlugin::slotClear() {
}
emit updateView();
}
void MeshComparePlugin::compare(int _sourceId,int _targetId) {
......@@ -204,7 +206,6 @@ void MeshComparePlugin::compare(int _sourceId,int _targetId) {
ACG::SceneGraph::PointNode *pNode = 0;
// Check if we already attached a PointNode
if ( OpenFlipper::Options::gui() ) {
......@@ -388,32 +389,75 @@ void MeshComparePlugin::compare(int _sourceId,int _targetId) {
// Generate the colors
if ( pNode ) {
tool_->minValue->setText( QString::number(0.0) );
double min = 0.0;
double max = 1.0;
if ( tool_->distance->isChecked() ) {
ACG::ColorCoder cCoder(0,maximalDistance_);
tool_->maxValue->setText( QString::number(maximalDistance_) );
if ( tool_->doClamp->isChecked() ) {
min = tool_->minVal->value();
max = tool_->maxVal->value();
} else
max = maximalDistance_;
ACG::ColorCoder cCoder(min,max);
for ( unsigned int i = 0 ; i < distances.size() ; ++i) {
pNode->add_color(cCoder.color_float4(distances[i]));
}
} else if ( tool_->normalAngle->isChecked() ) {
ACG::ColorCoder cCoder(0,maxNormalDeviation_);
tool_->maxValue->setText( QString::number(maxNormalDeviation_) );
if ( tool_->doClamp->isChecked() ) {
min = tool_->minVal->value();
max = tool_->maxVal->value();
} else
max = maxNormalDeviation_;
ACG::ColorCoder cCoder(min,max);
for ( unsigned int i = 0 ; i < normalAngles.size() ; ++i) {
pNode->add_color(cCoder.color_float4(normalAngles[i]));
}
} else if ( tool_->meanCurvature->isChecked() ) {
ACG::ColorCoder cCoder(0,maxMeanCurvatureDev_);
tool_->maxValue->setText( QString::number(maxMeanCurvatureDev_) );
if ( tool_->doClamp->isChecked() ) {
min = tool_->minVal->value();
max = tool_->maxVal->value();
} else
max = maxMeanCurvatureDev_;
ACG::ColorCoder cCoder(min,max);
for ( unsigned int i = 0 ; i < meanCurvatures.size() ; ++i) {
pNode->add_color(cCoder.color_float4(meanCurvatures[i]));
}
} else if ( tool_->gaussCurvature->isChecked() ) {
ACG::ColorCoder cCoder(0,maxGaussCurvatureDev_);
tool_->maxValue->setText( QString::number(maxGaussCurvatureDev_) );
if ( tool_->doClamp->isChecked() ) {
min = tool_->minVal->value();
max = tool_->maxVal->value();
} else
max = maxGaussCurvatureDev_;
ACG::ColorCoder cCoder(min,max);
for ( unsigned int i = 0 ; i < gaussCurvatures.size() ; ++i) {
pNode->add_color(cCoder.color_float4(gaussCurvatures[i]));
}
}
......
......@@ -118,7 +118,13 @@ class MeshComparePlugin : public QObject, BaseInterface, ToolboxInterface, Loggi
QString version() { return QString("1.0"); };
/// Compares two meshes. Use the two getter functions to retrieve the maximal deviations
/** Compares two meshes. Use the two getter functions to retrieve the maximal deviations.
*
* The source will be the reference. The difference will be rendered as points on the target mesh.
*
* @param _sourceId Id of the reference mesh
* @param _targetId Id of the mesh that should be compared to the reference mesh.
*/
void compare(int _sourceId,int _targetId);
/// Get the maximal distance of the last comparison (-1, if no comparison performed so far)
......@@ -148,6 +154,7 @@ class MeshComparePlugin : public QObject, BaseInterface, ToolboxInterface, Loggi
/// Last maximal gauss curvature deviation
double maxGaussCurvatureDev_;
};
#endif //MESHCOMPAREPLUGIN_HH
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>321</width>
<height>183</height>
<width>297</width>
<height>258</height>
</rect>
</property>
<property name="windowTitle">
......@@ -82,6 +82,84 @@
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Min:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="minValue">
<property name="text">
<string>MinValue</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Max:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="maxValue">
<property name="text">
<string>MaxValue</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="doClamp">
<property name="text">
<string>Clamp</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="minVal">
<property name="decimals">
<number>5</number>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="maxVal">
<property name="decimals">
<number>5</number>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
......
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