]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
[bos #32736][CEA] Threshold of criteria. Added using completely transparent above...
authorkosta <kleontev@Debian11.kleontev.virtualbox.org>
Tue, 28 Mar 2023 14:33:41 +0000 (16:33 +0200)
committerkosta <kleontev@Debian11.kleontev.virtualbox.org>
Tue, 28 Mar 2023 14:33:41 +0000 (16:33 +0200)
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h

index 25480624d78c745d83b67a1bffce87abe75912a7..06ae7c44243b50d2485cafa1c95d4f613bd0ed8f 100644 (file)
@@ -569,6 +569,7 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply()
 
   myLookupTable->SetRange( aMin, aMax );
   myLookupTable->SetNumberOfTableValues(myColorsSpin->value());
+  applyThreshold(myLookupTable);
 
   bool scaleChanged = (myLogarithmicCheck->isChecked() != (myLookupTable->GetScale() == VTK_SCALE_LOG10));
   if (scaleChanged)
@@ -661,6 +662,8 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged()
           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();
@@ -878,3 +881,27 @@ void SMESHGUI_Preferences_ScalarBarDlg::initScalarBarFromResources()
       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);
+  }
+}
index 3345ad1f3c2c7fe3096a3d181c0896453b2e867c..166646f1c50250a5863c1a7b475fd253c8af1594 100644 (file)
@@ -50,6 +50,8 @@ class SalomeApp_IntSpinBox;
 class QtxColorButton;
 class LightApp_SelectionMgr;
 
+class vtkLookupTable;
+
 class SMESHGUI_EXPORT SMESHGUI_Preferences_ScalarBarDlg : public QDialog
 { 
   Q_OBJECT
@@ -70,6 +72,9 @@ public:
                                              const double );
   void                     initScalarBarFromResources();
 
+protected:
+  void                     applyThreshold(vtkLookupTable* aLookupTable);
+
 protected slots:
   virtual void             reject();