From 19933f4ad553fd94df4ec87e9aec1be02db940ee Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 21 Feb 2024 16:12:31 +0000 Subject: [PATCH] Fix porting error --- src/SMESHDS/SMESHDS_Mesh.hxx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index 1753bccf6..9cdd7395e 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -61,10 +61,9 @@ class SMDS_BallElement; #include typedef std::list THypList; -#if OCC_VERSION_LARGE < 0x07080000 - struct SMESHDS_Hasher { +#if OCC_VERSION_LARGE < 0x07080000 static inline Standard_Boolean IsEqual(const TopoDS_Shape& S1, const TopoDS_Shape& S2) { @@ -75,14 +74,20 @@ struct SMESHDS_Hasher { return ::HashCode( S, Upper); } -}; -typedef NCollection_DataMap< TopoDS_Shape, THypList, SMESHDS_Hasher > ShapeToHypothesis; - #else - -typedef NCollection_DataMap< TopoDS_Shape, THypList > ShapeToHypothesis; - + bool operator()(const TopoDS_Shape& S1, const TopoDS_Shape& S2) const + { + // for the purpose of ShapeToHypothesis map we don't consider shapes orientation + return S1.IsSame(S2); + } + size_t operator()(const TopoDS_Shape& S) const + { + return std::hash{}(S); + } #endif +}; + +typedef NCollection_DataMap< TopoDS_Shape, THypList, SMESHDS_Hasher > ShapeToHypothesis; class SMESHDS_GroupBase; class DownIdType; -- 2.39.2