]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix of issue 0020593: EDF 885 VISU: Unchecking Filter by Scalar does not remove white... V5_1_main_20091123
authorouv <ouv@opencascade.com>
Mon, 23 Nov 2009 07:51:52 +0000 (07:51 +0000)
committerouv <ouv@opencascade.com>
Mon, 23 Nov 2009 07:51:52 +0000 (07:51 +0000)
src/PIPELINE/VISU_LookupTable.cxx
src/PIPELINE/VISU_LookupTable.hxx
src/VISU_I/VISU_ScalarMap_i.cc

index 938b82934efa015f8d62e7a20be465d173d6691b..a2a4e7f71b04a80fb58da22fa1bac00ab346ff78 100644 (file)
@@ -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
index 1acbecb607acfed4d48c727e90b4fa5b04ad2930..16a8a4775dd728b3f4d07a2894d1e596ccc1f1ad 100644 (file)
@@ -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
index 974cc64158d0d1c2308337bb269f73300b4408b9..8b0326d6c5e00f79fd41f8afb1f63286496cf4f6 100644 (file)
@@ -536,8 +536,11 @@ VISU::ScalarMap_i
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(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 );