From: msv Date: Thu, 6 Apr 2006 13:33:54 +0000 (+0000) Subject: Debug PAL8101: SMesh: Controls - Scalar bar properties works wrong. X-Git-Tag: T3_2_0b1_pre1~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a1119a1c80593e7be479943fed1b638b580abaa4;p=modules%2Fsmesh.git Debug PAL8101: SMesh: Controls - Scalar bar properties works wrong. The LookupTable has been assigned the same number of table values as the number of colors in the ScalarBarActor. --- diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 28670e6be..0d3347ecb 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -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); diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx index 9f47c0f48..b8bf38fbb 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx @@ -58,7 +58,7 @@ #include #include -#include +#include #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(myScalarBarActor->GetLookupTable()); + myLookupTable->SetRange( aMin, aMax ); + myLookupTable->SetNumberOfTableValues(myColorsSpin->value()); + myLookupTable->Build(); SMESH::RepaintCurrentView(); } else { // Scalar Bar preferences