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