X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FVTKViewer%2FVTKViewer_GeometryFilter.h;h=e2420fef3748b9beac9a25c3b1664ddee1bd7e88;hb=refs%2Fheads%2Fngr%2Fpython3_dev_pv5.4;hp=cb1f44355a22ee20d2d83e8e6e06f4ad85060d71;hpb=2e750f9ded92337bc3c44e9d7388180974cc4a43;p=modules%2Fgui.git diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.h b/src/VTKViewer/VTKViewer_GeometryFilter.h index cb1f44355..e2420fef3 100755 --- a/src/VTKViewer/VTKViewer_GeometryFilter.h +++ b/src/VTKViewer/VTKViewer_GeometryFilter.h @@ -1,3 +1,25 @@ +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + #ifndef VTKVIEWER_GEOMETRYFILTER_H #define VTKVIEWER_GEOMETRYFILTER_H @@ -5,36 +27,133 @@ #include +#include #include +#ifdef WIN32 +#pragma warning ( disable:4251 ) +#endif + +class vtkUnstructuredGrid; + +/*! \brief This class used same as vtkGeometryFilter. See documentation on VTK for more information. + */ class VTKVIEWER_EXPORT VTKViewer_GeometryFilter : public vtkGeometryFilter { public: + /*! \fn static VTKViewer_GeometryFilter *New() + */ static VTKViewer_GeometryFilter *New(); - vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter); + + /*! \fn vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter) + * \brief VTK type revision macros. + */ + vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter); + /*! \fn void SetInside(int theShowInside) + * \brief Sets \a myShowInside flag. \a myShowInside is changed, call this->Modified(). + * \param theShowInside - used for changing value of \a myShowInside variable. + */ void SetInside(int theShowInside); + /*! \fn int GetInside() + * \brief Return value of \a myShowInside + * \retval myShowInside + */ int GetInside(); - + /*! \fn int GetAppendCoincident3D() + * \brief Return value of \a myAppendCoincident3D + * \retval myAppendCoincident3D + */ + int GetAppendCoincident3D() const; + /*! \fn void SetAppendCoincident3D() + * \brief Sets \a myAppendCoincident3D flag. If this flag is true, filter append to the + result data set coincident 3D elements. + */ + void SetAppendCoincident3D(int theFlag); + /*! \fn void SetWireframeMode(int theIsWireframeMode) + * \brief Sets \a myIsWireframeMode flag. \a myIsWireframeMode is changed, call this->Modified(). + * \param theIsWireframeMode - used for changing value of \a myIsWireframeMode variable. + */ + void SetWireframeMode(int theIsWireframeMode); + /*! \fn int GetWireframeMode() + * \brief Return value of \a myIsWireframeMode + * \retval myIsWireframeMode + */ + int GetWireframeMode(); + /*! \fn void SetStoreMapping(int theStoreMapping); + * \brief Sets \a myStoreMapping flag and call this->Modified() + * \param theStoreMapping - used for changing value of \a myStoreMapping variable. + */ void SetStoreMapping(int theStoreMapping); - int GetStoreMapping(){ return myStoreMapping;} - + /*! \fn int GetStoreMapping() + * \brief Return value of \a myStoreMapping + * \retval myStoreMapping + */ + int GetStoreMapping(); + /*! \fn virtual vtkIdType GetNodeObjId(int theVtkID) + * \brief Return input value theVtkID + * \retval theVtkID + */ virtual vtkIdType GetNodeObjId(int theVtkID) { return theVtkID;} + /*! \fn virtual vtkIdType GetElemObjId(int theVtkID); + * \brief Return object ID by VTK ID cell + * \retval myVTK2ObjIds[theVtkID] + */ virtual vtkIdType GetElemObjId(int theVtkID); + virtual void SetQuadraticArcMode(bool theFlag); + virtual bool GetQuadraticArcMode() const; + + virtual void SetQuadraticArcAngle(double theMaxAngle); + virtual double GetQuadraticArcAngle() const; + + typedef std::vector TVectorId; + //typedef std::map TMapOfVectorId; + typedef std::vector TMapOfVectorId; + + static void InsertId( const vtkIdType theCellId, + const vtkIdType theCellType, + TVectorId& theVTK2ObjIds, + TMapOfVectorId& theDimension2VTK2ObjIds ); + protected: + /*! \fn VTKViewer_GeometryFilter(); + * \brief Constructor which sets \a myShowInside = 0 and \a myStoreMapping = 0 + */ VTKViewer_GeometryFilter(); + /*! \fn ~VTKViewer_GeometryFilter(); + * \brief Destructor. + */ ~VTKViewer_GeometryFilter(); + + virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); + + //special cases for performance - void Execute(); - void UnstructuredGridExecute(); - -private: - typedef std::vector TVectorId; + /*! \fn void UnstructuredGridExecute(); + * \brief Filter culculation method for data object type is VTK_UNSTRUCTURED_GRID. + */ + int UnstructuredGridExecute (vtkDataSet *, vtkPolyData *, vtkInformation *); + + void BuildArcedPolygon(vtkIdType cellId, + vtkUnstructuredGrid* input, + vtkPolyData *output, + TMapOfVectorId& theDimension2VTK2ObjIds, + bool triangulate = false); + private: TVectorId myVTK2ObjIds; int myShowInside; int myStoreMapping; + int myIsWireframeMode; + int myAppendCoincident3D; + + double myMaxArcAngle; // define max angle for mesh 2D quadratic element in the degrees + bool myIsBuildArc; // flag for representation 2D quadratic element as arked polygon }; +#ifdef WIN32 +#pragma warning ( default:4251 ) +#endif + #endif