File indexing completed on 2025-01-18 10:04:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef MeshVS_TwoNodes_HeaderFile
0015 #define MeshVS_TwoNodes_HeaderFile
0016
0017 #include <Standard.hxx>
0018 #include <Standard_Macro.hxx>
0019 #include <Standard_HashUtils.hxx>
0020
0021
0022
0023
0024 struct MeshVS_TwoNodes
0025 {
0026 Standard_Integer First, Second;
0027
0028 MeshVS_TwoNodes (Standard_Integer aFirst=0, Standard_Integer aSecond=0)
0029 : First(aFirst), Second(aSecond) {}
0030
0031 bool operator==(const MeshVS_TwoNodes& theTwoNode) const
0032 {
0033 return ((First == theTwoNode.First) && (Second == theTwoNode.Second)) ||
0034 ((First == theTwoNode.Second) && (Second == theTwoNode.First));
0035 }
0036 };
0037
0038 namespace std
0039 {
0040 template<>
0041 struct hash<MeshVS_TwoNodes>
0042 {
0043 size_t operator()(const MeshVS_TwoNodes& theTwoNodes) const noexcept
0044 {
0045
0046 int aCombination[2]{ theTwoNodes.First, theTwoNodes.Second };
0047 if (aCombination[0] > aCombination[1])
0048 {
0049 std::swap(aCombination[0], aCombination[1]);
0050 }
0051 return opencascade::hashBytes(aCombination, sizeof(aCombination));
0052 }
0053 };
0054 }
0055
0056 #endif