Salome HOME
0021711: [CEA 579] Simplify Properties dialog accordingly to dimension of mesh
[modules/visu.git] / src / PIPELINE / VISU_PolyDataMapperHolder.hxx
1 // Copyright (C) 2007-2012  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_PolyDataMapperHolder.hxx
25 // Author:  Alexey PETROV
26 // Module : VISU
27 //
28 #ifndef VISU_PolyDataMapperHolder_HeaderFile
29 #define VISU_PolyDataMapperHolder_HeaderFile
30
31 #include "VISU_MapperHolder.hxx"
32
33 class vtkPolyDataMapper;
34 class vtkPolyData;
35 class SALOME_ExtractPolyDataGeometry;
36
37
38 //----------------------------------------------------------------------------
39 class VISU_PolyDataMapperHolder : public VISU_MapperHolder
40 {
41 public:
42   vtkTypeMacro(VISU_PolyDataMapperHolder, VISU_MapperHolder);
43
44   static 
45   VISU_PolyDataMapperHolder* 
46   New();
47
48   //----------------------------------------------------------------------------
49   virtual
50   void
51   ShallowCopy(VISU_MapperHolder *theMapperHolder,
52               bool theIsCopyInput);
53
54   //! Gets memory size used by the instance (bytes).
55   virtual
56   unsigned long int
57   GetMemorySize();
58
59   //----------------------------------------------------------------------------
60   void 
61   SetPolyDataIDMapper(const VISU::PPolyDataIDMapper& theIDMapper);
62
63   const VISU::PPolyDataIDMapper&
64   GetPolyDataIDMapper();
65
66   virtual
67   vtkPolyData* 
68   GetPolyDataInput();
69
70   virtual 
71   vtkPolyDataMapper* 
72   GetPolyDataMapper();
73
74   //----------------------------------------------------------------------------
75   virtual
76   vtkIdType
77   GetNodeObjID(vtkIdType theID);
78
79   virtual
80   vtkIdType
81   GetNodeVTKID(vtkIdType theID);
82
83   virtual
84   vtkFloatingPointType* 
85   GetNodeCoord(vtkIdType theObjID);
86
87   virtual
88   vtkIdType
89   GetElemObjID(vtkIdType theID);
90
91   virtual
92   vtkIdType
93   GetElemVTKID(vtkIdType theID);
94
95   virtual
96   vtkCell*
97   GetElemCell(vtkIdType theObjID);
98
99   //----------------------------------------------------------------------------
100   virtual
101   void
102   SetImplicitFunction(vtkImplicitFunction *theFunction);
103
104   virtual
105   vtkImplicitFunction* 
106   GetImplicitFunction();
107
108   virtual
109   void
110   SetExtractInside(bool theMode);
111
112   virtual
113   void
114   SetExtractBoundaryCells(bool theMode);
115
116   //----------------------------------------------------------------------------
117   // Clipping planes
118   virtual
119   void 
120   RemoveAllClippingPlanes();
121
122   virtual
123   vtkIdType
124   GetNumberOfClippingPlanes();
125
126   virtual
127   bool
128   AddClippingPlane(vtkPlane* thePlane);
129
130   virtual
131   vtkPlane* 
132   GetClippingPlane(vtkIdType theID);
133   
134   void RemoveClippingPlane(vtkIdType theID);
135
136 protected:
137   //----------------------------------------------------------------------------
138   VISU_PolyDataMapperHolder();
139   VISU_PolyDataMapperHolder(const VISU_PolyDataMapperHolder&);
140
141   virtual
142   ~VISU_PolyDataMapperHolder();
143
144   //----------------------------------------------------------------------------
145   virtual
146   void
147   OnCreateMapper();
148
149   void 
150   SetPolyDataMapper(vtkPolyDataMapper* theMapper);
151
152   //----------------------------------------------------------------------------
153   virtual
154   void
155   SetLookupTable(VISU_LookupTable* theLookupTable);
156
157   virtual
158   vtkPointSet* 
159   GetClippedInput();
160
161 private:
162   //----------------------------------------------------------------------------
163   VISU::PPolyDataIDMapper myPolyDataIDMapper;
164   vtkSmartPointer<vtkPolyDataMapper> myPolyDataMapper;
165
166 protected:
167   vtkSmartPointer<SALOME_ExtractPolyDataGeometry> myExtractPolyDataGeometry; //!< Clipping
168 };
169
170 #endif