Warning, file /include/opencascade/MeshVS_SymmetricPairHasher.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _MeshVS_SymmetricPairHasher_HeaderFile
0015 #define _MeshVS_SymmetricPairHasher_HeaderFile
0016
0017 #include <Standard_Type.hxx>
0018 #include <Standard_HashUtils.hxx>
0019
0020 typedef std::pair<Standard_Integer, Standard_Integer> MeshVS_NodePair;
0021
0022
0023 struct MeshVS_SymmetricPairHasher
0024 {
0025
0026
0027
0028 size_t operator()(const MeshVS_NodePair& theNodePair) const noexcept
0029 {
0030
0031 int aCombination[2]{ theNodePair.first, theNodePair.second };
0032 if (aCombination[0] > aCombination[1])
0033 {
0034 std::swap(aCombination[0], aCombination[1]);
0035 }
0036 return opencascade::hashBytes(aCombination, sizeof(aCombination));
0037 }
0038
0039 bool operator()(const MeshVS_NodePair& thePair1, const MeshVS_NodePair& thePair2) const noexcept
0040 {
0041 return (thePair1.first == thePair2.first && thePair1.second == thePair2.second)
0042 || (thePair1.first == thePair2.second && thePair1.second == thePair2.first);
0043 }
0044 };
0045
0046 #endif