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