]> SALOME platform Git repositories - modules/visu.git/blob - src/PIPELINE/VISU_ColoredPL.hxx
Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / PIPELINE / VISU_ColoredPL.hxx
1 //  Copyright (C) 2007-2010  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 protected:
145   //----------------------------------------------------------------------------
146   VISU_ColoredPL();
147   VISU_ColoredPL(const VISU_ColoredPL&) {};
148
149   virtual
150   ~VISU_ColoredPL();
151
152   //----------------------------------------------------------------------------
153   virtual
154   void
155   Build();
156
157   virtual
158   void
159   DoShallowCopy(VISU_PipeLine *thePipeLine,
160                 bool theIsCopyInput);
161
162   //----------------------------------------------------------------------------
163   VISU_Extractor* 
164   GetExtractorFilter();
165
166   VISU_FieldTransform* 
167   GetFieldTransformFilter();
168
169   //----------------------------------------------------------------------------
170   virtual 
171   vtkPointSet* 
172   GetClippedInput();
173
174   //----------------------------------------------------------------------------
175   static
176   void
177   SetScalarMode(int theScalarMode,
178                 vtkDataSet *theInput,
179                 VISU_Extractor* theExtractor);
180
181 private:
182   vtkSmartPointer< VISU_LookupTable > myMapperTable;
183   vtkSmartPointer< VISU_LookupTable > myBarTable;
184   vtkSmartPointer< VISU_Extractor > myExtractor;
185   vtkSmartPointer< VISU_FieldTransform > myFieldTransform;
186   vtkSmartPointer< vtkThreshold > myThreshold;
187   vtkSmartPointer< vtkPassThroughFilter > myPassFilter;
188   vtkSmartPointer< vtkDoubleArray > myDistribution;
189 };
190   
191 #endif