Fix compilation with opencascase 7.8.0 Base on https://github.com/FreeCAD/FreeCAD/pull/11909 diff --color -rupN a/cMake/FindOCC.cmake b/cMake/FindOCC.cmake --- a/cMake/FindOCC.cmake 2022-12-07 03:35:37.000000000 +0100 +++ b/cMake/FindOCC.cmake 2024-02-27 15:00:48.248873883 +0100 @@ -127,8 +127,6 @@ if(OCC_FOUND) TKG2d TKG3d TKMath - TKIGES - TKSTL TKShHealing TKXSBase TKBool @@ -139,10 +137,6 @@ if(OCC_FOUND) TKGeomBase TKOffset TKPrim - TKSTEPBase - TKSTEPAttr - TKSTEP209 - TKSTEP TKHLR TKFeat ) @@ -154,17 +148,19 @@ if(OCC_FOUND) TKLCAF TKVCAF TKCDF - TKXDESTEP - TKXDEIGES TKMeshVS TKService TKV3d ) - if(OCC_VERSION_STRING VERSION_LESS 6.7.3) - list(APPEND OCC_OCAF_LIBRARIES TKAdvTools) - elseif(NOT OCC_VERSION_STRING VERSION_LESS 7.5.0) + if(NOT OCC_VERSION_STRING VERSION_LESS 7.5.0) list(APPEND OCC_OCAF_LIBRARIES TKRWMesh) - endif(OCC_VERSION_STRING VERSION_LESS 6.7.3) + endif(NOT OCC_VERSION_STRING VERSION_LESS 7.5.0) + if(OCC_VERSION_STRING VERSION_LESS 7.8.0) + list(APPEND OCC_LIBRARIES TKIGES TKSTL TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP) + list(APPEND OCC_OCAF_LIBRARIES TKXDESTEP TKXDEIGES) + else(OCC_VERSION_STRING VERSION_LESS 7.8.0) + list(APPEND OCC_LIBRARIES TKDESTEP TKDEIGES TKDEGLTF TKDESTL) + endif(OCC_VERSION_STRING VERSION_LESS 7.8.0) message(STATUS "-- Found OCE/OpenCASCADE version: ${OCC_VERSION_STRING}") message(STATUS "-- OCE/OpenCASCADE include directory: ${OCC_INCLUDE_DIR}") message(STATUS "-- OCE/OpenCASCADE shared libraries directory: ${OCC_LIBRARY_DIR}") diff --color -rupN a/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx b/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx --- a/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx 2022-12-07 03:35:37.000000000 +0100 +++ b/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx 2024-02-27 15:00:48.248873883 +0100 @@ -29,22 +29,35 @@ #include +#include + /* * This method needed for instance NCollection_DataMap with TopoDS_Shape as key */ +#if OCC_VERSION_HEX >= 0x070800 struct SMESHDS_Hasher { - static inline Standard_Boolean IsEqual(const TopoDS_Shape& S1, - const TopoDS_Shape& S2) - { - return S1.IsSame(S2); + size_t operator()(const TopoDS_Shape& S) const noexcept { + return std::hash{}(S); } - static inline Standard_Integer HashCode(const TopoDS_Shape& S, - const Standard_Integer Upper) - { - return ::HashCode( S, Upper); + size_t operator()(const TopoDS_Shape& S1, const TopoDS_Shape& S2) const noexcept { + return S1.IsSame(S2); } }; - +#else +struct SMESHDS_Hasher +{ +static inline Standard_Boolean IsEqual(const TopoDS_Shape& S1, + const TopoDS_Shape& S2) +{ + return S1.IsSame(S2); +} +static inline Standard_Integer HashCode(const TopoDS_Shape& S, + const Standard_Integer Upper) +{ + return ::HashCode( S, Upper); +} +}; +#endif #endif diff --color -rupN a/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx b/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx --- a/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx 2022-12-07 03:35:37.000000000 +0100 +++ b/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx 2024-02-27 15:00:48.248873883 +0100 @@ -57,9 +57,6 @@ #ifndef _MeshVS_EntityType_HeaderFile #include #endif -#ifndef _Standard_Address_HeaderFile -#include -#endif #ifndef _TColStd_HArray1OfInteger_HeaderFile #include #endif diff --color -rupN a/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx b/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx --- a/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx 2022-12-07 03:35:37.000000000 +0100 +++ b/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx 2024-02-27 15:00:48.248873883 +0100 @@ -37,4 +37,5 @@ #define SMESH_EXPORT #endif +#include #endif diff --color -rupN a/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx b/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx --- a/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx 2022-12-07 03:35:37.000000000 +0100 +++ b/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx 2024-02-27 15:00:48.252207183 +0100 @@ -28,10 +28,11 @@ #include "SMESH_SMESH.hxx" -#include #if OCC_VERSION_HEX >= 0x060703 #include #include +#else +#include #endif typedef const SMDS_MeshNode* SMDS_MeshNodePtr; diff --color -rupN a/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx b/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx --- a/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx 2022-12-07 03:35:37.000000000 +0100 +++ b/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx 2024-02-27 15:00:48.252207183 +0100 @@ -185,11 +185,18 @@ typedef std::vector< UVPtStruct > UVPtSt // -------------------------------------------------------------------------------- // class SMESH_SequenceOfElemPtr +#include +#if OCC_VERSION_HEX >= 0x060703 +#include +#else #include +#endif class SMDS_MeshElement; typedef const SMDS_MeshElement* SMDS_MeshElementPtr; +#define DEFINE_SEQUENCE(_ClassName_, _BaseCollection_, TheItemType) \ +typedef NCollection_Sequence _ClassName_; DEFINE_SEQUENCE (SMESH_SequenceOfElemPtr, SMESH_BaseCollectionElemPtr, SMDS_MeshElementPtr) diff --color -rupN a/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp b/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp --- a/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp 2024-02-27 15:00:48.252207183 +0100 @@ -33,10 +33,33 @@ #include "SMDS_MeshNode.hxx" #include "SMESH_File.hxx" +#include + namespace { struct Hasher { +#if OCC_VERSION_HEX >= 0x070800 + size_t operator()(const gp_Pnt& point) const noexcept + { + union + { + Standard_Real R[3]; + Standard_Integer I[6]; + } U; + + point.Coord( U.R[0], U.R[1], U.R[2] ); + return std::hash{}(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7); + } + + size_t operator()(const gp_Pnt& point1, const gp_Pnt& point2) const noexcept + { + static Standard_Real tab1[3], tab2[3]; + point1.Coord(tab1[0],tab1[1],tab1[2]); + point2.Coord(tab2[0],tab2[1],tab2[2]); + return (memcmp(tab1,tab2,sizeof(tab1)) == 0); + } +#else //======================================================================= //function : HashCode //purpose : @@ -51,9 +74,9 @@ namespace } U; point.Coord( U.R[0], U.R[1], U.R[2] ); - - return ::HashCode(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7,Upper); + return std::hash{}(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7); } + //======================================================================= //function : IsEqual //purpose : @@ -66,7 +89,9 @@ namespace point2.Coord(tab2[0],tab2[1],tab2[2]); return (memcmp(tab1,tab2,sizeof(tab1)) == 0); } +#endif }; + typedef NCollection_DataMap TDataMapOfPntNodePtr; const int HEADER_SIZE = 84; diff --color -rupN a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp --- a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp 2024-02-27 15:00:48.252207183 +0100 @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include diff --color -rupN a/src/Mod/Drawing/App/PreCompiled.h b/src/Mod/Drawing/App/PreCompiled.h --- a/src/Mod/Drawing/App/PreCompiled.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Drawing/App/PreCompiled.h 2024-02-27 15:00:48.252207183 +0100 @@ -70,7 +70,6 @@ #include #include #include -#include #include #include #include diff --color -rupN a/src/Mod/Drawing/Gui/TaskDialog.cpp b/src/Mod/Drawing/Gui/TaskDialog.cpp --- a/src/Mod/Drawing/Gui/TaskDialog.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Drawing/Gui/TaskDialog.cpp 2024-02-27 15:00:48.252207183 +0100 @@ -29,7 +29,6 @@ #endif -#include #include "TaskDialog.h" #include #include diff --color -rupN a/src/Mod/Fem/Gui/PreCompiled.h b/src/Mod/Fem/Gui/PreCompiled.h --- a/src/Mod/Fem/Gui/PreCompiled.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Fem/Gui/PreCompiled.h 2024-02-27 15:00:48.252207183 +0100 @@ -63,7 +63,6 @@ #endif // OCC -#include #include #include #include diff --color -rupN a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp --- a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp 2024-02-27 15:00:48.252207183 +0100 @@ -28,7 +28,6 @@ # include # include -# include #endif #include diff --color -rupN a/src/Mod/Import/App/ImportOCAF.cpp b/src/Mod/Import/App/ImportOCAF.cpp --- a/src/Mod/Import/App/ImportOCAF.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Import/App/ImportOCAF.cpp 2024-02-27 15:00:48.252207183 +0100 @@ -165,7 +165,11 @@ void ImportOCAF::loadShapes(const TDF_La std::vector localValue; if (aShapeTool->GetShape(label,aShape)) { +#if OCC_VERSION_HEX >= 0x070800 + hash = std::hash{}(aShape); +#else hash = aShape.HashCode(HashUpper); +#endif } Handle(TDataStd_Name) name; @@ -235,7 +239,11 @@ void ImportOCAF::loadShapes(const TDF_La if (isRef || myRefShapes.find(hash) == myRefShapes.end()) { TopoDS_Shape aShape; if (isRef && aShapeTool->GetShape(label, aShape)) +#if OCC_VERSION_HEX >= 0x070800 + myRefShapes.insert(std::hash{}(aShape)); +#else myRefShapes.insert(aShape.HashCode(HashUpper)); +#endif if (aShapeTool->IsSimpleShape(label) && (isRef || aShapeTool->IsFree(label))) { if (!asm_name.empty()) @@ -565,7 +573,11 @@ void ImportXCAF::createShape(const TopoD part->Label.setValue(default_name); part->Shape.setValue(shape); std::map::const_iterator jt; +#if OCC_VERSION_HEX >= 0x070800 + jt = myColorMap.find(std::hash{}(shape)); +#else jt = myColorMap.find(shape.HashCode(INT_MAX)); +#endif App::Color partColor(0.8f,0.8f,0.8f); #if 0//TODO @@ -586,7 +598,11 @@ void ImportXCAF::createShape(const TopoD // set label name if defined if (setname && !myNameMap.empty()) { std::map::const_iterator jt; +#if OCC_VERSION_HEX >= 0x070800 + jt = myNameMap.find(std::hash{}(shape)); +#else jt = myNameMap.find(shape.HashCode(INT_MAX)); +#endif if (jt != myNameMap.end()) { part->Label.setValue(jt->second); } @@ -606,7 +622,11 @@ void ImportXCAF::createShape(const TopoD faceColors.resize(faces.Extent(), partColor); xp.Init(shape,TopAbs_FACE); while (xp.More()) { +#if OCC_VERSION_HEX >= 0x070800 + jt = myColorMap.find(std::hash{}(xp.Current())); +#else jt = myColorMap.find(xp.Current().HashCode(INT_MAX)); +#endif if (jt != myColorMap.end()) { int index = faces.FindIndex(xp.Current()); faceColors[index-1] = convertColor(jt->second); @@ -641,23 +661,51 @@ void ImportXCAF::loadShapes(const TDF_La // add the shapes TopExp_Explorer xp; for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) +#if OCC_VERSION_HEX >= 0x070800 + this->mySolids[std::hash{}(xp.Current())] = (xp.Current()); +#else this->mySolids[xp.Current().HashCode(INT_MAX)] = (xp.Current()); +#endif for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++) +#if OCC_VERSION_HEX >= 0x070800 + this->myShells[std::hash{}(xp.Current())] = (xp.Current()); +#else this->myShells[xp.Current().HashCode(INT_MAX)] = (xp.Current()); +#endif // if no solids and no shells were found then go for compounds if (ctSolids == 0 && ctShells == 0) { for (xp.Init(aShape, TopAbs_COMPOUND); xp.More(); xp.Next(), ctComps++) +#if OCC_VERSION_HEX >= 0x070800 + this->myCompds[std::hash{}(xp.Current())] = (xp.Current()); +#else this->myCompds[xp.Current().HashCode(INT_MAX)] = (xp.Current()); +#endif } if (ctComps == 0) { for (xp.Init(aShape, TopAbs_FACE, TopAbs_SHELL); xp.More(); xp.Next()) +#if OCC_VERSION_HEX >= 0x070800 + this->myShapes[std::hash{}(xp.Current())] = (xp.Current()); +#else this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); +#endif for (xp.Init(aShape, TopAbs_WIRE, TopAbs_FACE); xp.More(); xp.Next()) +#if OCC_VERSION_HEX >= 0x070800 + this->myShapes[std::hash{}(xp.Current())] = (xp.Current()); +#else this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); +#endif for (xp.Init(aShape, TopAbs_EDGE, TopAbs_WIRE); xp.More(); xp.Next()) +#if OCC_VERSION_HEX >= 0x070800 + this->myShapes[std::hash{}(xp.Current())] = (xp.Current()); +#else this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); +#endif for (xp.Init(aShape, TopAbs_VERTEX, TopAbs_EDGE); xp.More(); xp.Next()) +#if OCC_VERSION_HEX >= 0x070800 + this->myShapes[std::hash{}(xp.Current())] = (xp.Current()); +#else this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current()); +#endif } } @@ -667,7 +715,11 @@ void ImportXCAF::loadShapes(const TDF_La hColors->GetColor(label, XCAFDoc_ColorSurf, col) || hColors->GetColor(label, XCAFDoc_ColorCurv, col)) { // add defined color +#if OCC_VERSION_HEX >= 0x070800 + myColorMap[std::hash{}(aShape)] = col; +#else myColorMap[aShape.HashCode(INT_MAX)] = col; +#endif } else { // http://www.opencascade.org/org/forum/thread_17107/ @@ -677,7 +729,11 @@ void ImportXCAF::loadShapes(const TDF_La hColors->GetColor(it.Value(), XCAFDoc_ColorSurf, col) || hColors->GetColor(it.Value(), XCAFDoc_ColorCurv, col)) { // add defined color +#if OCC_VERSION_HEX >= 0x070800 + myColorMap[std::hash{}(it.Value())] = col; +#else myColorMap[it.Value().HashCode(INT_MAX)] = col; +#endif } } } @@ -690,7 +746,11 @@ void ImportXCAF::loadShapes(const TDF_La extstr.ToUTF8CString(str); std::string labelName(str); if (!labelName.empty()) +#if OCC_VERSION_HEX >= 0x070800 + myNameMap[std::hash{}(aShape)] = labelName; +#else myNameMap[aShape.HashCode(INT_MAX)] = labelName; +#endif delete [] str; } diff --color -rupN a/src/Mod/Import/App/ImportOCAF.h b/src/Mod/Import/App/ImportOCAF.h --- a/src/Mod/Import/App/ImportOCAF.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Import/App/ImportOCAF.h 2024-02-27 15:00:48.252207183 +0100 @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --color -rupN a/src/Mod/Import/App/ImportOCAF2.h b/src/Mod/Import/App/ImportOCAF2.h --- a/src/Mod/Import/App/ImportOCAF2.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Import/App/ImportOCAF2.h 2024-02-27 15:06:12.358890276 +0100 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -57,13 +56,21 @@ namespace Import { struct ShapeHasher { std::size_t operator()(const TopoDS_Shape &s) const { +#if OCC_VERSION_HEX >= 0x070800 + return std::hash{}(s); +#else return s.HashCode(INT_MAX); +#endif } }; struct LabelHasher { std::size_t operator()(const TDF_Label &l) const { +#if OCC_VERSION_HEX >= 0x070800 + return std::hash {}(l); +#else return TDF_LabelMapHasher::HashCode(l,INT_MAX); +#endif } }; diff --color -rupN a/src/Mod/MeshPart/App/CurveProjector.h b/src/Mod/MeshPart/App/CurveProjector.h --- a/src/Mod/MeshPart/App/CurveProjector.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/MeshPart/App/CurveProjector.h 2024-02-27 15:00:48.252207183 +0100 @@ -20,6 +20,7 @@ * * ***************************************************************************/ +#include #ifndef _CurveProjector_h_ #define _CurveProjector_h_ @@ -64,8 +65,13 @@ public: template struct TopoDSLess { - bool operator()(const T& x, const T& y) const { - return x.HashCode(INT_MAX-1) < y.HashCode(INT_MAX-1); + bool operator()(const T& x, const T& y) const { +#if OCC_VERSION_HEX >= 0x070800 + std::hash hasher; + return hasher(x) < hasher(y); +#else + return x.HashCode(INT_MAX-1) < y.HashCode(INT_MAX-1); +#endif } }; diff --color -rupN a/src/Mod/MeshPart/App/PreCompiled.h b/src/Mod/MeshPart/App/PreCompiled.h --- a/src/Mod/MeshPart/App/PreCompiled.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/MeshPart/App/PreCompiled.h 2024-02-27 15:00:48.252207183 +0100 @@ -76,7 +76,6 @@ #include #include #include -#include #include #include #include diff --color -rupN a/src/Mod/MeshPart/Gui/CrossSections.cpp b/src/Mod/MeshPart/Gui/CrossSections.cpp --- a/src/Mod/MeshPart/Gui/CrossSections.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/MeshPart/Gui/CrossSections.cpp 2024-02-27 15:00:48.252207183 +0100 @@ -24,7 +24,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ # include -# include # include # include # include diff --color -rupN a/src/Mod/Part/App/ImportStep.cpp b/src/Mod/Part/App/ImportStep.cpp --- a/src/Mod/Part/App/ImportStep.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/App/ImportStep.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -167,7 +167,12 @@ int Part::ImportStepParts(App::Document // This is a trick to access the GUI via Python and set the color property // of the associated view provider. If no GUI is up an exception is thrown // and cleared immediately +#if OCC_VERSION_HEX >= 0x070800 + std::hash hasher; + std::map::iterator it = hash_col.find(hasher(aSolid)); +#else std::map::iterator it = hash_col.find(aSolid.HashCode(INT_MAX)); +#endif if (it != hash_col.end()) { try { Py::Object obj(pcFeature->getPyObject(), true); diff --color -rupN a/src/Mod/Part/App/OCCError.h b/src/Mod/Part/App/OCCError.h --- a/src/Mod/Part/App/OCCError.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/App/OCCError.h 2024-02-27 15:00:48.255540482 +0100 @@ -50,7 +50,6 @@ # include # include # include -# include # include # include diff --color -rupN a/src/Mod/Part/App/OpenCascadeAll.h b/src/Mod/Part/App/OpenCascadeAll.h --- a/src/Mod/Part/App/OpenCascadeAll.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/App/OpenCascadeAll.h 2024-02-27 15:00:48.255540482 +0100 @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include diff --color -rupN a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp --- a/src/Mod/Part/App/TopoShapePyImp.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/App/TopoShapePyImp.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -1321,7 +1321,11 @@ PyObject* TopoShapePy::ancestorsOfType( TopTools_ListIteratorOfListOfShape it(ancestors); for (; it.More(); it.Next()) { // make sure to avoid duplicates +#if OCC_VERSION_HEX >= 0x070800 + const size_t code = std::hash{}(static_cast(it.Value())); +#else Standard_Integer code = it.Value().HashCode(INT_MAX); +#endif if (hashes.find(code) == hashes.end()) { list.append(shape2pyshape(it.Value())); hashes.insert(code); @@ -1943,7 +1947,11 @@ PyObject* TopoShapePy::hashCode(PyObject if (!PyArg_ParseTuple(args, "|i",&upper)) return nullptr; +#if OCC_VERSION_HEX >= 0x070800 + int hc = std::hash{}(getTopoShapePtr()->getShape()); +#else int hc = getTopoShapePtr()->getShape().HashCode(upper); +#endif return Py_BuildValue("i", hc); } diff --color -rupN a/src/Mod/Part/Gui/AppPartGui.cpp b/src/Mod/Part/Gui/AppPartGui.cpp --- a/src/Mod/Part/Gui/AppPartGui.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/Gui/AppPartGui.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -11,9 +11,6 @@ #include "PreCompiled.h" -#ifndef _PreComp_ -# include -#endif #include #include diff --color -rupN a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp --- a/src/Mod/Part/Gui/Command.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/Gui/Command.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -26,7 +26,6 @@ # include # include # include -# include # include # include # include diff --color -rupN a/src/Mod/Part/Gui/CommandSimple.cpp b/src/Mod/Part/Gui/CommandSimple.cpp --- a/src/Mod/Part/Gui/CommandSimple.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/Gui/CommandSimple.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -22,9 +22,6 @@ #include "PreCompiled.h" -#ifndef _PreComp_ -# include -#endif #include #include diff --color -rupN a/src/Mod/Part/Gui/CrossSections.cpp b/src/Mod/Part/Gui/CrossSections.cpp --- a/src/Mod/Part/Gui/CrossSections.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/Gui/CrossSections.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -23,7 +23,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include # include # include # include diff --color -rupN a/src/Mod/Part/Gui/ViewProvider2DObject.cpp b/src/Mod/Part/Gui/ViewProvider2DObject.cpp --- a/src/Mod/Part/Gui/ViewProvider2DObject.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/Gui/ViewProvider2DObject.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -26,8 +26,6 @@ #ifndef _PreComp_ # include -# include - # include # include # include diff --color -rupN a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp --- a/src/Mod/Part/Gui/ViewProviderExt.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -978,7 +978,11 @@ void ViewProviderPartExt::updateVisual() TopExp_Explorer xp; for (xp.Init(faceMap(i),TopAbs_EDGE);xp.More();xp.Next()) +#if OCC_VERSION_HEX >= 0x070800 + faceEdges.insert(std::hash{}(xp.Current())); +#else faceEdges.insert(xp.Current().HashCode(INT_MAX)); +#endif numFaces++; } @@ -1006,7 +1010,11 @@ void ViewProviderPartExt::updateVisual() // So, we have to store the hashes of the edges associated to a face. // If the hash of a given edge is not in this list we know it's really // a free edge. +#if OCC_VERSION_HEX >= 0x070800 + int hash = std::hash{}(aEdge); +#else int hash = aEdge.HashCode(INT_MAX); +#endif if (faceEdges.find(hash) == faceEdges.end()) { Handle(Poly_Polygon3D) aPoly = Part::Tools::polygonOfEdge(aEdge, aLoc); if (!aPoly.IsNull()) { @@ -1205,7 +1213,11 @@ void ViewProviderPartExt::updateVisual() TopLoc_Location aLoc; // handling of the free edge that are not associated to a face +#if OCC_VERSION_HEX >= 0x070800 + int hash = std::hash{}(aEdge); +#else int hash = aEdge.HashCode(INT_MAX); +#endif if (faceEdges.find(hash) == faceEdges.end()) { Handle(Poly_Polygon3D) aPoly = Part::Tools::polygonOfEdge(aEdge, aLoc); if (!aPoly.IsNull()) { diff --color -rupN a/src/Mod/Part/Gui/ViewProviderExt.h b/src/Mod/Part/Gui/ViewProviderExt.h --- a/src/Mod/Part/Gui/ViewProviderExt.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/Gui/ViewProviderExt.h 2024-02-27 15:00:48.255540482 +0100 @@ -24,7 +24,6 @@ #ifndef PARTGUI_VIEWPROVIDERPARTEXT_H #define PARTGUI_VIEWPROVIDERPARTEXT_H -#include #include #include #include diff --color -rupN a/src/Mod/Part/Gui/ViewProviderMirror.cpp b/src/Mod/Part/Gui/ViewProviderMirror.cpp --- a/src/Mod/Part/Gui/ViewProviderMirror.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/Gui/ViewProviderMirror.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -27,7 +27,6 @@ # include # include # include -# include # include # include # include diff --color -rupN a/src/Mod/Part/Gui/ViewProviderPython.cpp b/src/Mod/Part/Gui/ViewProviderPython.cpp --- a/src/Mod/Part/Gui/ViewProviderPython.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/Gui/ViewProviderPython.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -23,7 +23,6 @@ #include "PreCompiled.h" -#include #ifndef _PreComp_ # include #endif diff --color -rupN a/src/Mod/Part/Gui/ViewProviderReference.h b/src/Mod/Part/Gui/ViewProviderReference.h --- a/src/Mod/Part/Gui/ViewProviderReference.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Part/Gui/ViewProviderReference.h 2024-02-27 15:00:48.255540482 +0100 @@ -24,7 +24,6 @@ #ifndef PARTGUI_ViewProviderPartReference_H #define PARTGUI_ViewProviderPartReference_H -#include #include #include #include diff --color -rupN a/src/Mod/PartDesign/Gui/PreCompiled.h b/src/Mod/PartDesign/Gui/PreCompiled.h --- a/src/Mod/PartDesign/Gui/PreCompiled.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/PartDesign/Gui/PreCompiled.h 2024-02-27 15:00:48.255540482 +0100 @@ -44,7 +44,6 @@ #include // OCC -#include #include #include #include diff --color -rupN a/src/Mod/Path/App/Voronoi.cpp b/src/Mod/Path/App/Voronoi.cpp --- a/src/Mod/Path/App/Voronoi.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Path/App/Voronoi.cpp 2024-02-27 15:00:48.255540482 +0100 @@ -23,10 +23,6 @@ #include "PreCompiled.h" -#ifndef _PreComp_ -# include -#endif - #include #include "Voronoi.h" diff --color -rupN a/src/Mod/Path/Gui/PreCompiled.h b/src/Mod/Path/Gui/PreCompiled.h --- a/src/Mod/Path/Gui/PreCompiled.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Path/Gui/PreCompiled.h 2024-02-27 15:00:48.258873781 +0100 @@ -38,8 +38,6 @@ # define PathGuiExport #endif -#include - #ifdef _MSC_VER # pragma warning( disable : 4273 ) #endif diff --color -rupN a/src/Mod/Robot/Gui/PreCompiled.h b/src/Mod/Robot/Gui/PreCompiled.h --- a/src/Mod/Robot/Gui/PreCompiled.h 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Robot/Gui/PreCompiled.h 2024-02-27 15:00:48.258873781 +0100 @@ -39,8 +39,6 @@ # define RobotGuiExport #endif -#include - #ifdef _MSC_VER # pragma warning(disable : 4005) # pragma warning(disable : 4273) diff --color -rupN a/src/Mod/Sandbox/Gui/AppSandboxGui.cpp b/src/Mod/Sandbox/Gui/AppSandboxGui.cpp --- a/src/Mod/Sandbox/Gui/AppSandboxGui.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Sandbox/Gui/AppSandboxGui.cpp 2024-02-27 15:00:48.258873781 +0100 @@ -24,7 +24,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ # include -# include # include # include # include diff --color -rupN a/src/Mod/Sketcher/App/SketchAnalysis.cpp b/src/Mod/Sketcher/App/SketchAnalysis.cpp --- a/src/Mod/Sketcher/App/SketchAnalysis.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Sketcher/App/SketchAnalysis.cpp 2024-02-27 15:00:48.258873781 +0100 @@ -25,7 +25,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include # include # include # include diff --color -rupN a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp 2024-02-27 15:00:48.258873781 +0100 @@ -24,7 +24,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include # include # include # include diff --color -rupN a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp --- a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp 2024-02-27 15:00:48.258873781 +0100 @@ -23,7 +23,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include /// Qt Include Files # include # include diff --color -rupN a/src/Mod/Sketcher/Gui/TaskSketcherValidation.cpp b/src/Mod/Sketcher/Gui/TaskSketcherValidation.cpp --- a/src/Mod/Sketcher/Gui/TaskSketcherValidation.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Sketcher/Gui/TaskSketcherValidation.cpp 2024-02-27 15:00:48.258873781 +0100 @@ -24,7 +24,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include # include # include # include diff --color -rupN a/src/Mod/Sketcher/Gui/ViewProviderPython.cpp b/src/Mod/Sketcher/Gui/ViewProviderPython.cpp --- a/src/Mod/Sketcher/Gui/ViewProviderPython.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Sketcher/Gui/ViewProviderPython.cpp 2024-02-27 15:00:48.258873781 +0100 @@ -23,7 +23,6 @@ #include "PreCompiled.h" -#include #ifndef _PreComp_ # include #endif diff --color -rupN a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp 2024-02-27 15:00:48.258873781 +0100 @@ -24,7 +24,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include # include # include diff --color -rupN a/src/Mod/Surface/Gui/Command.cpp b/src/Mod/Surface/Gui/Command.cpp --- a/src/Mod/Surface/Gui/Command.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/Surface/Gui/Command.cpp 2024-02-27 15:00:48.258873781 +0100 @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --color -rupN a/src/Mod/TechDraw/Gui/TaskProjection.cpp b/src/Mod/TechDraw/Gui/TaskProjection.cpp --- a/src/Mod/TechDraw/Gui/TaskProjection.cpp 2022-12-07 03:35:37.000000000 +0100 +++ b/src/Mod/TechDraw/Gui/TaskProjection.cpp 2024-02-27 15:00:48.258873781 +0100 @@ -29,9 +29,6 @@ # include #endif - -#include - #include #include #include