]> SALOME platform Git repositories - modules/visu.git/blob - src/PIPELINE/VISU_PipeLine.hxx
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/visu.git] / src / PIPELINE / VISU_PipeLine.hxx
1 //  VISU OBJECT : interactive object for VISU entities implementation
2 //
3 //  Copyright (C) 2003  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 // 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   //----------------------------------------------------------------------------
136   void
137   SetImplicitFunction(vtkImplicitFunction *theFunction);
138
139   vtkImplicitFunction* 
140   GetImplicitFunction();
141
142   void
143   SetExtractInside(bool theMode);
144
145   void
146   SetExtractBoundaryCells(bool theMode);
147
148   //----------------------------------------------------------------------------
149   void 
150   RemoveAllClippingPlanes();
151
152   vtkIdType
153   GetNumberOfClippingPlanes();
154
155   bool
156   AddClippingPlane(vtkPlane* thePlane);
157
158   virtual
159   vtkPlane* 
160   GetClippingPlane(vtkIdType theID);
161
162   virtual
163   void
164   SetPlaneParam(vtkFloatingPointType theDir[3], 
165                 vtkFloatingPointType theDist, 
166                 vtkPlane* thePlane);
167
168   virtual
169   void
170   GetPlaneParam(vtkFloatingPointType theDir[3], 
171                 vtkFloatingPointType& theDist, 
172                 vtkPlane* thePlane);
173
174   //----------------------------------------------------------------------------
175   static
176   size_t
177   CheckAvailableMemory(double theSize);
178
179   static
180   size_t
181   GetAvailableMemory(size_t theSize,
182                      size_t theMinSize = 1024*1024);
183
184 protected:
185   //----------------------------------------------------------------------------
186   VISU_PipeLine();
187
188   virtual
189   ~VISU_PipeLine();
190
191   //----------------------------------------------------------------------------
192   virtual
193   void
194   Build() = 0;
195
196   virtual
197   void
198   OnCreateMapperHolder() = 0;
199
200   virtual
201   void
202   DoShallowCopy(VISU_PipeLine *thePipeLine,
203                 bool theIsCopyInput);
204
205   //----------------------------------------------------------------------------
206   vtkDataSet* 
207   GetClippedInput();
208
209   void 
210   SetIsShrinkable(bool theIsShrinkable);
211
212 private:
213   //----------------------------------------------------------------------------
214   vtkSmartPointer<VISU_MapperHolder> myMapperHolder;
215   bool myIsShrinkable;
216 };
217
218 #endif