Salome HOME
Copyright update 2022
[modules/gui.git] / src / VTKViewer / VTKViewer_GeometryFilter.h
old mode 100755 (executable)
new mode 100644 (file)
index facb797..c86b59c
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  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
@@ -48,7 +48,7 @@ public:
   /*! \fn vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter)
    *  \brief VTK type revision macros.
    */
-  vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter);
+  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.
@@ -59,23 +59,20 @@ public:
    * \retval myShowInside
    */
   int GetInside();
-  /*! \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.
+  /*! \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 int SetAppendCoincident3D()
-   * \brief Return value of \a myAppendCoincident3D
-   * \retval myAppendCoincident3D
+  /*! \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
@@ -96,12 +93,12 @@ public:
    * \brief Return input value theVtkID
    * \retval theVtkID
    */
-  virtual vtkIdType GetNodeObjId(int theVtkID) { return theVtkID;}
+  virtual vtkIdType GetNodeObjId(vtkIdType 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 vtkIdType GetElemObjId(vtkIdType theVtkID);
 
   virtual void SetQuadraticArcMode(bool theFlag);
   virtual bool GetQuadraticArcMode() const;
@@ -110,11 +107,12 @@ public:
   virtual double GetQuadraticArcAngle() const;
 
   typedef std::vector<vtkIdType> TVectorId;
-  typedef std::map<vtkIdType, TVectorId> TMapOfVectorId;
+  //typedef std::map<vtkIdType, TVectorId> TMapOfVectorId;
+  typedef std::vector<TVectorId> TMapOfVectorId;
 
   static void InsertId( const vtkIdType theCellId,
                         const vtkIdType theCellType,
-                        TVectorId& theVTK2ObjIds,
+                        TVectorId& /*theVTK2ObjIds*/,
                         TMapOfVectorId& theDimension2VTK2ObjIds );
 
 protected:
@@ -127,12 +125,12 @@ protected:
    */
   ~VTKViewer_GeometryFilter();
 
-  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
 
   //special cases for performance
   
   /*! \fn void UnstructuredGridExecute();
-   * \brief Filter culculation method for data object type is VTK_UNSTRUCTURED_GRID.
+   * \brief Filter calculation method for data object type is VTK_UNSTRUCTURED_GRID.
    */
   int UnstructuredGridExecute (vtkDataSet *, vtkPolyData *, vtkInformation *);
 
@@ -142,6 +140,15 @@ protected:
                          vtkPolyData *output,
                          TMapOfVectorId& theDimension2VTK2ObjIds,
                          bool triangulate = false);
+
+  /*! \fn void FillVTK2ObjIds(vtkPolyData *output);
+   * \brief fill myVTK2ObjIds to get the correspondence between vtk ids (displayed edges and faces
+   * computed in vtkGeometryFilter::UnstructuredGridExecute) and original cell ids (mesh cells)
+   */
+  void FillVTK2ObjIds(vtkPolyData *output);
+
+  // Delegate VTKViewer_GeometryFilter::UnstructuredGridExecute to vtkGeometryFilter::UnstructuredGridExecute
+  bool delegateToVtk = false;
     
 private:
   TVectorId myVTK2ObjIds;
@@ -150,7 +157,7 @@ private:
   int       myIsWireframeMode;
   int       myAppendCoincident3D;
 
-  double    myMaxArcAngle;   // define max angle for mesh 2D quadratic element in the degrees
+  double    myMaxArcAngle;    // define max angle for mesh 2D quadratic element in the degrees
   bool      myIsBuildArc;     // flag for representation 2D quadratic element as arked polygon
 };