31 #include <NCollection_IndexedMap.hxx>
32 #include <NCollection_Map.hxx>
33 #include <Standard_Integer.hxx>
37 #include <Basics_OCCTVersion.hxx>
42 #if OCC_VERSION_LARGE < 0x07080000
46 static Standard_Integer
HashCode(
const std::vector<Standard_Integer> ids,
47 const Standard_Integer upper)
49 Standard_Integer seed = (Standard_Integer)ids.size();
50 for ( Standard_Integer v : ids )
51 seed ^= v + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 );
53 return ::HashCode(seed,upper);
59 return theKey1 == theKey2;
66 static vtkIdType
HashCode(
const std::vector<vtkIdType> ids,
67 const Standard_Integer upper)
69 vtkIdType seed = (vtkIdType)ids.size();
70 for ( vtkIdType v : ids )
71 seed ^= v + 0x9e3779b97f4a7c15 + ( seed << 6 ) + ( seed >> 2 );
73 return ::HashCode((Standard_Integer) seed, upper);
79 return theKey1 == theKey2;
85 static int HashCode(
const vtkIdType theValue,
const int theUpperBound)
87 return static_cast<int> ((theValue & (std::numeric_limits<vtkIdType>::max)()) % theUpperBound + 1);
90 static bool IsEqual(
const vtkIdType& id1,
const vtkIdType& id2 )
101 size_t operator()(
const std::vector<Standard_Integer> ids)
const
103 Standard_Integer seed = (Standard_Integer)ids.size();
104 for ( Standard_Integer v : ids )
105 seed ^= v + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 );
106 return (
size_t)(seed & IntegerLast());
112 return theKey1 == theKey2;
119 size_t operator()(
const std::vector<vtkIdType> ids)
const
121 vtkIdType seed = (vtkIdType)ids.size();
122 for ( vtkIdType v : ids )
123 seed ^= v + 0x9e3779b97f4a7c15 + ( seed << 6 ) + ( seed >> 2 );
124 return (
size_t)(seed & (std::numeric_limits<vtkIdType>::max)());
130 return theKey1 == theKey2;
136 size_t operator()(
const vtkIdType theValue)
const
138 return (
size_t)(theValue & (std::numeric_limits<vtkIdType>::max)());
141 bool operator()(
const vtkIdType& id1,
const vtkIdType& id2)
const
NCollection_Map< vtkIdType, svtkIdHasher > SVTK_TVtkIDsMap
Definition: SVTK_Hash.h:151
NCollection_IndexedMap< SVTK_ListOfVtk, SVTK_vtkHasher > SVTK_IndexedMapOfVtkIds
Definition: SVTK_Hash.h:150
std::vector< vtkIdType > SVTK_ListOfVtk
Definition: SVTK_Hash.h:40
std::vector< Standard_Integer > SVTK_ListOfInteger
Definition: SVTK_Hash.h:39
NCollection_Map< vtkIdType, svtkIdHasher >::Iterator SVTK_TVtkIDsMapIterator
Definition: SVTK_Hash.h:152
NCollection_IndexedMap< vtkIdType, svtkIdHasher > SVTK_TIndexedMapOfVtkId
Definition: SVTK_Hash.h:153
NCollection_IndexedMap< SVTK_ListOfInteger, SVTK_Hasher > SVTK_IndexedMapOfIds
Definition: SVTK_Hash.h:149
Definition: SVTK_Hash.h:43
static Standard_Integer HashCode(const std::vector< Standard_Integer > ids, const Standard_Integer upper)
Definition: SVTK_Hash.h:46
static Standard_Boolean IsEqual(const SVTK_ListOfInteger &theKey1, const SVTK_ListOfInteger &theKey2)
Definition: SVTK_Hash.h:56
Definition: SVTK_Hash.h:63
static vtkIdType HashCode(const std::vector< vtkIdType > ids, const Standard_Integer upper)
Definition: SVTK_Hash.h:66
static vtkIdType IsEqual(const SVTK_ListOfVtk &theKey1, const SVTK_ListOfVtk &theKey2)
Definition: SVTK_Hash.h:76
Definition: SVTK_Hash.h:84
static bool IsEqual(const vtkIdType &id1, const vtkIdType &id2)
Definition: SVTK_Hash.h:90
static int HashCode(const vtkIdType theValue, const int theUpperBound)
Definition: SVTK_Hash.h:85