[PATCH] Add support for OCCT 7.8.0 (#11909)
authorbgbsww <120601209+bgbsww@users.noreply.github.com>
Wed, 10 Jan 2024 01:47:25 +0000 (20:47 -0500)
committerTobias Frost <tobi@debian.org>
Sat, 25 May 2024 14:11:03 +0000 (16:11 +0200)
Gbp-Pq: Name 0030-octt78.patch

28 files changed:
cMake/FindOCC.cmake
src/3rdParty/salomesmesh/inc/SMESHDS_DataMapOfShape.hxx
src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx
src/3rdParty/salomesmesh/inc/SMESH_SMESH.hxx
src/3rdParty/salomesmesh/inc/SMESH_SequenceOfNode.hxx
src/3rdParty/salomesmesh/inc/SMESH_TypeDefs.hxx
src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp
src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp
src/Mod/Fem/Gui/TaskCreateNodeSet.cpp
src/Mod/Import/App/ImportOCAF.cpp
src/Mod/Import/App/ImportOCAF2.h
src/Mod/MeshPart/App/CurveProjector.h
src/Mod/Part/App/ImportStep.cpp
src/Mod/Part/App/TopoShapePyImp.cpp
src/Mod/Part/Gui/AppPartGui.cpp
src/Mod/Part/Gui/Command.cpp
src/Mod/Part/Gui/CommandSimple.cpp
src/Mod/Part/Gui/CrossSections.cpp
src/Mod/Part/Gui/ViewProvider2DObject.cpp
src/Mod/Part/Gui/ViewProviderExt.cpp
src/Mod/Part/Gui/ViewProviderExt.h
src/Mod/Part/Gui/ViewProviderMirror.cpp
src/Mod/Part/Gui/ViewProviderPython.cpp
src/Mod/Part/Gui/ViewProviderReference.h
src/Mod/Path/App/Voronoi.cpp
src/Mod/Path/Gui/PreCompiled.h
src/Mod/Robot/Gui/PreCompiled.h
src/Mod/Sketcher/Gui/EditDatumDialog.cpp

index 48e5c98750d46e300c4d0b1b81eb47b24c2bb783..c72066f43e2f33f5c35fd3848c7149bb9e341b9c 100644 (file)
@@ -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,20 @@ 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}")
index 3e083cd84d78709d8551779359898c846308fb46..67e9f91cde886ca61b2063da7707ed6ed8c2943d 100644 (file)
 
 #include <TopoDS_Shape.hxx>
 
