Salome HOME
IMP 0017328: min and max scalar map of results given at gauss points. A fix for the...
[modules/visu.git] / src / PIPELINE / VISU_PipeLine.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_PipeLine.hxx
24 // Author:  Alexey PETROV
25 // Module : VISU
26 //
27 #ifndef VISU_PipeLine_HeaderFile
28 #define VISU_PipeLine_HeaderFile
29
30 #include "VISUPipeline.hxx"
31 #include "VISU_IDMapper.hxx"
32
33 #include <vtkObject.h>
34 #include <vtkSmartPointer.h>
35
36 class vtkCell;
37 class vtkPlane;
38 class vtkMapper;
39 class vtkDataSet;
40 class vtkPointSet;
41 class vtkImplicitFunction;
42
43 class VISU_MapperHolder;
44
45 //----------------------------------------------------------------------------
46 class VISU_PIPELINE_EXPORT VISU_PipeLine : public vtkObject
47 {
48   friend class VISU_MapperHolder;
49
50 public:
51   vtkTypeMacro(VISU_PipeLine, vtkObject);
52
53   //! Gets memory size used by the instance (bytes).
54   virtual
55   unsigned long int
56   GetMemorySize();
57
58   virtual
59   unsigned long int 
60   GetMTime();
61
62   //----------------------------------------------------------------------------
63   virtual
64   void
65   ShallowCopy(VISU_PipeLine *thePipeLine,
66               bool theIsCopyInput);
67
68   virtual
69   void
70   SameAs(VISU_PipeLine *thePipeLine);
71
72   //----------------------------------------------------------------------------
73   void 
74   SetMapperHolder(VISU_MapperHolder* theHolder);
75
76   VISU_MapperHolder* 
77   GetMapperHolder();
78
79   const VISU::PIDMapper&  
80   GetIDMapper();
81
82   virtual
83   vtkDataSet* 
84   GetInput();
85
86   virtual 
87   vtkMapper* 
88   GetMapper();
89
90   virtual
91   vtkDataSet* 
92   GetOutput();
93
94   //----------------------------------------------------------------------------
95   virtual
96   void
97   Init();
98
99   virtual
100   void
101   Update();
102
103   //----------------------------------------------------------------------------
104   virtual
105   vtkIdType
106   GetNodeObjID(vtkIdType theID);
107
108   virtual
109   vtkIdType
110   GetNodeVTKID(vtkIdType theID);
111
112   virtual
113   vtkFloatingPointType* 
114   GetNodeCoord(vtkIdType theObjID);
115
116   virtual
117   vtkIdType
118   GetElemObjID(vtkIdType theID);
119
120   virtual
121   vtkIdType
122   GetElemVTKID(vtkIdType theID);
123
124   virtual
125   vtkCell*
126   GetElemCell(vtkIdType theObjID);
127
128   //----------------------------------------------------------------------------
129   bool
130   IsPlanarInput();
131
132   bool 
133   IsShrinkable();
134
135   bool 
136   IsFeatureEdgesAllowed();
137
138   //----------------------------------------------------------------------------
139   void
140   SetImplicitFunction(vtkImplicitFunction *theFunction);
141
142   vtkImplicitFunction* 
143   GetImplicitFunction();
144
145   void
146   SetExtractInside(bool theMode);
147
148   void
149   SetExtractBoundaryCells(bool theMode);
150
151   //----------------------------------------------------------------------------
152   virtual
153   void 
154   RemoveAllClippingPlanes();
155
156   vtkIdType
157   GetNumberOfClippingPlanes();
158
159   virtual
160   bool
161   AddClippingPlane(vtkPlane* thePlane);
162
163   virtual
164   vtkPlane* 
165   GetClippingPlane(vtkIdType theID);
166
167   virtual void RemoveClippingPlane(vtkIdType theID);
168
169   virtual
170   void
171   SetPlaneParam(vtkFloatingPointType theDir[3], 
172                 vtkFloatingPointType theDist, 
173                 vtkPlane* thePlane);
174
175   virtual
176   void
177   GetPlaneParam(vtkFloatingPointType theDir[3], 
178                 vtkFloatingPointType& theDist, 
179                 vtkPlane* thePlane);
180
181   //----------------------------------------------------------------------------
182   static
183   size_t
184   CheckAvailableMemory(double theSize);
185
186   static
187   size_t
188   GetAvailableMemory(size_t theSize,
189                      size_t theMinSize = 1024*1024);
190
191 protected:
192   //----------------------------------------------------------------------------
193   VISU_PipeLine();
194
195   virtual
196   ~VISU_PipeLine();
197
198   //----------------------------------------------------------------------------
199   virtual
200   void
201   Build() = 0;
202
203   virtual
204   void
205   OnCreateMapperHolder() = 0;
206
207   virtual
208   void
209   DoShallowCopy(VISU_PipeLine *thePipeLine,
210                 bool theIsCopyInput);
211
212   //----------------------------------------------------------------------------
213   vtkDataSet* 
214   GetClippedInput();
215
216   void 
217   SetIsShrinkable(bool theIsShrinkable);
218
219   void 
220   SetIsFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
221
222 private:
223   //----------------------------------------------------------------------------
224   vtkSmartPointer<VISU_MapperHolder> myMapperHolder;
225   bool myIsShrinkable;
226   bool myIsFeatureEdgesAllowed;
227 };
228
229 #endif