Version: 6.3.1

src/PIPELINE/VISU_LookupTable.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : VISU_LookupTable.h
00024 //  Author : Vitaliy Smetannikov
00025 //  Module : VISU
00026 //
00027 #ifndef VISU_LookupTable_H
00028 #define VISU_LookupTable_H
00029 
00030 #include "VISUPipeline.hxx"
00031 
00032 #include <vtkLookupTable.h>
00033 
00034 #include "VTKViewer.h"
00035 
00036 class VISU_PIPELINE_EXPORT VISU_LookupTable: public vtkLookupTable 
00037 {
00038  public:
00039    vtkTypeMacro(VISU_LookupTable,vtkLookupTable);
00040    static VISU_LookupTable *New();
00041 
00042    virtual void ForceBuild();
00043 
00044    virtual void MapScalarsThroughTable2(void *input, unsigned char *output,
00045                                         int inputDataType, int numberOfValues,
00046                                         int inputIncrement, int outputIncrement);
00047 
00048   vtkFloatingPointType GetMapScale() { return myScale; }
00049   void SetMapScale(vtkFloatingPointType theScale = 1.0);
00050 
00051   bool GetBicolor() { return myBicolor; }
00052   void SetBicolor( bool theBicolor );
00053 
00054   static int ComputeLogRange( vtkFloatingPointType inRange[2], 
00055                               vtkFloatingPointType outRange[2] );
00056   
00057   unsigned char *MapValue(vtkFloatingPointType v);
00058 
00059   void MarkValueByColor( vtkFloatingPointType theValue,
00060                          unsigned char* theColor );
00061 
00062   bool HasMarkedValues() const { return myHasMarkedValues; }
00063 
00064   void FillByColor( unsigned char* theColor );
00065 
00066   void MakeBiColor();
00067 
00068  protected:
00069    VISU_LookupTable(int sze=256, int ext=256);
00070    ~VISU_LookupTable() {};
00071    
00072    vtkFloatingPointType myScale;
00073 
00074    bool myBicolor;
00075    bool myHasMarkedValues;
00076 };
00077 #endif // VISU_LookupTable_H
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS