From d2d0b7f01884bf2c8838c07f4389c9e64fc703b5 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 18 Oct 2022 22:21:13 +0800 Subject: [PATCH] Fix build warning with OCC 7.6 --- src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp | 7 +++++++ src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.h | 6 +++++- src/Mod/Part/App/FaceMaker.cpp | 4 ++++ src/Mod/Part/App/FaceMaker.h | 4 ++++ src/Mod/Part/App/FeatureExtrusion.cpp | 4 ++++ src/Mod/Part/App/FeatureExtrusion.h | 4 ++++ src/Mod/Part/App/modelRefine.cpp | 4 ++++ src/Mod/Part/App/modelRefine.h | 6 +++++- 8 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp index 8c160c76c9..939902f2a1 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp +++ b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp @@ -102,10 +102,17 @@ 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& theRange) +{ + mkOffset.Build(theRange); +} +#else void BRepOffsetAPI_MakeOffsetFix::Build() { mkOffset.Build(); } +#endif void BRepOffsetAPI_MakeOffsetFix::Init(const TopoDS_Face& Spine, const GeomAbs_JoinType Join, const Standard_Boolean IsOpenResult) diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.h b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.h index 7b0d55f9eb..ce3a7ea5fe 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.h +++ b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.h @@ -54,7 +54,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 + virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()); +#else + virtual void Build(); +#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 4b8b457955..fcdef3537f 100644 --- a/src/Mod/Part/App/FaceMaker.cpp +++ b/src/Mod/Part/App/FaceMaker.cpp @@ -108,7 +108,11 @@ const Part::TopoShape &Part::FaceMaker::getTopoShape() const{ return this->myTopoShape; } +#if OCC_VERSION_HEX >= 0x070600 +void Part::FaceMaker::Build(const Message_ProgressRange&) +#else void Part::FaceMaker::Build() +#endif { this->NotDone(); this->myShapesToReturn = this->myInputFaces; diff --git a/src/Mod/Part/App/FaceMaker.h b/src/Mod/Part/App/FaceMaker.h index cc9b762b93..6a09c83407 100644 --- a/src/Mod/Part/App/FaceMaker.h +++ b/src/Mod/Part/App/FaceMaker.h @@ -84,7 +84,11 @@ public: */ virtual const TopoDS_Face& Face(); +#if OCC_VERSION_HEX >= 0x070600 + virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()); +#else virtual void Build(); +#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 a1de6916ad..c8c4dbfced 100644 --- a/src/Mod/Part/App/FeatureExtrusion.cpp +++ b/src/Mod/Part/App/FeatureExtrusion.cpp @@ -390,7 +390,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 f9f608591d..b0b9492820 100644 --- a/src/Mod/Part/App/FeatureExtrusion.h +++ b/src/Mod/Part/App/FeatureExtrusion.h @@ -118,7 +118,11 @@ public: virtual std::string getUserFriendlyName() const override; virtual std::string getBriefExplanation() const override; +#if OCC_VERSION_HEX >= 0x070600 + virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) override; +#else virtual 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 d20e4724ee..e3be57321b 100644 --- a/src/Mod/Part/App/modelRefine.cpp +++ b/src/Mod/Part/App/modelRefine.cpp @@ -1228,7 +1228,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 8f1f19a5fa..8bdb9034a2 100644 --- a/src/Mod/Part/App/modelRefine.h +++ b/src/Mod/Part/App/modelRefine.h @@ -198,7 +198,11 @@ class PartExport BRepBuilderAPI_RefineModel : public BRepBuilderAPI_MakeShape { public: BRepBuilderAPI_RefineModel(const TopoDS_Shape&); - void Build(); +#if OCC_VERSION_HEX >= 0x070600 + virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()); +#else + virtual void Build(); +#endif const TopTools_ListOfShape& Modified(const TopoDS_Shape& S); Standard_Boolean IsDeleted(const TopoDS_Shape& S);