From c9957b8a98e71b2a69c71b9f92acf1cf01afcc35 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 2 Sep 2017 12:04:07 +0200 Subject: [PATCH] Port to occ7.2: + use default constructor of BRepOffsetAPI_MakeOffsetShape since overloaded versions are deprecated + use default constructor of BRepOffsetAPI_MakeThickSolid since overloaded versions are deprecated + fix small bug in MeshVertex --- src/Mod/Part/App/TopoShape.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 2d18d7298c..9f2935a3cc 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -2203,10 +2203,19 @@ TopoDS_Shape TopoShape::makeOffsetShape(double offset, double tol, bool intersec bool selfInter, short offsetMode, short join, bool fill) const { +#if OCC_VERSION_HEX < 0x070200 BRepOffsetAPI_MakeOffsetShape mkOffset(this->_Shape, offset, tol, BRepOffset_Mode(offsetMode), intersection ? Standard_True : Standard_False, selfInter ? Standard_True : Standard_False, GeomAbs_JoinType(join)); +#else + BRepOffsetAPI_MakeOffsetShape mkOffset; + mkOffset.PerformByJoin(this->_Shape, offset, tol, BRepOffset_Mode(offsetMode), + intersection ? Standard_True : Standard_False, + selfInter ? Standard_True : Standard_False, + GeomAbs_JoinType(join)); +#endif + if (!mkOffset.IsDone()) Standard_Failure::Raise("BRepOffsetAPI_MakeOffsetShape not done"); const TopoDS_Shape& res = mkOffset.Shape(); @@ -2612,10 +2621,19 @@ TopoDS_Shape TopoShape::makeThickSolid(const TopTools_ListOfShape& remFace, double offset, double tol, bool intersection, bool selfInter, short offsetMode, short join) const { +#if OCC_VERSION_HEX < 0x070200 BRepOffsetAPI_MakeThickSolid mkThick(this->_Shape, remFace, offset, tol, BRepOffset_Mode(offsetMode), intersection ? Standard_True : Standard_False, selfInter ? Standard_True : Standard_False, GeomAbs_JoinType(join)); +#else + BRepOffsetAPI_MakeThickSolid mkThick; + mkThick.MakeThickSolidByJoin(this->_Shape, remFace, offset, tol, BRepOffset_Mode(offsetMode), + intersection ? Standard_True : Standard_False, + selfInter ? Standard_True : Standard_False, + GeomAbs_JoinType(join)); +#endif + return mkThick.Shape(); } @@ -2912,7 +2930,7 @@ struct MeshVertex { } MeshVertex(const Base::Vector3d& p) - : x(p.x),y(p.y),z(z),i(0) + : x(p.x),y(p.y),z(p.z),i(0) { }