Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / PIPELINE / VISU_LookupTable.hxx
index 93fc7a47b137c19cadbe062c5ac3158baa7d93bd..daa1a22ba28b8dc2a5055fca333e6ab74535d597 100644 (file)
@@ -1,42 +1,49 @@
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 //  File   : VISU_LookupTable.h
 //  Author : Vitaliy Smetannikov
 //  Module : VISU
-
+//
 #ifndef VISU_LookupTable_H
 #define VISU_LookupTable_H
 
+#include "VISUPipeline.hxx"
+
 #include <vtkLookupTable.h>
 
 #include "VTKViewer.h"
 
-class VISU_LookupTable: public vtkLookupTable 
+class VISU_PIPELINE_EXPORT VISU_LookupTable: public vtkLookupTable 
 {
  public:
    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);
+                                        int inputDataType, int numberOfValues,
+                                        int inputIncrement, int outputIncrement);
 
   vtkFloatingPointType GetMapScale() { return myScale; }
   void SetMapScale(vtkFloatingPointType theScale = 1.0);
@@ -44,8 +51,19 @@ class VISU_LookupTable: public vtkLookupTable
   bool GetBicolor() { return myBicolor; }
   void SetBicolor( bool theBicolor );
 
-   static int ComputeLogRange(vtkFloatingPointType inRange[2], vtkFloatingPointType outRange[2]);
-   unsigned char *MapValue(vtkFloatingPointType v);
+  static int ComputeLogRange( vtkFloatingPointType inRange[2], 
+                              vtkFloatingPointType outRange[2] );
+  
+  unsigned char *MapValue(vtkFloatingPointType v);
+
+  void MarkValueByColor( vtkFloatingPointType theValue,
+                         unsigned char* theColor );
+
+  bool HasMarkedValues() const { return myHasMarkedValues; }
+
+  void FillByColor( unsigned char* theColor );
+
+  void MakeBiColor();
 
  protected:
    VISU_LookupTable(int sze=256, int ext=256);
@@ -54,5 +72,6 @@ class VISU_LookupTable: public vtkLookupTable
    vtkFloatingPointType myScale;
 
    bool myBicolor;
+   bool myHasMarkedValues;
 };
 #endif // VISU_LookupTable_H