Salome HOME
Second integration of PV3D viewer:
[modules/gui.git] / src / VTKViewer / VTKViewer_Actor.h
index 0b4b53cb7c3e859c3baefcc3a9f5064a931c6915..aa948f9f0f9955a3d991a0e9bfb356179bd84589 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <string>
 #include <vector>
+#include <limits>
+
+#include <NCollection_IndexedMap.hxx>
+#include <NCollection_Map.hxx>
 
 #include <vtkLODActor.h>
 #include <vtkProperty.h>
@@ -42,7 +46,7 @@ class vtkDataSet;
 class vtkCamera;
 class vtkProperty;
 class vtkRenderer;
-class vtkPassThroughFilter;
+class vtkPassThrough;
 
 class VTKViewer_Transform;
 class VTKViewer_GeometryFilter;
@@ -138,34 +142,34 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   // For selection mapping purpose
   //! Maps VTK index of a node to corresponding object index
   virtual
-  int 
-  GetNodeObjId(int theVtkID);
+  vtkIdType 
+  GetNodeObjId(vtkIdType theVtkID);
 
   //! Get coordinates of a node for given object index
   virtual
   double*
-  GetNodeCoord(int theObjID);
+  GetNodeCoord(vtkIdType theObjID);
 
   //! Maps object index of a node to corresponding VTK index
   virtual
-  int 
-  GetNodeVtkId(int theObjID);
+  vtkIdType 
+  GetNodeVtkId(vtkIdType theObjID);
 
   //! Maps VTK index of a cell to corresponding object index
   virtual 
-  int
-  GetElemObjId(int theVtkID);
+  vtkIdType
+  GetElemObjId(vtkIdType theVtkID);
 
   //! Get corresponding #vtkCell for given object index
   virtual
   vtkCell* 
-  GetElemCell(int theObjID);
+  GetElemCell(vtkIdType theObjID);
 
   //----------------------------------------------------------------------------
   //! Get dimension of corresponding mesh element
   virtual
   int
-  GetObjDimension( const int theObjId );
+  GetObjDimension( const vtkIdType theObjId );
 
   //! To insert some additional filters and then sets the given #vtkMapper
   virtual
@@ -377,7 +381,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   bool myStoreMapping;
   VTKViewer_GeometryFilter *myGeomFilter;
   VTKViewer_TransformFilter *myTransformFilter;
-  std::vector<vtkPassThroughFilter*> myPassFilter;
+  std::vector<vtkPassThrough*> myPassFilter;
 
   int myRepresentation;
   vtkProperty *myProperty;
@@ -394,6 +398,22 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   bool myIsHighlighted;
 };
 
+struct vtkIdHasher
+{
+  static int HashCode(const vtkIdType theValue,  const int theUpperBound)
+  {
+    return static_cast<int> ((theValue & (std::numeric_limits<vtkIdType>::max)()) % theUpperBound + 1);
+  }
+
+  static bool IsEqual( const vtkIdType& id1, const vtkIdType& id2 )
+  {
+    return id1 == id2;
+  }
+};
+
+typedef NCollection_Map< vtkIdType, vtkIdHasher > TVtkIDsMap;
+typedef NCollection_IndexedMap<vtkIdType,vtkIdHasher> TIndexedMapOfVtkId;
+
 #ifdef WIN32
 #pragma warning ( default:4251 )
 #endif