Version: 6.3.1

src/PIPELINE/VISU_ColoredPL.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 //  VISU OBJECT : interactive object for VISU entities implementation
00024 // File:    VISU_ColoredPL.hxx
00025 // Author:  Alexey PETROV
00026 // Module : VISU
00027 //
00028 #ifndef VISU_ColoredPL_HeaderFile
00029 #define VISU_ColoredPL_HeaderFile
00030 
00031 #include "VISU_PipeLine.hxx"
00032 
00033 #include <vtkSmartPointer.h>
00034 
00035 class VISU_Extractor;
00036 class VISU_FieldTransform;
00037 class VISU_LookupTable;
00038 
00039 class vtkPassThroughFilter;
00040 class vtkDoubleArray;
00041 class vtkThreshold;
00042 
00043 
00044 //----------------------------------------------------------------------------
00045 class VISU_PIPELINE_EXPORT VISU_ColoredPL : public VISU_PipeLine
00046 {
00047 public:
00048   vtkTypeMacro(VISU_ColoredPL, VISU_PipeLine);
00049 
00050   virtual
00051   unsigned long int 
00052   GetMTime();
00053 
00054   //----------------------------------------------------------------------------
00055   virtual
00056   int
00057   GetScalarMode();
00058 
00059   virtual
00060   void
00061   SetScalarMode(int theScalarMode = 0);
00062   
00063   virtual
00064   vtkFloatingPointType* 
00065   GetScalarRange();
00066 
00067   virtual
00068   void
00069   SetScalarRange( vtkFloatingPointType theRange[2] );
00070 
00071   void
00072   SetScalarFilterRange( vtkFloatingPointType theRange[2] );
00073 
00074   void
00075   GetScalarFilterRange( vtkFloatingPointType theRange[2] );
00076 
00077   vtkFloatingPointType* 
00078   GetScalarFilterRange();
00079 
00080   bool
00081   IsScalarFilterUsed();
00082 
00083   void
00084   UseScalarFiltering( bool theUseScalarFilter );
00085 
00086   virtual
00087   void
00088   SetScaling(int theScaling);
00089   
00090   virtual
00091   int
00092   GetScaling();
00093   
00094   virtual
00095   void
00096   SetNbColors(int theNbColors);
00097 
00098   virtual
00099   int
00100   GetNbColors();
00101   
00102   vtkDoubleArray* GetDistribution();
00103 
00104 
00105 public:
00106   //----------------------------------------------------------------------------
00107   virtual
00108   void
00109   Init();
00110 
00111   virtual
00112   void
00113   Update();
00114 
00116   virtual
00117   unsigned long int
00118   GetMemorySize();
00119 
00120   virtual
00121   VISU_LookupTable*
00122   GetMapperTable();
00123 
00124   virtual 
00125   VISU_LookupTable*
00126   GetBarTable();
00127 
00128   virtual 
00129   void
00130   SetMapScale(vtkFloatingPointType theMapScale = 1.0);
00131 
00132   virtual
00133   vtkFloatingPointType
00134   GetMapScale();
00135 
00136   virtual
00137   void
00138   GetSourceRange(vtkFloatingPointType theRange[2]);
00139 
00140   virtual
00141   void
00142   SetSourceRange();
00143 
00144   virtual
00145   void
00146   UpdateMapperLookupTable();
00147   
00148 
00149 protected:
00150   //----------------------------------------------------------------------------
00151   VISU_ColoredPL();
00152   VISU_ColoredPL(const VISU_ColoredPL&) {};
00153 
00154   virtual
00155   ~VISU_ColoredPL();
00156 
00157   //----------------------------------------------------------------------------
00158   virtual
00159   void
00160   Build();
00161 
00162   virtual
00163   void
00164   DoShallowCopy(VISU_PipeLine *thePipeLine,
00165                 bool theIsCopyInput);
00166 
00167   //----------------------------------------------------------------------------
00168   VISU_Extractor* 
00169   GetExtractorFilter();
00170 
00171   VISU_FieldTransform* 
00172   GetFieldTransformFilter();
00173 
00174   //----------------------------------------------------------------------------
00175   virtual 
00176   vtkPointSet* 
00177   GetClippedInput();
00178 
00179   //----------------------------------------------------------------------------
00180   static
00181   void
00182   SetScalarMode(int theScalarMode,
00183                 vtkDataSet *theInput,
00184                 VISU_Extractor* theExtractor);
00185 
00186 private:
00187   vtkSmartPointer< VISU_LookupTable > myMapperTable;
00188   vtkSmartPointer< VISU_LookupTable > myBarTable;
00189   vtkSmartPointer< VISU_Extractor > myExtractor;
00190   vtkSmartPointer< VISU_FieldTransform > myFieldTransform;
00191   vtkSmartPointer< vtkThreshold > myThreshold;
00192   vtkSmartPointer< vtkPassThroughFilter > myPassFilter;
00193   vtkSmartPointer< vtkDoubleArray > myDistribution;
00194 };
00195   
00196 #endif
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