From fc4e1d14a0d4a141fb96d464d8e2f80cd444eb27 Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 23 Nov 2009 07:51:52 +0000 Subject: [PATCH] Fix of issue 0020593: EDF 885 VISU: Unchecking Filter by Scalar does not remove white marks on the scalar bar --- src/PIPELINE/VISU_LookupTable.cxx | 12 +++++++++++- src/PIPELINE/VISU_LookupTable.hxx | 5 +++++ src/VISU_I/VISU_ScalarMap_i.cc | 5 ++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/PIPELINE/VISU_LookupTable.cxx b/src/PIPELINE/VISU_LookupTable.cxx index 938b8293..a2a4e7f7 100644 --- a/src/PIPELINE/VISU_LookupTable.cxx +++ b/src/PIPELINE/VISU_LookupTable.cxx @@ -42,7 +42,8 @@ VISU_LookupTable ::VISU_LookupTable(int sze, int ext): vtkLookupTable(sze, ext), myScale(1.0), - myBicolor(false) + myBicolor(false), + myHasMarkedValues(false) {} //---------------------------------------------------------------------------- @@ -68,6 +69,7 @@ VISU_LookupTable vtkIdType anIndex = this->GetIndex( theValue ); unsigned char *aTablePtr = this->GetPointer( anIndex ); CopyColor( aTablePtr, theColor ); + myHasMarkedValues = true; } @@ -173,6 +175,14 @@ VISU_LookupTable } } +void +VISU_LookupTable +::ForceBuild() +{ + Superclass::ForceBuild(); + myHasMarkedValues = false; +} + // Apply log to value, with appropriate constraints. inline vtkFloatingPointType diff --git a/src/PIPELINE/VISU_LookupTable.hxx b/src/PIPELINE/VISU_LookupTable.hxx index 1acbecb6..16a8a477 100644 --- a/src/PIPELINE/VISU_LookupTable.hxx +++ b/src/PIPELINE/VISU_LookupTable.hxx @@ -38,6 +38,8 @@ class VISU_PIPELINE_EXPORT VISU_LookupTable: public vtkLookupTable vtkTypeMacro(VISU_LookupTable,vtkLookupTable); static VISU_LookupTable *New(); + virtual void ForceBuild(); + virtual void MapScalarsThroughTable2(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputIncrement); @@ -56,6 +58,8 @@ class VISU_PIPELINE_EXPORT VISU_LookupTable: public vtkLookupTable void MarkValueByColor( vtkFloatingPointType theValue, unsigned char* theColor ); + bool HasMarkedValues() const { return myHasMarkedValues; } + void FillByColor( unsigned char* theColor ); void MakeBiColor(); @@ -67,5 +71,6 @@ class VISU_PIPELINE_EXPORT VISU_LookupTable: public vtkLookupTable vtkFloatingPointType myScale; bool myBicolor; + bool myHasMarkedValues; }; #endif // VISU_LookupTable_H diff --git a/src/VISU_I/VISU_ScalarMap_i.cc b/src/VISU_I/VISU_ScalarMap_i.cc index 974cc641..8b0326d6 100644 --- a/src/VISU_I/VISU_ScalarMap_i.cc +++ b/src/VISU_I/VISU_ScalarMap_i.cc @@ -536,8 +536,11 @@ VISU::ScalarMap_i if(VISU_ScalarMapAct* anActor = dynamic_cast(theActor)){ VISU_LookupTable * aLookupTable = GetSpecificPL()->GetBarTable(); - if ( IsScalarFilterUsed() ) { + bool anIsScalarFilterUsed = IsScalarFilterUsed(); + if ( anIsScalarFilterUsed || aLookupTable->HasMarkedValues() ) aLookupTable->ForceBuild(); + + if ( anIsScalarFilterUsed ) { static unsigned char MARK_COLOR[] = { 255, 255, 255 }; aLookupTable->MarkValueByColor( GetScalarFilterMin(), MARK_COLOR ); aLookupTable->MarkValueByColor( GetScalarFilterMax(), MARK_COLOR ); -- 2.39.2