From a1119a1c80593e7be479943fed1b638b580abaa4 Mon Sep 17 00:00:00 2001 From: msv Date: Thu, 6 Apr 2006 13:33:54 +0000 Subject: [PATCH] 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. --- src/OBJECT/SMESH_DeviceActor.cxx | 1 + src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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 -- 2.39.2