File indexing completed on 2026-09-25 09:20:35
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 int First, Second;
0027
0028 MeshVS_TwoNodes(int aFirst = 0, int aSecond = 0)
0029 : First(aFirst),
0030 Second(aSecond)
0031 {
0032 }
0033
0034 bool operator==(const MeshVS_TwoNodes& theTwoNode) const
0035 {
0036 return ((First == theTwoNode.First) && (Second == theTwoNode.Second))
0037 || ((First == theTwoNode.Second) && (Second == theTwoNode.First));
0038 }
0039 };
0040
0041 namespace std
0042 {
0043 template <>
0044 struct hash<MeshVS_TwoNodes>
0045 {
0046 size_t operator()(const MeshVS_TwoNodes& theTwoNodes) const noexcept
0047 {
0048
0049 int aCombination[2]{theTwoNodes.First, theTwoNodes.Second};
0050 if (aCombination[0] > aCombination[1])
0051 {
0052 std::swap(aCombination[0], aCombination[1]);
0053 }
0054 return opencascade::hashBytes(aCombination, sizeof(aCombination));
0055 }
0056 };
0057 }
0058
0059 #endif