myLookupTable->SetRange( aMin, aMax );
myLookupTable->SetNumberOfTableValues(myColorsSpin->value());
+ applyThreshold(myLookupTable);
bool scaleChanged = (myLogarithmicCheck->isChecked() != (myLookupTable->GetScale() == VTK_SCALE_LOG10));
if (scaleChanged)
myLogarithmicCheck->setChecked(aLookupTable->GetScale() == VTK_SCALE_LOG10);
//myLogarithmicCheck->setEnabled(range[0] > 1e-07 && range[1] > 1e-07);
myLogarithmicCheck->setEnabled(range[0] != range[1]);
+
+ applyThreshold(aLookupTable);
}
vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
DEF_VER_H = mgr->doubleValue("SMESH", name.arg( "height" ));
}
}
+
+//=================================================================================================
+/*!
+ * SMESHGUI_Preferences_ScalarBarDlg::applyThreshold()
+ *
+ * Switch on and off using of special color for values beyond the min-max range.
+ * Now this color is completely transparent - RGBA(0,0,0,0).
+ */
+//=================================================================================================
+void SMESHGUI_Preferences_ScalarBarDlg::applyThreshold(vtkLookupTable* aLookupTable)
+{
+ const bool isChecked = myThresholdCheck->isChecked();
+
+ aLookupTable->SetUseAboveRangeColor(isChecked);
+ aLookupTable->SetUseBelowRangeColor(isChecked);
+
+ if (isChecked)
+ {
+ const double beyondRangeColor[4] = {};
+
+ aLookupTable->SetAboveRangeColor(beyondRangeColor);
+ aLookupTable->SetBelowRangeColor(beyondRangeColor);
+ }
+}