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