From bd1fc0fc031e4e04bbaa897b2c783c5eb7e7975c Mon Sep 17 00:00:00 2001 From: bgbsww <120601209+bgbsww@users.noreply.github.com> Date: Tue, 9 Jan 2024 20:47:25 -0500 Subject: [PATCH] Add support for OCCT 7.8.0 (#11909) --- cMake/FindOCC.cmake | 14 ++--- .../inc/SMESHDS_DataMapOfShape.hxx | 17 +++++- .../salomesmesh/inc/SMESH_MeshVSLink.hxx | 3 - src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx | 1 + .../salomesmesh/inc/SMESH_SequenceOfNode.hxx | 3 +- .../salomesmesh/inc/SMESH_TypeDefs.hxx | 7 +++ .../src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp | 29 ++++++++- .../StdMeshers/StdMeshers_Quadrangle_2D.cpp | 1 - src/Mod/Fem/Gui/TaskCreateNodeSet.cpp | 1 - src/Mod/Import/App/ImportOCAF.cpp | 60 +++++++++++++++++++ src/Mod/Import/App/ImportOCAF2.h | 1 - src/Mod/Import/App/Tools.h | 11 +++- src/Mod/MeshPart/App/CurveProjector.h | 6 ++ src/Mod/Part/App/ImportStep.cpp | 5 ++ src/Mod/Part/App/TopoShapePyImp.cpp | 8 +++ src/Mod/Part/Gui/AppPartGui.cpp | 1 - src/Mod/Part/Gui/Command.cpp | 1 - src/Mod/Part/Gui/CommandSimple.cpp | 1 - src/Mod/Part/Gui/CrossSections.cpp | 1 - src/Mod/Part/Gui/ViewProvider2DObject.cpp | 1 - src/Mod/Part/Gui/ViewProviderExt.cpp | 12 ++++ src/Mod/Part/Gui/ViewProviderExt.h | 1 - src/Mod/Part/Gui/ViewProviderMirror.cpp | 1 - src/Mod/Part/Gui/ViewProviderPython.cpp | 1 - src/Mod/Part/Gui/ViewProviderReference.h | 1 - src/Mod/Path/App/Voronoi.cpp | 3 +- src/Mod/Path/Gui/PreCompiled.h | 2 - src/Mod/Robot/Gui/PreCompiled.h | 2 - src/Mod/Sketcher/Gui/EditDatumDialog.cpp | 1 - 29 files changed, 161 insertions(+), 35 deletions(-) diff --git a/cMake/FindOCC.cmake b/cMake/FindOCC.cmake index 32078cf2de..c72066f43e 100644 --- a/cMake/FindOCC.cmake +++ b/cMake/FindOCC.cmake @@ -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,8 +148,6 @@ if(OCC_FOUND) TKLCAF TKVCAF TKCDF - TKXDESTEP - TKXDEIGES TKMeshVS TKService TKV3d @@ -164,6 +156,12 @@ if(OCC_FOUND) if(NOT OCC_VERSION_STRING VERSION_LESS 7.5.0) list(APPEND OCC_OCAF_LIBRARIES TKRWMesh) 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 --git a/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx b/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx index 3e083cd84d..67e9f91cde 100644 --- a/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx @@ -29,13 +29,26 @@ #include +#include + /* * This method needed for instance NCollection_DataMap with TopoDS_Shape as key */ +#if OCC_VERSION_HEX >= 0x070800 +struct SMESHDS_Hasher +{ + size_t operator()(const TopoDS_Shape& S) const noexcept { + return std::hash{}(S); + } + 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) + const TopoDS_Shape& S2) { return S1.IsSame(S2); } @@ -45,6 +58,6 @@ struct SMESHDS_Hasher return ::HashCode( S, Upper); } }; - +#endif #endif diff --git a/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx b/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx index 3bc552eb23..6155e20539 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx @@ -57,9 +57,6 @@ #ifndef _MeshVS_EntityType_HeaderFile #include #endif -#ifndef _Standard_Address_HeaderFile -#include -#endif #ifndef _TColStd_HArray1OfInteger_HeaderFile #include #endif diff --git a/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx b/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx index 1094aed0df..a8fe257ea7 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx @@ -37,4 +37,5 @@ #define SMESH_EXPORT #endif +#include #endif diff --git a/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx b/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx index ada6c8b98b..33c7203cc8 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx @@ -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 --git a/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx b/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx index ac7aa480d8..7090537c46 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx @@ -185,11 +185,18 @@ typedef std::vector< UVPtStruct > UVPtStructVec; // -------------------------------------------------------------------------------- // 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 --git a/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp b/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp index ec3ea2e8e3..4b3791292a 100644 --- a/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp +++ b/src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp @@ -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 --git a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp index 5d5c15c366..5ebf9dbfb4 100644 --- a/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp +++ b/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include diff --git a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp index 22c8e6dec5..af4221a395 100644 --- a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp +++ b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp @@ -28,7 +28,6 @@ #include #include -#include #endif #include diff --git a/src/Mod/Import/App/ImportOCAF.cpp b/src/Mod/Import/App/ImportOCAF.cpp index 0f74d8b178..7277d0fb19 100644 --- a/src/Mod/Import/App/ImportOCAF.cpp +++ b/src/Mod/Import/App/ImportOCAF.cpp @@ -151,7 +151,11 @@ void ImportOCAF::loadShapes(const TDF_Label& label, 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; @@ -223,7 +227,11 @@ void ImportOCAF::loadShapes(const TDF_Label& label, 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))) { @@ -550,7 +558,11 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna 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 @@ -571,7 +583,11 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna // 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); } @@ -591,7 +607,11 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna 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); @@ -626,29 +646,57 @@ void ImportXCAF::loadShapes(const TDF_Label& label) // 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 } } } @@ -659,7 +707,11 @@ void ImportXCAF::loadShapes(const TDF_Label& label) || 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/ @@ -669,7 +721,11 @@ void ImportXCAF::loadShapes(const TDF_Label& label) || 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 } } } @@ -682,7 +738,11 @@ void ImportXCAF::loadShapes(const TDF_Label& label) 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 --git a/src/Mod/Import/App/ImportOCAF2.h b/src/Mod/Import/App/ImportOCAF2.h index 17cf8a7df9..8b79201e17 100644 --- a/src/Mod/Import/App/ImportOCAF2.h +++ b/src/Mod/Import/App/ImportOCAF2.h @@ -30,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/src/Mod/Import/App/Tools.h b/src/Mod/Import/App/Tools.h index dc0ba5a7bb..aa05e3067e 100644 --- a/src/Mod/Import/App/Tools.h +++ b/src/Mod/Import/App/Tools.h @@ -24,12 +24,13 @@ #define IMPORT_TOOLS_H #include -#include #include #include #include #include +#include + namespace Import { @@ -37,7 +38,11 @@ struct ShapeHasher { std::size_t operator()(const TopoDS_Shape& shape) const { +#if OCC_VERSION_HEX >= 0x070800 + return std::hash {}(shape); +#else return shape.HashCode(INT_MAX); +#endif } }; @@ -45,7 +50,11 @@ struct LabelHasher { std::size_t operator()(const TDF_Label& label) const { +#if OCC_VERSION_HEX >= 0x070800 + return std::hash {}(label); +#else return TDF_LabelMapHasher::HashCode(label, INT_MAX); +#endif } }; diff --git a/src/Mod/MeshPart/App/CurveProjector.h b/src/Mod/MeshPart/App/CurveProjector.h index 08714d9e2a..e7d99100ed 100644 --- a/src/Mod/MeshPart/App/CurveProjector.h +++ b/src/Mod/MeshPart/App/CurveProjector.h @@ -32,6 +32,7 @@ #include #include +#include namespace MeshCore { @@ -65,7 +66,12 @@ public: { 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 --git a/src/Mod/Part/App/ImportStep.cpp b/src/Mod/Part/App/ImportStep.cpp index 6c41ac5380..1d02eb2d63 100644 --- a/src/Mod/Part/App/ImportStep.cpp +++ b/src/Mod/Part/App/ImportStep.cpp @@ -137,7 +137,12 @@ int Part::ImportStepParts(App::Document *pcDoc, const char* Name) // 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 --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index 4833e5119e..f4471391c9 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -1306,7 +1306,11 @@ PyObject* TopoShapePy::ancestorsOfType(PyObject *args) 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); @@ -1928,7 +1932,11 @@ PyObject* TopoShapePy::hashCode(PyObject *args) 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 --git a/src/Mod/Part/Gui/AppPartGui.cpp b/src/Mod/Part/Gui/AppPartGui.cpp index 90af3b7a20..73c931bc66 100644 --- a/src/Mod/Part/Gui/AppPartGui.cpp +++ b/src/Mod/Part/Gui/AppPartGui.cpp @@ -24,7 +24,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include #endif #include diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index c4a4392127..436ba6130a 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -26,7 +26,6 @@ # include # include # include -# include # include # include # include diff --git a/src/Mod/Part/Gui/CommandSimple.cpp b/src/Mod/Part/Gui/CommandSimple.cpp index 2dfacbab09..60dce779c4 100644 --- a/src/Mod/Part/Gui/CommandSimple.cpp +++ b/src/Mod/Part/Gui/CommandSimple.cpp @@ -23,7 +23,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include # include #endif diff --git a/src/Mod/Part/Gui/CrossSections.cpp b/src/Mod/Part/Gui/CrossSections.cpp index 76069d3282..a0474028b4 100644 --- a/src/Mod/Part/Gui/CrossSections.cpp +++ b/src/Mod/Part/Gui/CrossSections.cpp @@ -28,7 +28,6 @@ # include # include -# include # include # include diff --git a/src/Mod/Part/Gui/ViewProvider2DObject.cpp b/src/Mod/Part/Gui/ViewProvider2DObject.cpp index 7dd81a5fd2..dfde26fa89 100644 --- a/src/Mod/Part/Gui/ViewProvider2DObject.cpp +++ b/src/Mod/Part/Gui/ViewProvider2DObject.cpp @@ -25,7 +25,6 @@ #ifndef _PreComp_ # include -# include # include # include diff --git a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp index aa58bf5bb3..c5a8d9ef00 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.cpp +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp @@ -982,7 +982,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++; } @@ -1010,7 +1014,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()) { @@ -1209,7 +1217,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 --git a/src/Mod/Part/Gui/ViewProviderExt.h b/src/Mod/Part/Gui/ViewProviderExt.h index bdd044e6fb..1e5ac28648 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.h +++ b/src/Mod/Part/Gui/ViewProviderExt.h @@ -24,7 +24,6 @@ #define PARTGUI_VIEWPROVIDERPARTEXT_H #include -#include #include #include diff --git a/src/Mod/Part/Gui/ViewProviderMirror.cpp b/src/Mod/Part/Gui/ViewProviderMirror.cpp index 617844c02c..1c3393f3d2 100644 --- a/src/Mod/Part/Gui/ViewProviderMirror.cpp +++ b/src/Mod/Part/Gui/ViewProviderMirror.cpp @@ -27,7 +27,6 @@ # include # include -# include # include # include diff --git a/src/Mod/Part/Gui/ViewProviderPython.cpp b/src/Mod/Part/Gui/ViewProviderPython.cpp index 6991f29efb..f31c11efe9 100644 --- a/src/Mod/Part/Gui/ViewProviderPython.cpp +++ b/src/Mod/Part/Gui/ViewProviderPython.cpp @@ -22,7 +22,6 @@ #include "PreCompiled.h" -#include #ifndef _PreComp_ # include #endif diff --git a/src/Mod/Part/Gui/ViewProviderReference.h b/src/Mod/Part/Gui/ViewProviderReference.h index 2408cbe818..b92beaf525 100644 --- a/src/Mod/Part/Gui/ViewProviderReference.h +++ b/src/Mod/Part/Gui/ViewProviderReference.h @@ -24,7 +24,6 @@ #ifndef PARTGUI_ViewProviderPartReference_H #define PARTGUI_ViewProviderPartReference_H -#include #include #include #include diff --git a/src/Mod/Path/App/Voronoi.cpp b/src/Mod/Path/App/Voronoi.cpp index 27a509c20c..443b747507 100644 --- a/src/Mod/Path/App/Voronoi.cpp +++ b/src/Mod/Path/App/Voronoi.cpp @@ -22,7 +22,8 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +#define _USE_MATH_DEFINES +# include #endif #include diff --git a/src/Mod/Path/Gui/PreCompiled.h b/src/Mod/Path/Gui/PreCompiled.h index f12ef8f919..ed8cef500f 100644 --- a/src/Mod/Path/Gui/PreCompiled.h +++ b/src/Mod/Path/Gui/PreCompiled.h @@ -38,8 +38,6 @@ # define PathGuiExport #endif -#include - #ifdef _MSC_VER # pragma warning( disable : 4273 ) #endif diff --git a/src/Mod/Robot/Gui/PreCompiled.h b/src/Mod/Robot/Gui/PreCompiled.h index ce1ed1d790..d99738ef53 100644 --- a/src/Mod/Robot/Gui/PreCompiled.h +++ b/src/Mod/Robot/Gui/PreCompiled.h @@ -38,8 +38,6 @@ #define RobotGuiExport #endif -#include - #ifdef _MSC_VER #pragma warning(disable : 4005) #pragma warning(disable : 4273) diff --git a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp index 3ae6def1f1..479b058d86 100644 --- a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp +++ b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp @@ -23,7 +23,6 @@ #include "PreCompiled.h" #ifndef _PreComp_ -#include /// Qt Include Files #include #include