Salome HOME
6d9a99171f64e9254a28ac93038a398686a1a329
[modules/visu.git] / src / PIPELINE / VISU_ColoredPL.hxx
1 // Copyright (C) 2007-2011  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
23 //  VISU OBJECT : interactive object for VISU entities implementation
24 // File:    VISU_ColoredPL.hxx
25 // Author:  Alexey PETROV
26 // Module : VISU
27 //
28 #ifndef VISU_ColoredPL_HeaderFile
29 #define VISU_ColoredPL_HeaderFile
30
31 #include "VISU_PipeLine.hxx"
32
33 #include <vtkSmartPointer.h>
34
35 class VISU_Extractor;
36 class VISU_FieldTransform;
37 class VISU_LookupTable;
38
39 class vtkPassThroughFilter;
40 class vtkDoubleArray;
41 class vtkThreshold;
42
43
44 //----------------------------------------------------------------------------
45 class VISU_PIPELINE_EXPORT VISU_ColoredPL : public VISU_PipeLine
46 {
47 public:
48   vtkTypeMacro(VISU_ColoredPL, VISU_PipeLine);
49
50   virtual
51   unsigned long int 
52   GetMTime();
53
54   //----------------------------------------------------------------------------
55   virtual
56   int
57   GetScalarMode();
58
59   virtual
60   void
61   SetScalarMode(int theScalarMode = 0);
62   
63   virtual
64   vtkFloatingPointType* 
65   GetScalarRange();
66
67   virtual
68   void
69   SetScalarRange( vtkFloatingPointType theRange[2] );
70
71   void
72   SetScalarFilterRange( vtkFloatingPointType theRange[2] );
73
74   void
75   GetScalarFilterRange( vtkFloatingPointType theRange[2] );
76
77   vtkFloatingPointType* 
78   GetScalarFilterRange();
79
80   bool
81   IsScalarFilterUsed();
82
83   void
84   UseScalarFiltering( bool theUseScalarFilter );
85
86   virtual
87   void
88   SetScaling(int theScaling);
89   
90   virtual
91   int
92   GetScaling();
93   
94   virtual
95   void
96   SetNbColors(int theNbColors);
97
98   virtual
99   int
100   GetNbColors();
101   
102   vtkDoubleArray* GetDistribution();
103
104
105 public:
106   //----------------------------------------------------------------------------
107   virtual
108   void
109   Init();
110
111   virtual
112   void
113   Update();
114
115   //! Gets memory size used by the instance (bytes).
116   virtual
117   unsigned long int
118   GetMemorySize();
119
120   virtual
121   VISU_LookupTable*
122   GetMapperTable();
123
124   virtual 
125   VISU_LookupTable*
126   GetBarTable();
127
128   virtual 
129   void
130   SetMapScale(vtkFloatingPointType theMapScale = 1.0);
131
132   virtual
133   vtkFloatingPointType
134   GetMapScale();
135
136   virtual
137   void
138   GetSourceRange(vtkFloatingPointType theRange[2]);
139
140   virtual
141   void
142   SetSourceRange();
143
144   virtual
145   void
146   UpdateMapperLookupTable();
147   
148
149 protected:
150   //----------------------------------------------------------------------------
151   VISU_ColoredPL();
152   VISU_ColoredPL(const VISU_ColoredPL&) {};
153
154   virtual
155   ~VISU_ColoredPL();
156
157   //----------------------------------------------------------------------------
158   virtual
159   void
160   Build();
161
162   virtual
163   void
164   DoShallowCopy(VISU_PipeLine *thePipeLine,
165                 bool theIsCopyInput);
166
167   //----------------------------------------------------------------------------
168   VISU_Extractor* 
169   GetExtractorFilter();
170
171   VISU_FieldTransform* 
172   GetFieldTransformFilter();
173
174   //----------------------------------------------------------------------------
175   virtual 
176   vtkPointSet* 
177   GetClippedInput();
178
179   //----------------------------------------------------------------------------
180   static
181   void
182   SetScalarMode(int theScalarMode,
183                 vtkDataSet *theInput,
184                 VISU_Extractor* theExtractor);
185
186 private:
187   vtkSmartPointer< VISU_LookupTable > myMapperTable;
188   vtkSmartPointer< VISU_LookupTable > myBarTable;
189   vtkSmartPointer< VISU_Extractor > myExtractor;
190   vtkSmartPointer< VISU_FieldTransform > myFieldTransform;
191   vtkSmartPointer< vtkThreshold > myThreshold;
192   vtkSmartPointer< vtkPassThroughFilter > myPassFilter;
193   vtkSmartPointer< vtkDoubleArray > myDistribution;
194 };
195   
196 #endif