From a995efbe76a2e39e82acaf74f2b008a359f00344 Mon Sep 17 00:00:00 2001 From: CalligaroV Date: Fri, 29 Mar 2024 13:44:12 +0100 Subject: [PATCH] Part/Toponaming: WireJoiner - use std::hash with OCC_VERSION_HEX >= 0x070800 * Added precompiler directive to use std::hash instead of HashCode(INT_MAX) if OCC_VERSION_HEX >= 0x070800 Signed-off-by: CalligaroV --- src/Mod/Part/App/WireJoiner.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Mod/Part/App/WireJoiner.cpp b/src/Mod/Part/App/WireJoiner.cpp index 42cc2a38e5..0ec3d9a258 100644 --- a/src/Mod/Part/App/WireJoiner.cpp +++ b/src/Mod/Part/App/WireJoiner.cpp @@ -786,7 +786,11 @@ public: for (auto vit = vmap.qbegin(bgi::nearest(p1, INT_MAX)); vit != vmap.qend(); ++vit) { auto& vinfo = *vit; if (canShowShape()) { +#if OCC_VERSION_HEX < 0x070800 FC_MSG("addcheck " << vinfo.edge().HashCode(INT_MAX)); +#else + FC_MSG("addcheck " << std::hash {}(vinfo.edge())); +#endif } double d1 = vinfo.pt().SquareDistance(p1); if (d1 >= tol) { @@ -2712,7 +2716,12 @@ public: { FC_MSG("init:"); for (const auto& shape : sourceEdges) { +#if OCC_VERSION_HEX < 0x070800 FC_MSG(shape.getShape().TShape().get() << ", " << shape.getShape().HashCode(INT_MAX)); +#else + FC_MSG(shape.getShape().TShape().get() + << ", " << std::hash {}(shape.getShape())); +#endif } printHistory(aHistory, sourceEdges); printHistory(newHistory, inputEdges); @@ -2726,7 +2735,11 @@ public: FC_MSG("final:"); for (int i = 1; i <= wireData->NbEdges(); ++i) { auto shape = wireData->Edge(i); +#if OCC_VERSION_HEX < 0x070800 FC_MSG(shape.TShape().get() << ", " << shape.HashCode(INT_MAX)); +#else + FC_MSG(shape.TShape().get() << ", " << std::hash {}(shape)); +#endif } } @@ -2786,9 +2799,15 @@ public: { for (TopTools_ListIteratorOfListOfShape it(hist->Modified(shape.getShape())); it.More(); it.Next()) { +#if OCC_VERSION_HEX < 0x070800 FC_MSG(shape.getShape().TShape().get() << ", " << shape.getShape().HashCode(INT_MAX) << " -> " << it.Value().TShape().get() << ", " << it.Value().HashCode(INT_MAX)); +#else + FC_MSG(shape.getShape().TShape().get() + << ", " << std::hash {}(shape.getShape()) << " -> " + << it.Value().TShape().get() << ", " << std::hash {}(it.Value())); +#endif } }