From 3c8404fd09e8ceee7427b2bab09d6f353ddac099 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 9 Aug 2022 18:42:38 +0200 Subject: [PATCH] Part: fix build failures with OCC >= 7.6 --- src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp | 4 ++++ src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.h | 9 ++++++--- src/Mod/Part/App/FaceMaker.cpp | 4 ++++ src/Mod/Part/App/FaceMaker.h | 8 ++++++-- src/Mod/Part/App/FeatureExtrusion.cpp | 4 ++++ src/Mod/Part/App/FeatureExtrusion.h | 7 ++++++- src/Mod/Part/App/modelRefine.cpp | 4 ++++ src/Mod/Part/App/modelRefine.h | 15 ++++++++------- 8 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp index 4ada878a8f..e562d6be77 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp +++ b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp @@ -107,7 +107,11 @@ void BRepOffsetAPI_MakeOffsetFix::Perform (const Standard_Real Offset, const Sta mkOffset.Perform(Offset, Alt); } +#if OCC_VERSION_HEX >= 0x070600 +void BRepOffsetAPI_MakeOffsetFix::Build(const Message_ProgressRange&) +#else void BRepOffsetAPI_MakeOffsetFix::Build() +#endif { mkOffset.Build(); } diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.h b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.h index 7b0d55f9eb..654ab1299a 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.h +++ b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.h @@ -27,8 +27,7 @@ #include #include #include -#include -#include +#include namespace Part { /*! @@ -54,7 +53,11 @@ public: void Perform (const Standard_Real Offset, const Standard_Real Alt = 0.0); //! Builds the resulting shape (redefined from MakeShape). - void Build(); +#if OCC_VERSION_HEX >= 0x070600 + void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) override; +#else + void Build() override; +#endif //! Initializes the algorithm to construct parallels to the spine Spine. //! Join defines the type of parallel generated by the diff --git a/src/Mod/Part/App/FaceMaker.cpp b/src/Mod/Part/App/FaceMaker.cpp index d01b65a270..d4e39c6388 100644 --- a/src/Mod/Part/App/FaceMaker.cpp +++ b/src/Mod/Part/App/FaceMaker.cpp @@ -83,7 +83,11 @@ const TopoDS_Face& Part::FaceMaker::Face() return TopoDS::Face(sh); } +#if OCC_VERSION_HEX >= 0x070600 +void Part::FaceMaker::Build(const Message_ProgressRange&) +#else void Part::FaceMaker::Build() +#endif { this->NotDone(); this->myShapesToReturn.clear(); diff --git a/src/Mod/Part/App/FaceMaker.h b/src/Mod/Part/App/FaceMaker.h index dc21eeab85..79489a3208 100644 --- a/src/Mod/Part/App/FaceMaker.h +++ b/src/Mod/Part/App/FaceMaker.h @@ -24,7 +24,7 @@ #define PART_FACEMAKER_H #include -#include +#include #include #include #include @@ -74,7 +74,11 @@ public: */ virtual const TopoDS_Face& Face(); - virtual void Build(); +#if OCC_VERSION_HEX >= 0x070600 + void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) override; +#else + void Build() override; +#endif //fails to compile, huh! //virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape &S) override {throwNotImplemented();} diff --git a/src/Mod/Part/App/FeatureExtrusion.cpp b/src/Mod/Part/App/FeatureExtrusion.cpp index 67e1978217..c6829a5a64 100644 --- a/src/Mod/Part/App/FeatureExtrusion.cpp +++ b/src/Mod/Part/App/FeatureExtrusion.cpp @@ -344,7 +344,11 @@ std::string FaceMakerExtrusion::getBriefExplanation() const return std::string(QT_TRANSLATE_NOOP("Part_FaceMaker", "Supports making faces with holes, does not support nesting.")); } +#if OCC_VERSION_HEX >= 0x070600 +void FaceMakerExtrusion::Build(const Message_ProgressRange&) +#else void FaceMakerExtrusion::Build() +#endif { this->NotDone(); this->myGenerated.Clear(); diff --git a/src/Mod/Part/App/FeatureExtrusion.h b/src/Mod/Part/App/FeatureExtrusion.h index 9b3dcfb309..1e1763ebd7 100644 --- a/src/Mod/Part/App/FeatureExtrusion.h +++ b/src/Mod/Part/App/FeatureExtrusion.h @@ -136,7 +136,12 @@ public: virtual std::string getUserFriendlyName() const override; virtual std::string getBriefExplanation() const override; - virtual void Build() override; +#if OCC_VERSION_HEX >= 0x070600 + void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) override; +#else + void Build() override; +#endif + protected: virtual void Build_Essence() override {} }; diff --git a/src/Mod/Part/App/modelRefine.cpp b/src/Mod/Part/App/modelRefine.cpp index ada41fe931..1d1fc6bcaa 100644 --- a/src/Mod/Part/App/modelRefine.cpp +++ b/src/Mod/Part/App/modelRefine.cpp @@ -1223,7 +1223,11 @@ Part::BRepBuilderAPI_RefineModel::BRepBuilderAPI_RefineModel(const TopoDS_Shape& Build(); } +#if OCC_VERSION_HEX >= 0x070600 +void Part::BRepBuilderAPI_RefineModel::Build(const Message_ProgressRange&) +#else void Part::BRepBuilderAPI_RefineModel::Build() +#endif { if (myShape.IsNull()) Standard_Failure::Raise("Cannot remove splitter from empty shape"); diff --git a/src/Mod/Part/App/modelRefine.h b/src/Mod/Part/App/modelRefine.h index 5ba8e6a950..284cffd2b2 100644 --- a/src/Mod/Part/App/modelRefine.h +++ b/src/Mod/Part/App/modelRefine.h @@ -28,10 +28,7 @@ #include #include #include -#include -#include -#include -#include +#include #include #include #include @@ -198,9 +195,13 @@ class PartExport BRepBuilderAPI_RefineModel : public BRepBuilderAPI_MakeShape { public: BRepBuilderAPI_RefineModel(const TopoDS_Shape&); - void Build(); - const TopTools_ListOfShape& Modified(const TopoDS_Shape& S); - Standard_Boolean IsDeleted(const TopoDS_Shape& S); +#if OCC_VERSION_HEX >= 0x070600 + void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) override; +#else + void Build() override; +#endif + const TopTools_ListOfShape& Modified(const TopoDS_Shape& S) override; + Standard_Boolean IsDeleted(const TopoDS_Shape& S) override; private: void LogModifications(const ModelRefine::FaceUniter& uniter);