Salome HOME
300c5a948d516c5e4dbd5451f42a2e92ded3af35
[modules/gui.git] / src / VTKViewer / VTKViewer_GeometryFilter.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef VTKVIEWER_GEOMETRYFILTER_H
20 #define VTKVIEWER_GEOMETRYFILTER_H
21
22 #include "VTKViewer.h"
23
24 #include <vtkGeometryFilter.h>
25
26 #include <vector>
27
28 #ifdef WIN32
29 #pragma warning ( disable:4251 )
30 #endif
31
32 /*! \brief This class used same as vtkGeometryFilter. See documentation on VTK for more information.
33  */
34 class VTKVIEWER_EXPORT VTKViewer_GeometryFilter : public vtkGeometryFilter 
35 {
36 public:
37   /*! \fn static VTKViewer_GeometryFilter *New()
38    */
39   static VTKViewer_GeometryFilter *New();
40   
41   /*! \fn vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter)
42    *  \brief VTK type revision macros.
43    */
44   vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter);
45   /*! \fn void SetInside(int theShowInside)
46    * \brief Sets \a myShowInside flag. \a myShowInside is changed, call this->Modified().
47    * \param theShowInside - used for changing value of \a myShowInside variable.
48    */
49   void SetInside(int theShowInside);
50   /*! \fn int GetInside()
51    * \brief Return value of \a myShowInside
52    * \retval myShowInside
53    */
54   int GetInside();
55   /*! \fn void SetWireframeMode(int theIsWireframeMode)
56    * \brief Sets \a myIsWireframeMode flag. \a myIsWireframeMode is changed, call this->Modified().
57    * \param theIsWireframeMode - used for changing value of \a myIsWireframeMode variable.
58    */
59   void SetWireframeMode(int theIsWireframeMode);
60   /*! \fn int GetWireframeMode()
61    * \brief Return value of \a myIsWireframeMode
62    * \retval myIsWireframeMode
63    */
64   int GetWireframeMode();
65   /*! \fn void SetStoreMapping(int theStoreMapping);
66    * \brief Sets \a myStoreMapping flag and call this->Modified()
67    * \param theStoreMapping - used for changing value of \a myStoreMapping variable.
68    */
69   void SetStoreMapping(int theStoreMapping);
70   /*! \fn int GetStoreMapping()
71    * \brief Return value of \a myStoreMapping
72    * \retval myStoreMapping
73    */
74   int GetStoreMapping();
75   /*! \fn virtual vtkIdType GetNodeObjId(int theVtkID)
76    * \brief Return input value theVtkID
77    * \retval theVtkID
78    */
79   virtual vtkIdType GetNodeObjId(int theVtkID) { return theVtkID;}
80   /*! \fn virtual vtkIdType GetElemObjId(int theVtkID);
81    * \brief Return object ID by VTK ID cell 
82    * \retval myVTK2ObjIds[theVtkID]
83    */
84   virtual vtkIdType GetElemObjId(int theVtkID);
85
86 protected:
87   /*! \fn VTKViewer_GeometryFilter();
88    * \brief Constructor which sets \a myShowInside = 0 and \a myStoreMapping = 0
89    */
90   VTKViewer_GeometryFilter();
91   /*! \fn ~VTKViewer_GeometryFilter();
92    * \brief Destructor.
93    */
94   ~VTKViewer_GeometryFilter();
95
96   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
97
98   //special cases for performance
99   
100   /*! \fn void UnstructuredGridExecute();
101    * \brief Filter culculation method for data object type is VTK_UNSTRUCTURED_GRID.
102    */
103   int UnstructuredGridExecute (vtkDataSet *, vtkPolyData *, vtkInformation *);
104     
105 private:
106   typedef std::vector<vtkIdType> TVectorId;
107
108 private:
109   TVectorId myVTK2ObjIds;
110   int       myShowInside;
111   int       myStoreMapping;
112   int       myIsWireframeMode;
113 };
114
115 #ifdef WIN32
116 #pragma warning ( default:4251 )
117 #endif
118
119 #endif