Salome HOME
04dfd7e9ed5215c89eac324f01502a756cca1601
[modules/visu.git] / src / PIPELINE / VISU_ColoredPL.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  VISU OBJECT : interactive object for VISU entities implementation
23 // File:    VISU_ColoredPL.hxx
24 // Author:  Alexey PETROV
25 // Module : VISU
26 //
27 #ifndef VISU_ColoredPL_HeaderFile
28 #define VISU_ColoredPL_HeaderFile
29
30 #include "VISU_PipeLine.hxx"
31
32 #include <vtkSmartPointer.h>
33
34 class VISU_Extractor;
35 class VISU_FieldTransform;
36 class VISU_LookupTable;
37
38 class vtkPassThroughFilter;
39 class vtkDoubleArray;
40 class vtkThreshold;
41
42
43 //----------------------------------------------------------------------------
44 class VISU_PIPELINE_EXPORT VISU_ColoredPL : public VISU_PipeLine
45 {
46 public:
47   vtkTypeMacro(VISU_ColoredPL, VISU_PipeLine);
48
49   virtual
50   unsigned long int 
51   GetMTime();
52
53   //----------------------------------------------------------------------------
54   virtual
55   int
56   GetScalarMode();
57
58   virtual
59   void
60   SetScalarMode(int theScalarMode = 0);
61   
62   virtual
63   vtkFloatingPointType* 
64   GetScalarRange();
65
66   virtual
67   void
68   SetScalarRange( vtkFloatingPointType theRange[2] );
69
70   void
71   SetScalarFilterRange( vtkFloatingPointType theRange[2] );
72
73   void
74   GetScalarFilterRange( vtkFloatingPointType theRange[2] );
75
76   vtkFloatingPointType* 
77   GetScalarFilterRange();
78
79   bool
80   IsScalarFilterUsed();
81
82   void
83   UseScalarFiltering( bool theUseScalarFilter );
84
85   virtual
86   void
87   SetScaling(int theScaling);
88   
89   virtual
90   int
91   GetScaling();
92   
93   virtual
94   void
95   SetNbColors(int theNbColors);
96
97   virtual
98   int
99   GetNbColors();
100   
101   vtkDoubleArray* GetDistribution();
102
103
104 public:
105   //----------------------------------------------------------------------------
106   virtual
107   void
108   Init();
109
110   virtual
111   void
112   Update();
113
114   //! Gets memory size used by the instance (bytes).
115   virtual
116   unsigned long int
117   GetMemorySize();
118
119   virtual
120   VISU_LookupTable*
121   GetMapperTable();
122
123   virtual 
124   VISU_LookupTable*
125   GetBarTable();
126
127   virtual 
128   void
129   SetMapScale(vtkFloatingPointType theMapScale = 1.0);
130
131   virtual
132   vtkFloatingPointType
133   GetMapScale();
134
135   virtual
136   void
137   GetSourceRange(vtkFloatingPointType theRange[2]);
138
139   virtual
140   void
141   SetSourceRange();
142
143 protected:
144   //----------------------------------------------------------------------------
145   VISU_ColoredPL();
146   VISU_ColoredPL(const VISU_ColoredPL&) {};
147
148   virtual
149   ~VISU_ColoredPL();
150
151   //----------------------------------------------------------------------------
152   virtual
153   void
154   Build();
155
156   virtual
157   void
158   DoShallowCopy(VISU_PipeLine *thePipeLine,
159                 bool theIsCopyInput);
160
161   //----------------------------------------------------------------------------
162   VISU_Extractor* 
163   GetExtractorFilter();
164
165   VISU_FieldTransform* 
166   GetFieldTransformFilter();
167
168   //----------------------------------------------------------------------------
169   virtual 
170   vtkPointSet* 
171   GetClippedInput();
172
173   //----------------------------------------------------------------------------
174   static
175   void
176   SetScalarMode(int theScalarMode,
177                 vtkDataSet *theInput,
178                 VISU_Extractor* theExtractor);
179
180 private:
181   vtkSmartPointer< VISU_LookupTable > myMapperTable;
182   vtkSmartPointer< VISU_LookupTable > myBarTable;
183   vtkSmartPointer< VISU_Extractor > myExtractor;
184   vtkSmartPointer< VISU_FieldTransform > myFieldTransform;
185   vtkSmartPointer< vtkThreshold > myThreshold;
186   vtkSmartPointer< vtkPassThroughFilter > myPassFilter;
187   vtkSmartPointer< vtkDoubleArray > myDistribution;
188 };
189   
190 #endif