]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Debug PAL8101: SMesh: Controls - Scalar bar properties works wrong.
authormsv <msv@opencascade.com>
Thu, 6 Apr 2006 13:33:54 +0000 (13:33 +0000)
committermsv <msv@opencascade.com>
Thu, 6 Apr 2006 13:33:54 +0000 (13:33 +0000)
The LookupTable has been assigned the same number of table values as
the number of colors in the ScalarBarActor.

src/OBJECT/SMESH_DeviceActor.cxx
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx

index 28670e6bef7302f017887740615bed1380d270df..0d3347ecbb4bbf67eb115cf4ee8c49152866044d 100644 (file)
@@ -284,6 +284,7 @@ void SMESH_DeviceActor::SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
     aScalars->Delete();
        
     theLookupTable->SetRange(aScalars->GetRange());
+    theLookupTable->SetNumberOfTableValues(theScalarBarActor->GetMaximumNumberOfColors());
     theLookupTable->Build();
     
     myMergeFilter->SetScalars(aDataSet);
index 9f47c0f48ab0619b2fc3efed6f0945c4a28cc959..b8bf38fbbbe730216ff387c413ea03babfa45f6d 100644 (file)
@@ -58,7 +58,7 @@
 
 #include <vtkTextProperty.h>
 #include <vtkScalarBarActor.h>
-#include <vtkScalarsToColors.h>
+#include <vtkLookupTable.h>
 
 #define MINIMUM_WIDTH 70
 #define MARGIN_SIZE   11
@@ -520,7 +520,11 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply()
 
     double aMin = myMinEdit->text().toDouble();
     double aMax = myMaxEdit->text().toDouble();
-    myScalarBarActor->GetLookupTable()->SetRange( aMin, aMax );
+    vtkLookupTable* myLookupTable =
+      static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
+    myLookupTable->SetRange( aMin, aMax );
+    myLookupTable->SetNumberOfTableValues(myColorsSpin->value());
+    myLookupTable->Build();
     SMESH::RepaintCurrentView();
   } else {
     // Scalar Bar preferences