1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef VTKVIEWER_GEOMETRYFILTER_H
24 #define VTKVIEWER_GEOMETRYFILTER_H
26 #include "VTKViewer.h"
28 #include <vtkGeometryFilter.h>
34 #pragma warning ( disable:4251 )
37 class vtkUnstructuredGrid;
39 /*! \brief This class used same as vtkGeometryFilter. See documentation on VTK for more information.
41 class VTKVIEWER_EXPORT VTKViewer_GeometryFilter : public vtkGeometryFilter
44 /*! \fn static VTKViewer_GeometryFilter *New()
46 static VTKViewer_GeometryFilter *New();
48 /*! \fn vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter)
49 * \brief VTK type revision macros.
51 vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter);
52 /*! \fn void SetInside(int theShowInside)
53 * \brief Sets \a myShowInside flag. \a myShowInside is changed, call this->Modified().
54 * \param theShowInside - used for changing value of \a myShowInside variable.
56 void SetInside(int theShowInside);
57 /*! \fn int GetInside()
58 * \brief Return value of \a myShowInside
59 * \retval myShowInside
62 /*! \fn void SetWireframeMode(int theIsWireframeMode)
63 * \brief Sets \a myIsWireframeMode flag. \a myIsWireframeMode is changed, call this->Modified().
64 * \param theIsWireframeMode - used for changing value of \a myIsWireframeMode variable.
67 int GetAppendCoincident3D() const;
68 /*! \fn void SetAppendCoincident3D()
69 * \brief Sets \a myAppendCoincident3D flag. If this flag is true, filter append to the
70 result data set coincident 3D elements.
73 void SetAppendCoincident3D(int theFlag);
74 /*! \fn int SetAppendCoincident3D()
75 * \brief Return value of \a myAppendCoincident3D
76 * \retval myAppendCoincident3D
79 void SetWireframeMode(int theIsWireframeMode);
80 /*! \fn int GetWireframeMode()
81 * \brief Return value of \a myIsWireframeMode
82 * \retval myIsWireframeMode
84 int GetWireframeMode();
85 /*! \fn void SetStoreMapping(int theStoreMapping);
86 * \brief Sets \a myStoreMapping flag and call this->Modified()
87 * \param theStoreMapping - used for changing value of \a myStoreMapping variable.
89 void SetStoreMapping(int theStoreMapping);
90 /*! \fn int GetStoreMapping()
91 * \brief Return value of \a myStoreMapping
92 * \retval myStoreMapping
94 int GetStoreMapping();
95 /*! \fn virtual vtkIdType GetNodeObjId(int theVtkID)
96 * \brief Return input value theVtkID
99 virtual vtkIdType GetNodeObjId(int theVtkID) { return theVtkID;}
100 /*! \fn virtual vtkIdType GetElemObjId(int theVtkID);
101 * \brief Return object ID by VTK ID cell
102 * \retval myVTK2ObjIds[theVtkID]
104 virtual vtkIdType GetElemObjId(int theVtkID);
106 virtual void SetQuadraticArcMode(bool theFlag);
107 virtual bool GetQuadraticArcMode() const;
109 virtual void SetQuadraticArcAngle(double theMaxAngle);
110 virtual double GetQuadraticArcAngle() const;
112 typedef std::vector<vtkIdType> TVectorId;
113 typedef std::map<vtkIdType, TVectorId> TMapOfVectorId;
115 static void InsertId( const vtkIdType theCellId,
116 const vtkIdType theCellType,
117 TVectorId& theVTK2ObjIds,
118 TMapOfVectorId& theDimension2VTK2ObjIds );
121 /*! \fn VTKViewer_GeometryFilter();
122 * \brief Constructor which sets \a myShowInside = 0 and \a myStoreMapping = 0
124 VTKViewer_GeometryFilter();
125 /*! \fn ~VTKViewer_GeometryFilter();
128 ~VTKViewer_GeometryFilter();
130 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
132 //special cases for performance
134 /*! \fn void UnstructuredGridExecute();
135 * \brief Filter culculation method for data object type is VTK_UNSTRUCTURED_GRID.
137 int UnstructuredGridExecute (vtkDataSet *, vtkPolyData *, vtkInformation *);
140 void BuildArcedPolygon(vtkIdType cellId,
141 vtkUnstructuredGrid* input,
143 TMapOfVectorId& theDimension2VTK2ObjIds,
144 bool triangulate = false);
147 TVectorId myVTK2ObjIds;
150 int myIsWireframeMode;
151 int myAppendCoincident3D;
153 double myMaxArcAngle; // define max angle for mesh 2D quadratic element in the degrees
154 bool myIsBuildArc; // flag for representation 2D quadratic element as arked polygon
158 #pragma warning ( default:4251 )