]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOMAlgo/GEOMAlgo_PassKey.hxx
Salome HOME
[GITHUB #1] updated TUI command doc for make sphere from point and radius
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_PassKey.hxx
index 87fba9a405c48c10ccc9bdea83e2a2e0e0fb35ef..bb5185689ac5bbbfdf671f5b9f2505e6b28c56bc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  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
@@ -6,7 +6,7 @@
 // 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.
+// 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
 #ifndef _GEOMAlgo_PassKey_HeaderFile
 #define _GEOMAlgo_PassKey_HeaderFile
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <Standard.hxx>
 #include <Standard_Macro.hxx>
 #include <Standard_Integer.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
 #include <Standard_Boolean.hxx>
+
 #include <TColStd_ListOfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
 
 //=======================================================================
 //class : GEOMAlgo_PassKey
@@ -87,8 +90,19 @@ class GEOMAlgo_PassKey  {
   Standard_EXPORT
     Standard_Boolean IsEqual(const GEOMAlgo_PassKey& aOther) const;
 
+#if OCC_VERSION_LARGE < 0x07080000
   Standard_EXPORT
     Standard_Integer HashCode(const Standard_Integer Upper) const;
+#endif
+
+  Standard_EXPORT
+  bool operator==(const GEOMAlgo_PassKey& theOther) const
+  {
+    return IsEqual(theOther);
+  }
+
+  Standard_EXPORT
+  size_t GetSum() const { return (size_t)mySum; }
 
   Standard_EXPORT
     Standard_Integer Id(const Standard_Integer aIndex) const;
@@ -101,4 +115,16 @@ class GEOMAlgo_PassKey  {
   Standard_Integer mySum;
   TColStd_IndexedMapOfInteger myMap;
 };
+
+namespace std
+{
+  template <>
+  struct hash<GEOMAlgo_PassKey>
+  {
+    size_t operator()(const GEOMAlgo_PassKey& thePK) const noexcept
+    {
+      return thePK.GetSum();
+    }
+  };
+}
 #endif