Salome HOME
Updated copyright comment
[modules/gui.git] / src / VTKViewer / VTKViewer_ConvexTool.h
index 2bf024d5e0fc1d1a7bd86b948ab215259e59e2dd..c418ca6d36419db312f13f4bc3cd753532e08f86 100644 (file)
@@ -1,20 +1,22 @@
-//  Copyright (C) 2003  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. 
-// 
-//  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 
-// 
+// Copyright (C) 2007-2024  CEA, EDF, 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
 //
 
@@ -23,6 +25,7 @@
 
 #include "VTKViewer.h"
 
+#include <map>
 #include <vector>
 
 #include <vtkSystemIncludes.h>
@@ -36,7 +39,12 @@ class vtkCellData;
 class vtkPoints;
 class vtkIdList;
 class vtkCell;
+class vtkCellArray;
+class vtkTriangle;
+class vtkOrderedTriangulator;
 
+
+//----------------------------------------------------------------------------
 class VTKVIEWER_EXPORT VTKViewer_Triangulator
 {
  public:
@@ -46,62 +54,61 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator
 
   bool 
   Execute(vtkUnstructuredGrid *theInput,
-         vtkCellData* thInputCD,
-         vtkIdType theCellId,
-         int theShowInside,
-         int theAllVisible,
-         const char* theCellsVisibility,
-         vtkPolyData *theOutput,
-         vtkCellData* theOutputCD,
-         int theStoreMapping,
-         std::vector<vtkIdType>& theVTK2ObjIds,
-         bool theIsCheckConvex);
-
- protected:
+          vtkCellData* thInputCD,
+          vtkIdType theCellId,
+          int theShowInside,
+          int theAllVisible,
+          int theAppendCoincident3D,
+          const char* theCellsVisibility,
+          vtkPolyData *theOutput,
+          vtkCellData* theOutputCD,
+          int theStoreMapping,
+          std::vector<vtkIdType>& theVTK2ObjIds,
+          std::vector< std::vector<vtkIdType> >& theDimension2VTK2ObjIds,
+          bool theIsCheckConvex);
+
+ private:
   vtkIdList* myCellIds;
 
-  vtkUnstructuredGrid *myInput;
-  vtkIdType myCellId;
-  int myShowInside;
-  int myAllVisible;
-  const char* myCellsVisibility;
+ protected:
+  vtkIdType *myPointIds;
+  vtkIdList* myFaceIds;
+  vtkPoints* myPoints;
 
   virtual
   vtkPoints* 
-  InitPoints() = 0;
+  InitPoints(vtkUnstructuredGrid *theInput,
+             vtkIdType theCellId);
 
   virtual
   vtkIdType 
-  GetNbOfPoints() = 0;
+  GetNumFaces() = 0;
 
   virtual
-  vtkIdType 
-  GetPointId(vtkIdType thePointId) = 0;
+  vtkCell* 
+  GetFace(vtkIdType theFaceId) = 0;
 
-  virtual
-  vtkFloatingPointType 
-  GetCellLength() = 0;
+  vtkIdType 
+  GetNbOfPoints();
 
-  virtual
   vtkIdType 
-  GetNumFaces() = 0;
+  GetPointId(vtkIdType thePointId);
 
-  virtual
-  vtkCell* 
-  GetFace(vtkIdType theFaceId) = 0;
+  double 
+  GetCellLength();
 
-  virtual
   void 
-  GetCellNeighbors(vtkIdType theCellId,
-                  vtkCell* theFace,
-                  vtkIdList* theCellIds) = 0;
+  GetCellNeighbors(vtkUnstructuredGrid *theInput,
+                   vtkIdType theCellId,
+                   vtkCell* theFace,
+                   vtkIdList* theCellIds);
 
-  virtual
   vtkIdType 
-  GetConnectivity(vtkIdType thePntId) = 0;
+  GetConnectivity(vtkIdType thePntId);
 };
 
 
+//----------------------------------------------------------------------------
 class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangulator
 {
  public:
@@ -111,22 +118,14 @@ class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangul
   ~VTKViewer_OrderedTriangulator();
 
  protected:
-  vtkGenericCell *myCell;
+  vtkOrderedTriangulator *myTriangulator;
+  vtkCellArray *myBoundaryTris;
+  vtkTriangle  *myTriangle;
 
   virtual
   vtkPoints* 
-  InitPoints();
-
-  virtual
-  vtkIdType 
-  GetNbOfPoints();
-
-  vtkIdType 
-  GetPointId(vtkIdType thePointId);
-
-  virtual
-  vtkFloatingPointType 
-  GetCellLength();
+  InitPoints(vtkUnstructuredGrid *theInput,
+             vtkIdType theCellId);
 
   virtual
   vtkIdType 
@@ -135,19 +134,10 @@ class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangul
   virtual
   vtkCell* 
   GetFace(vtkIdType theFaceId);
-
-  virtual
-  void 
-  GetCellNeighbors(vtkIdType theCellId,
-                  vtkCell* theFace,
-                  vtkIdList* theCellIds);
-
-  virtual
-  vtkIdType 
-  GetConnectivity(vtkIdType thePntId);
 };
 
 
+//----------------------------------------------------------------------------
 class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangulator
 {
  public:
@@ -161,24 +151,11 @@ class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangu
   vtkGeometryFilter* myGeometryFilter;
   vtkDelaunay3D* myDelaunay3D;
   vtkPolyData* myPolyData;
-  vtkIdType *myPointIds;
-  vtkIdList* myFaceIds;
-  vtkPoints* myPoints;
 
   virtual
   vtkPoints* 
-  InitPoints();
-
-  virtual
-  vtkIdType 
-  GetNbOfPoints();
-
-  vtkIdType 
-  GetPointId(vtkIdType thePointId);
-
-  virtual
-  vtkFloatingPointType 
-  GetCellLength();
+  InitPoints(vtkUnstructuredGrid *theInput,
+             vtkIdType theCellId);
 
   virtual
   vtkIdType 
@@ -187,16 +164,6 @@ class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangu
   virtual
   vtkCell* 
   GetFace(vtkIdType theFaceId);
-
-  virtual
-  void 
-  GetCellNeighbors(vtkIdType theCellId,
-                  vtkCell* theFace,
-                  vtkIdList* theCellIds);
-
-  virtual
-  vtkIdType 
-  GetConnectivity(vtkIdType thePntId);
 };