Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / PIPELINE / VISU_MapperHolder.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_MapperHolder.hxx
25 // Author:  Alexey PETROV
26 // Module : VISU
27 //
28 #ifndef VISU_MapperHolder_HeaderFile
29 #define VISU_MapperHolder_HeaderFile
30
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_PipeLine;
44 class VISU_LookupTable;
45
46
47 //----------------------------------------------------------------------------
48 class VISU_MapperHolder : public vtkObject
49 {
50 public:
51   vtkTypeMacro(VISU_MapperHolder, vtkObject);
52
53   //----------------------------------------------------------------------------
54   virtual
55   void
56   ShallowCopy(VISU_MapperHolder *theMapperHolder,
57               bool theIsCopyInput);
58
59   //! Gets memory size used by the instance (bytes).
60   virtual
61   unsigned long int
62   GetMemorySize();
63
64   virtual
65   unsigned long int 
66   GetMTime();
67
68   //----------------------------------------------------------------------------
69   void
70   SetPipeLine(VISU_PipeLine* thePipeLine);
71
72   const VISU::PIDMapper&  
73   GetIDMapper();
74
75   virtual
76   vtkDataSet* 
77   GetInput();
78
79   virtual 
80   vtkMapper* 
81   GetMapper();
82
83   virtual
84   vtkDataSet* 
85   GetOutput();
86
87   virtual
88   void
89   Update();
90
91   //----------------------------------------------------------------------------
92   virtual
93   vtkIdType
94   GetNodeObjID(vtkIdType theID);
95
96   virtual
97   vtkIdType
98   GetNodeVTKID(vtkIdType theID);
99
100   virtual
101   vtkFloatingPointType* 
102   GetNodeCoord(vtkIdType theObjID);
103
104   virtual
105   vtkIdType
106   GetElemObjID(vtkIdType theID);
107
108   virtual
109   vtkIdType
110   GetElemVTKID(vtkIdType theID);
111
112   virtual
113   vtkCell*
114   GetElemCell(vtkIdType theObjID);
115
116   //----------------------------------------------------------------------------
117   virtual
118   void
119   SetImplicitFunction(vtkImplicitFunction *theFunction) = 0;
120
121   virtual
122   vtkImplicitFunction* 
123   GetImplicitFunction() = 0;
124
125   //----------------------------------------------------------------------------
126   // Clipping planes
127   virtual
128   void 
129   RemoveAllClippingPlanes() = 0;
130
131   virtual
132   vtkIdType
133   GetNumberOfClippingPlanes() = 0;
134
135   virtual
136   bool
137   AddClippingPlane(vtkPlane* thePlane) = 0;
138
139   virtual
140   vtkPlane* 
141   GetClippingPlane(vtkIdType theID) = 0;
142
143   virtual void RemoveClippingPlane(vtkIdType theID) = 0;
144
145   //----------------------------------------------------------------------------
146   virtual
147   void
148   SetLookupTable(VISU_LookupTable* theLookupTable) = 0;
149
150   virtual
151   vtkPointSet* 
152   GetClippedInput() = 0;
153
154   //----------------------------------------------------------------------------
155   virtual
156   void
157   SetExtractInside(bool theMode) = 0;
158
159   virtual
160   void
161   SetExtractBoundaryCells(bool theMode) = 0;
162
163 protected:
164   //----------------------------------------------------------------------------
165   VISU_MapperHolder();
166   VISU_MapperHolder(const VISU_MapperHolder&);
167
168   virtual
169   ~VISU_MapperHolder();
170
171   //----------------------------------------------------------------------------
172   virtual
173   void
174   OnCreateMapper() = 0;
175
176   void 
177   SetMapper(vtkMapper* theMapper);
178
179   void 
180   SetIDMapper(const VISU::PIDMapper& theIDMapper);
181
182 private:
183   //----------------------------------------------------------------------------
184   vtkSmartPointer<vtkMapper> myMapper;
185   VISU::PIDMapper myIDMapper;
186   VISU_PipeLine* myPipeLine;
187 };
188
189 #endif