Salome HOME
Update from BR_V5_DEV 13Feb2009
[modules/gui.git] / src / VTKViewer / VTKViewer_GeometryFilter.h
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 #ifndef VTKVIEWER_GEOMETRYFILTER_H
23 #define VTKVIEWER_GEOMETRYFILTER_H
24
25 #include "VTKViewer.h"
26
27 #include <vtkGeometryFilter.h>
28
29 #include <vector>
30
31 #ifdef WIN32
32 #pragma warning ( disable:4251 )
33 #endif
34
35 /*! \brief This class used same as vtkGeometryFilter. See documentation on VTK for more information.
36  */
37 class VTKVIEWER_EXPORT VTKViewer_GeometryFilter : public vtkGeometryFilter 
38 {
39 public:
40   /*! \fn static VTKViewer_GeometryFilter *New()
41    */
42   static VTKViewer_GeometryFilter *New();
43   
44   /*! \fn vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter)
45    *  \brief VTK type revision macros.
46    */
47   vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter);
48   /*! \fn void SetInside(int theShowInside)
49    * \brief Sets \a myShowInside flag. \a myShowInside is changed, call this->Modified().
50    * \param theShowInside - used for changing value of \a myShowInside variable.
51    */
52   void SetInside(int theShowInside);
53   /*! \fn int GetInside()
54    * \brief Return value of \a myShowInside
55    * \retval myShowInside
56    */
57   int GetInside();
58   /*! \fn void SetWireframeMode(int theIsWireframeMode)
59    * \brief Sets \a myIsWireframeMode flag. \a myIsWireframeMode is changed, call this->Modified().
60    * \param theIsWireframeMode - used for changing value of \a myIsWireframeMode variable.
61    */
62   void SetWireframeMode(int theIsWireframeMode);
63   /*! \fn int GetWireframeMode()
64    * \brief Return value of \a myIsWireframeMode
65    * \retval myIsWireframeMode
66    */
67   int GetWireframeMode();
68   /*! \fn void SetStoreMapping(int theStoreMapping);
69    * \brief Sets \a myStoreMapping flag and call this->Modified()
70    * \param theStoreMapping - used for changing value of \a myStoreMapping variable.
71    */
72   void SetStoreMapping(int theStoreMapping);
73   /*! \fn int GetStoreMapping()
74    * \brief Return value of \a myStoreMapping
75    * \retval myStoreMapping
76    */
77   int GetStoreMapping();
78   /*! \fn virtual vtkIdType GetNodeObjId(int theVtkID)
79    * \brief Return input value theVtkID
80    * \retval theVtkID
81    */
82   virtual vtkIdType GetNodeObjId(int theVtkID) { return theVtkID;}
83   /*! \fn virtual vtkIdType GetElemObjId(int theVtkID);
84    * \brief Return object ID by VTK ID cell 
85    * \retval myVTK2ObjIds[theVtkID]
86    */
87   virtual vtkIdType GetElemObjId(int theVtkID);
88
89 protected:
90   /*! \fn VTKViewer_GeometryFilter();
91    * \brief Constructor which sets \a myShowInside = 0 and \a myStoreMapping = 0
92    */
93   VTKViewer_GeometryFilter();
94   /*! \fn ~VTKViewer_GeometryFilter();
95    * \brief Destructor.
96    */
97   ~VTKViewer_GeometryFilter();
98
99   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
100
101   //special cases for performance
102   
103   /*! \fn void UnstructuredGridExecute();
104    * \brief Filter culculation method for data object type is VTK_UNSTRUCTURED_GRID.
105    */
106   int UnstructuredGridExecute (vtkDataSet *, vtkPolyData *, vtkInformation *);
107     
108 private:
109   typedef std::vector<vtkIdType> TVectorId;
110
111 private:
112   TVectorId myVTK2ObjIds;
113   int       myShowInside;
114   int       myStoreMapping;
115   int       myIsWireframeMode;
116 };
117
118 #ifdef WIN32
119 #pragma warning ( default:4251 )
120 #endif
121
122 #endif