+#include <Standard_Version.hxx>
+
 /*
  * 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<TopoDS_Shape>{}(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
index 3bc552eb23d39426f512bc25ec694c7c35f79297..6155e2053999d082cdc94fdd18f96cd099c627f7 100644 (file)
@@ -57,9 +57,6 @@
 #ifndef _MeshVS_EntityType_HeaderFile
 #include <MeshVS_EntityType.hxx>
 #endif
-#ifndef _Standard_Address_HeaderFile
-#include <Standard_Address.hxx>
-#endif
 #ifndef _TColStd_HArray1OfInteger_HeaderFile
 #include <TColStd_HArray1OfInteger.hxx>
 #endif
index 1094aed0dfddd34dbfa097b612289254b0574fb7..a8fe257ea70fb145b6270dc4f3b1e9bdc074a191 100644 (file)
@@ -37,4 +37,5 @@
  #define SMESH_EXPORT
 #endif
 
+#include <Standard_Version.hxx>
 #endif
index ada6c8b98bf3d6dfa73d4c5ab08b511afe3ca6d0..33c7203cc8d60db31bfa107b55a1e281fb99b01a 100644 (file)
 
 #include "SMESH_SMESH.hxx"
 
-#include <NCollection_DefineSequence.hxx>
 #if OCC_VERSION_HEX >= 0x060703
 #include <NCollection_IncAllocator.hxx>
 #include <NCollection_Sequence.hxx>
+#else
+#include <NCollection_DefineSequence.hxx>
 #endif
 
 typedef const SMDS_MeshNode* SMDS_MeshNodePtr;
index ac7aa480d80b1a23b165f5288ecf108494bf1908..7090537c466c6d10f24234f0a9a1752454273deb 100644 (file)
@@ -185,11 +185,18 @@ typedef std::vector< UVPtStruct > UVPtStructVec;
 
 // --------------------------------------------------------------------------------
 // class SMESH_SequenceOfElemPtr
+#include <Standard_Version.hxx>
+#if OCC_VERSION_HEX >= 0x060703
+#include <NCollection_Sequence.hxx>
+#else
 #include <NCollection_DefineSequence.hxx>
+#endif
 
 class SMDS_MeshElement;
 
 typedef const SMDS_MeshElement* SMDS_MeshElementPtr;
+#define DEFINE_SEQUENCE(_ClassName_, _BaseCollection_, TheItemType)            \
+typedef NCollection_Sequence<TheItemType > _ClassName_;
 
 DEFINE_SEQUENCE (SMESH_SequenceOfElemPtr, SMESH_BaseCollectionElemPtr, SMDS_MeshElementPtr)
 
index ec3ea2e8e39442abb3e3f55c6edc7b1215ac6176..4b3791292a74dddd944b0cd55a50874b8896fc84 100644 (file)
 #include "SMDS_MeshNode.hxx"
 #include "SMESH_File.hxx"
 
+#include <Standard_Version.hxx>
+
 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<Standard_Integer>{}(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<Standard_Integer>{}(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<gp_Pnt,SMDS_MeshNode*,Hasher> TDataMapOfPntNodePtr;
 
   const int HEADER_SIZE           = 84;
index 5d5c15c366125155b168fd166d9115ed9b19a7b3..5ebf9dbfb43cacb0546c3c5586f12dba75fbc35e 100644 (file)
@@ -48,7 +48,6 @@
 #include <Bnd_Box.hxx>
 #include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <Geom_Surface.hxx>
-#include <NCollection_DefineArray2.hxx>
 #include <Precision.hxx>
 #include <Standard_Real.hxx>
 #include <TColStd_SequenceOfInteger.hxx>
index 4e69796b26fe8c19001ba89ee287ff7e85db0825..be04861cc008e00362119450c59bceb7764f4efc 100644 (file)
@@ -28,7 +28,6 @@
 
 # include <SMESH_Mesh.hxx>
 # include <SMESHDS_Mesh.hxx>
-# include <Standard_math.hxx>
 #endif
 
 #include <Base/Console.h>
index 2397b62c379b16d311bd4283a30e9bf9562b6016..23153d31e5e52d709585978f868f5a730c1e400d 100644 (file)
@@ -148,7 +148,11 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc,
     std::vector<App::DocumentObject *> localValue;
 
     if (aShapeTool->GetShape(label,aShape)) {
+#if OCC_VERSION_HEX >= 0x070800
+        hash = std::hash<TopoDS_Shape> {}(aShape);
+#else
         hash = aShape.HashCode(HashUpper);
+#endif
     }
 
     Handle(TDataStd_Name) name;
@@ -217,9 +221,13 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc,
 
     if (isRef || myRefShapes.find(hash) == myRefShapes.end()) {
         TopoDS_Shape aShape;
-        if (isRef && aShapeTool->GetShape(label, aShape))
-            myRefShapes.insert(aShape.HashCode(HashUpper));
-
+        if (isRef && aShapeTool->GetShape(label, aShape)) {
+#if OCC_VERSION_HEX >= 0x070800
+            myRefShapes.insert(std::hash<TopoDS_Shape> {}(aShape));
+#else
+             myRefShapes.insert(aShape.HashCode(HashUpper));
+#endif        
+        }
         if (aShapeTool->IsSimpleShape(label) && (isRef || aShapeTool->IsFree(label))) {
             if (!asm_name.empty())
                 part_name = asm_name;
@@ -532,7 +540,11 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna
     part->Label.setValue(default_name);
     part->Shape.setValue(shape);
     std::map<Standard_Integer, Quantity_ColorRGBA>::const_iterator jt;
+#if OCC_VERSION_HEX >= 0x070800
+    jt = myColorMap.find(std::hash<TopoDS_Shape> {}(shape));
+#else
     jt = myColorMap.find(shape.HashCode(INT_MAX));
+#endif
 
     App::Color partColor(0.8f,0.8f,0.8f);
 #if 0//TODO
@@ -553,7 +565,11 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna
     // set label name if defined
     if (setname && !myNameMap.empty()) {
         std::map<Standard_Integer, std::string>::const_iterator jt;
+#if OCC_VERSION_HEX >= 0x070800
+        jt = myNameMap.find(std::hash<TopoDS_Shape> {}(shape));
+#else
         jt = myNameMap.find(shape.HashCode(INT_MAX));
+#endif
         if (jt != myNameMap.end()) {
             part->Label.setValue(jt->second);
         }
@@ -573,7 +589,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<TopoDS_Shape> {}(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);
@@ -607,24 +627,59 @@ void ImportXCAF::loadShapes(const TDF_Label& label)
             int ctSolids = 0, ctShells = 0, ctComps = 0;
             // add the shapes
             TopExp_Explorer xp;
-            for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++)
+             for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) {
+#if OCC_VERSION_HEX >= 0x070800
+                this->mySolids[std::hash<TopoDS_Shape> {}(xp.Current())] = (xp.Current());
+#else
                 this->mySolids[xp.Current().HashCode(INT_MAX)] = (xp.Current());
-            for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++)
+#endif
+            }
+            for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++) {
+#if OCC_VERSION_HEX >= 0x070800
+                this->myShells[std::hash<TopoDS_Shape> {}(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++)
+                for (xp.Init(aShape, TopAbs_COMPOUND); xp.More(); xp.Next(), ctComps++) {
+#if OCC_VERSION_HEX >= 0x070800
+                    this->myCompds[std::hash<TopoDS_Shape> {}(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())
+                for (xp.Init(aShape, TopAbs_FACE, TopAbs_SHELL); xp.More(); xp.Next()) {
+#if OCC_VERSION_HEX >= 0x070800
+                    this->myShapes[std::hash<TopoDS_Shape> {}(xp.Current())] = (xp.Current());
+#else
                     this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current());
-                for (xp.Init(aShape, TopAbs_WIRE, TopAbs_FACE); xp.More(); xp.Next())
+#endif
+                }                    
+                for (xp.Init(aShape, TopAbs_WIRE, TopAbs_FACE); xp.More(); xp.Next()) {
+#if OCC_VERSION_HEX >= 0x070800
+                    this->myShapes[std::hash<TopoDS_Shape> {}(xp.Current())] = (xp.Current());
+#else
                     this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current());
-                for (xp.Init(aShape, TopAbs_EDGE, TopAbs_WIRE); xp.More(); xp.Next())
+#endif
+                }                    
+                for (xp.Init(aShape, TopAbs_EDGE, TopAbs_WIRE); xp.More(); xp.Next()) {
+#if OCC_VERSION_HEX >= 0x070800
+                    this->myShapes[std::hash<TopoDS_Shape> {}(xp.Current())] = (xp.Current());
+#else
                     this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current());
-                for (xp.Init(aShape, TopAbs_VERTEX, TopAbs_EDGE); xp.More(); xp.Next())
+#endif
+                }
+                for (xp.Init(aShape, TopAbs_VERTEX, TopAbs_EDGE); xp.More(); xp.Next()) {
+#if OCC_VERSION_HEX >= 0x070800
+                    this->myShapes[std::hash<TopoDS_Shape> {}(xp.Current())] = (xp.Current());
+#else
                     this->myShapes[xp.Current().HashCode(INT_MAX)] = (xp.Current());
+#endif
+                }
             }
         }
 
@@ -634,7 +689,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<TopoDS_Shape> {}(aShape)] = col;
+#else
             myColorMap[aShape.HashCode(INT_MAX)] = col;
+#endif
         }
         else {
             // http://www.opencascade.org/org/forum/thread_17107/
@@ -644,7 +703,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<TopoDS_Shape> {}(it.Value())] = col;
+#else
                     myColorMap[it.Value().HashCode(INT_MAX)] = col;
+#endif
                 }
             }
         }
@@ -656,8 +719,13 @@ void ImportXCAF::loadShapes(const TDF_Label& label)
             char* str = new char[extstr.LengthOfCString()+1];
             extstr.ToUTF8CString(str);
             std::string labelName(str);
-            if (!labelName.empty())
+            if (!labelName.empty()) {
+#if OCC_VERSION_HEX >= 0x070800
+                myNameMap[std::hash<TopoDS_Shape> {}(aShape)] = labelName;
+#else
                 myNameMap[aShape.HashCode(INT_MAX)] = labelName;
+#endif
+            }
             delete [] str;
         }
 
index e19b921971e7d68880c950d6e02828f06ff9b0ed..ff231d583d11a871a76ec95ef2523a60daae6ee9 100644 (file)
@@ -30,7 +30,6 @@
 #include <unordered_map>
 #include <vector>
 
-#include <TDF_LabelMapHasher.hxx>
 #include <TDocStd_Document.hxx>
 #include <TopoDS_Shape.hxx>
 #include <XCAFDoc_ColorTool.hxx>
@@ -42,6 +41,7 @@
 #include "ImportOCAF.h"
 #include "ExportOCAF.h"
 
+#include <Standard_Version.hxx>
 
 class TDF_Label;
 class TopLoc_Location;
@@ -58,13 +58,21 @@ namespace Import {
 
 struct ShapeHasher {
     std::size_t operator()(const TopoDS_Shape &s) const {
-        return s.HashCode(INT_MAX);
+#if OCC_VERSION_HEX >= 0x070800
+        return std::hash<TopoDS_Shape> {}(s);
+#else
+        return shape.HashCode(INT_MAX);
+#endif
     }
 };
 
 struct LabelHasher {
     std::size_t operator()(const TDF_Label &l) const {
-        return TDF_LabelMapHasher::HashCode(l,INT_MAX);
+#if OCC_VERSION_HEX >= 0x070800
+        return std::hash<TDF_Label> {}(l);
+#else
+        return TDF_LabelMapHasher::HashCode(l, INT_MAX);
+#endif
     }
 };
 
index 4fb0d5ff375baa8692238e6c1473c73c28982361..49287574072fa03b0ba476be23e42799fb624b8d 100644 (file)
@@ -32,6 +32,7 @@
 #include <Mod/Mesh/App/Mesh.h>\r
 #include <Mod/MeshPart/MeshPartGlobal.h>\r
 \r
+#include <Standard_Version.hxx>\r
 \r
 namespace MeshCore\r
 {\r
@@ -63,8 +64,13 @@ public:
   template<class T>\r
     struct TopoDSLess {\r
     bool operator()(const T& x, const T& y) const {\r
-      return x.HashCode(INT_MAX-1) < y.HashCode(INT_MAX-1);\r
-    }\r
+#if OCC_VERSION_HEX >= 0x070800\r
+            std::hash<T> hasher;\r
+            return hasher(x) < hasher(y);\r
+#else\r
+            return x.HashCode(INT_MAX - 1) < y.HashCode(INT_MAX - 1);\r
+#endif\r
+     }\r
   };\r
 \r
   using result_type = std::map<TopoDS_Edge, std::vector<FaceSplitEdge>,TopoDSLess<TopoDS_Edge> >;\r
index 6c41ac538062b5e461a68919e2b148eb9cdda12a..1d02eb2d6325030792bf44d2b81dcb5cec942449 100644 (file)
@@ -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\r
                 // of the associated view provider. If no GUI is up an exception is thrown\r
                 // and cleared immediately\r
+#if OCC_VERSION_HEX >= 0x070800\r
+                std::hash<TopoDS_Solid> hasher;\r
+                std::map<int, Quantity_Color>::iterator it = hash_col.find(hasher(aSolid));\r
+#else\r
                 std::map<int, Quantity_Color>::iterator it = hash_col.find(aSolid.HashCode(INT_MAX));\r
+#endif\r
                 if (it != hash_col.end()) {\r
                     try {\r
                         Py::Object obj(pcFeature->getPyObject(), true);\r
index c73a70c17750725544e74d83619c1af309d2b736..0bf5f81494480142702532ac3b26c4e799a5844b 100644 (file)
@@ -1304,7 +1304,11 @@ PyObject*  TopoShapePy::ancestorsOfType(PyObject *args)
         TopTools_ListIteratorOfListOfShape it(ancestors);\r
         for (; it.More(); it.Next()) {\r
             // make sure to avoid duplicates\r
+#if OCC_VERSION_HEX >= 0x070800\r
+            const size_t code = std::hash<TopoDS_Shape>{}(static_cast<TopoDS_Shape>(it.Value()));\r
+#else\r
             Standard_Integer code = it.Value().HashCode(INT_MAX);\r
+#endif\r
             if (hashes.find(code) == hashes.end()) {\r
                 list.append(shape2pyshape(it.Value()));\r
                 hashes.insert(code);\r
@@ -1919,7 +1923,11 @@ PyObject* TopoShapePy::hashCode(PyObject *args)
     if (!PyArg_ParseTuple(args, "|i",&upper))\r
         return nullptr;\r
 \r
+#if OCC_VERSION_HEX >= 0x070800\r
+    int hc = std::hash<TopoDS_Shape>{}(getTopoShapePtr()->getShape());\r
+#else\r
     int hc = getTopoShapePtr()->getShape().HashCode(upper);\r
+#endif\r
     return Py_BuildValue("i", hc);\r
 }\r
 \r
index 2ca6e878cb3e65f85bc142ce2c8377dbb6369700..54553611430eb74ce354a56b3af140006ddc2073 100644 (file)
@@ -24,7 +24,6 @@
 \r
 #include "PreCompiled.h"\r
 #ifndef _PreComp_\r
-# include <Standard_math.hxx>\r
 #endif\r
 \r
 #include <Base/Console.h>\r
index b057ef4a810e372305027101f297ecfcfa8934ed..c8d06c39bf60c863b4d9633d1cc83b87632fb253 100644 (file)
@@ -26,7 +26,6 @@
 # include <QFileInfo>\r
 # include <QPointer>\r
 # include <QString>\r
-# include <Standard_math.hxx>\r
 # include <Standard_Version.hxx>\r
 # include <TopExp_Explorer.hxx>\r
 # include <TopoDS_Shape.hxx>\r
index e46d034e1ddfda81b73c02a28d8b96b3e2366954..aaa04fe24932e96177d91f8ec0cffb1f2d807d54 100644 (file)
@@ -23,7 +23,6 @@
 \r
 #include "PreCompiled.h"\r
 #ifndef _PreComp_\r
-# include <Standard_math.hxx>\r
 # include <QInputDialog>\r
 #endif\r
 \r
index 1f42410aaf90cb45d76273bdcffc8bddabd0aac0..7e35addbc5f851903c7140eacfea439b8ddecbdc 100644 (file)
@@ -28,7 +28,6 @@
 # include <QKeyEvent>\r
 \r
 # include <BRep_Builder.hxx>\r
-# include <Standard_math.hxx>\r
 # include <TopoDS.hxx>\r
 # include <TopoDS_Compound.hxx>\r
 \r
index 880586d3373c838b2ca2931e3475d3016e7073e4..61ff90578e20051a58bee3cbffe2751f44be981f 100644 (file)
@@ -25,7 +25,6 @@
 #ifndef _PreComp_\r
 # include <cfloat>\r
 \r
-# include <Standard_math.hxx>\r
 \r
 # include <Inventor/nodes/SoAnnotation.h>\r
 # include <Inventor/nodes/SoBaseColor.h>\r
index 554f7a405a678eb5548c7cd0136338dc0a5355eb..4ad97b08bd4b62fccf28e5f9b0630b6d297c4c58 100644 (file)
@@ -987,7 +987,11 @@ void ViewProviderPartExt::updateVisual()
 \r
             TopExp_Explorer xp;\r
             for (xp.Init(faceMap(i),TopAbs_EDGE);xp.More();xp.Next())\r
+#if OCC_VERSION_HEX >= 0x070800\r
+                faceEdges.insert(std::hash<TopoDS_Shape>{}(xp.Current()));\r
+#else\r
                 faceEdges.insert(xp.Current().HashCode(INT_MAX));\r
+#endif\r
             numFaces++;\r
         }\r
 \r
@@ -1015,7 +1019,11 @@ void ViewProviderPartExt::updateVisual()
             // So, we have to store the hashes of the edges associated to a face.\r
             // If the hash of a given edge is not in this list we know it's really\r
             // a free edge.\r
+#if OCC_VERSION_HEX >= 0x070800\r
+            int hash = std::hash<TopoDS_Shape>{}(aEdge);\r
+#else\r
             int hash = aEdge.HashCode(INT_MAX);\r
+#endif\r
             if (faceEdges.find(hash) == faceEdges.end()) {\r
                 Handle(Poly_Polygon3D) aPoly = Part::Tools::polygonOfEdge(aEdge, aLoc);\r
                 if (!aPoly.IsNull()) {\r
@@ -1214,7 +1222,11 @@ void ViewProviderPartExt::updateVisual()
             TopLoc_Location aLoc;\r
 \r
             // handling of the free edge that are not associated to a face\r
+#if OCC_VERSION_HEX >= 0x070800\r
+            int hash = std::hash<TopoDS_Shape>{}(aEdge);\r
+#else\r
             int hash = aEdge.HashCode(INT_MAX);\r
+#endif\r
             if (faceEdges.find(hash) == faceEdges.end()) {\r
                 Handle(Poly_Polygon3D) aPoly = Part::Tools::polygonOfEdge(aEdge, aLoc);\r
                 if (!aPoly.IsNull()) {\r
index 01b75aaa2a212f5cd562f5eee234735e500b95fc..94b2866ee670beeeee5846c0c2a28cfec615a7b2 100644 (file)
@@ -24,7 +24,6 @@
 #define PARTGUI_VIEWPROVIDERPARTEXT_H\r
 \r
 #include <map>\r
-#include <Standard_math.hxx>\r
 \r
 #include <App/PropertyUnits.h>\r
 #include <Gui/ViewProviderGeometryObject.h>\r
index f9210f90428c1556a265069d83231850cded9edf..1f9132cc3926516d0e52d97e428b962ad0b5cc87 100644 (file)
@@ -27,7 +27,6 @@
 # include <QMenu>\r
 # include <QTimer>\r
 \r
-# include <Standard_math.hxx>\r
 # include <TopExp.hxx>\r
 # include <TopTools_IndexedMapOfShape.hxx>\r
 \r
index e7fa75fe1ba3c45939c76d89869c0be1a783b988..1b6a1ff8d40924ccf16143c2eae09bb79373ccd8 100644 (file)
@@ -22,7 +22,6 @@
 \r
 #include "PreCompiled.h"\r
 \r
-#include <Standard_math.hxx>\r
 #ifndef _PreComp_\r
 # include <Inventor/nodes/SoSeparator.h>\r
 #endif\r
index b7a0219b3b23546c04eac07ccbdaf89b0419182e..af40af2fae657480bd6d8b1d138062b02a7da027 100644 (file)
@@ -24,7 +24,6 @@
 #ifndef PARTGUI_ViewProviderPartReference_H\r
 #define PARTGUI_ViewProviderPartReference_H\r
 \r
-#include <Standard_math.hxx>\r
 #include <Standard_Boolean.hxx>\r
 #include <TopoDS_Shape.hxx>\r
 #include <Gui/ViewProviderGeometryObject.h>\r
index 27a509c20c075fdeb8a4efb86ae9bc54b95057f7..443b7475075a55c1b8cc6c7d84d4b1f2a13eaea2 100644 (file)
@@ -22,7 +22,8 @@
 
 #include "PreCompiled.h"
 #ifndef _PreComp_
-# include <Standard_math.hxx>
+#define _USE_MATH_DEFINES
+# include <math.h>
 #endif
 
 #include <Base/Vector3D.h>
index f12ef8f9198569b610d4fb0751f63347b0009a2b..ed8cef500f313621c430c5b820560be08e718593 100644 (file)
@@ -38,8 +38,6 @@
 # define PathGuiExport
 #endif
 
-#include <Standard_math.hxx>
-
 #ifdef _MSC_VER
 # pragma warning( disable : 4273 )
 #endif
index eb2a061446e4c07774dd2e63f595906dcb67d883..e5496201ecec4e2788bda592e29b07194ad03ae9 100644 (file)
@@ -38,8 +38,6 @@
 # define RobotGuiExport\r
 #endif\r
 \r
-#include <Standard_math.hxx>\r
-\r
 #ifdef _MSC_VER\r
 # pragma warning(disable : 4005)\r
 # pragma warning(disable : 4273)\r
index dbfd423b999e7d34eaade442ae7f519f00c3030e..ceae48c4ef144047e931cd8c29487e90066f3d67 100644 (file)
@@ -23,7 +23,6 @@
 #include "PreCompiled.h"
 
 #ifndef _PreComp_
-#include <Standard_math.hxx>
 /// Qt Include Files
 #include <Inventor/sensors/SoSensor.h>
 #include <QApplication>