From 32ae033b43b9e82e54a917aa56f46ade4da2fc04 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 13 Feb 2022 22:30:17 +0100 Subject: [PATCH] PD: restore old method name and fix doxygen documentation --- src/Mod/PartDesign/App/FeatureExtrude.cpp | 60 ++++++++++++----------- src/Mod/PartDesign/App/FeatureExtrude.h | 58 +++++++++++----------- src/Mod/PartDesign/App/FeaturePad.cpp | 8 +-- src/Mod/PartDesign/App/FeaturePocket.cpp | 6 +-- 4 files changed, 67 insertions(+), 65 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureExtrude.cpp b/src/Mod/PartDesign/App/FeatureExtrude.cpp index 00c2dfe716..d0d053a5a1 100644 --- a/src/Mod/PartDesign/App/FeatureExtrude.cpp +++ b/src/Mod/PartDesign/App/FeatureExtrude.cpp @@ -126,16 +126,16 @@ Base::Vector3d FeatureExtrude::computeDirection(const Base::Vector3d& sketchVect return extrudeDirection; } -void FeatureExtrude::Extrude(TopoDS_Shape& prism, - const TopoDS_Shape& sketchshape, - const std::string& method, - const gp_Dir& direction, - const double L, - const double L2, - const double angle, - const double angle2, - const bool midplane, - const bool reversed) +void FeatureExtrude::generatePrism(TopoDS_Shape& prism, + const TopoDS_Shape& sketchshape, + const std::string& method, + const gp_Dir& direction, + const double L, + const double L2, + const double angle, + const double angle2, + const bool midplane, + const bool reversed) { if (method == "Length" || method == "TwoLengths" || method == "ThroughAll") { double Ltotal = L; @@ -205,15 +205,15 @@ void FeatureExtrude::Extrude(TopoDS_Shape& prism, } } -void FeatureExtrude::Extrude(TopoDS_Shape& prism, - const std::string& method, - const TopoDS_Shape& baseshape, - const TopoDS_Shape& profileshape, - const TopoDS_Face& supportface, - const TopoDS_Face& uptoface, - const gp_Dir& direction, - PrismMode Mode, - Standard_Boolean Modify) +void FeatureExtrude::generatePrism(TopoDS_Shape& prism, + const std::string& method, + const TopoDS_Shape& baseshape, + const TopoDS_Shape& profileshape, + const TopoDS_Face& supportface, + const TopoDS_Face& uptoface, + const gp_Dir& direction, + PrismMode Mode, + Standard_Boolean Modify) { if (method == "UpToFirst" || method == "UpToFace" || method == "UpToLast") { BRepFeat_MakePrism PrismMaker; @@ -240,24 +240,26 @@ void FeatureExtrude::Extrude(TopoDS_Shape& prism, } void FeatureExtrude::generateTaperedPrism(TopoDS_Shape& prism, - const TopoDS_Shape& sketchshape, - const std::string& method, - const gp_Dir& direction, - const double L, - const double L2, - const double angle, - const double angle2, - const bool midplane) + const TopoDS_Shape& sketchshape, + const std::string& method, + const gp_Dir& direction, + const double L, + const double L2, + const double angle, + const double angle2, + const bool midplane) { std::list drafts; bool isSolid = true; // in PD we only generate solids, while Part Extrude can also create only shells bool isPartDesign = true; // there is an OCC bug with single-edge wires (circles) we need to treat differently for PD and Part - if (method == "ThroughAll") + if (method == "ThroughAll") { Part::ExtrusionHelper::makeDraft(sketchshape, direction, getThroughAllLength(), 0.0, Base::toRadians(angle), 0.0, isSolid, drafts, isPartDesign); - else if (method == "TwoLengths") + } + else if (method == "TwoLengths") { Part::ExtrusionHelper::makeDraft(sketchshape, direction, L, L2, Base::toRadians(angle), Base::toRadians(angle2), isSolid, drafts, isPartDesign); + } else if (method == "Length") { if (midplane) { Part::ExtrusionHelper::makeDraft(sketchshape, direction, L / 2, L / 2, diff --git a/src/Mod/PartDesign/App/FeatureExtrude.h b/src/Mod/PartDesign/App/FeatureExtrude.h index 76c252e566..1fdcda41bf 100644 --- a/src/Mod/PartDesign/App/FeatureExtrude.h +++ b/src/Mod/PartDesign/App/FeatureExtrude.h @@ -68,18 +68,18 @@ protected: Base::Vector3d computeDirection(const Base::Vector3d& sketchVector); /** - * Generates an extrusion of the input sketchshape and stores it in the given &prism + * Generates an extrusion of the input sketchshape and stores it in the given \a prism */ - void Extrude(TopoDS_Shape& prism, - const TopoDS_Shape& sketchshape, - const std::string& method, - const gp_Dir& direction, - const double L, - const double L2, - const double angle, - const double angle2, - const bool midplane, - const bool reversed); + void generatePrism(TopoDS_Shape& prism, + const TopoDS_Shape& sketchshape, + const std::string& method, + const gp_Dir& direction, + const double L, + const double L2, + const double angle, + const double angle2, + const bool midplane, + const bool reversed); // See BRepFeat_MakePrism enum PrismMode { @@ -92,28 +92,28 @@ protected: * Generates an extrusion of the input profileshape * It will be a stand-alone solid created with BRepFeat_MakePrism */ - static void Extrude(TopoDS_Shape& prism, - const std::string& method, - const TopoDS_Shape& baseshape, - const TopoDS_Shape& profileshape, - const TopoDS_Face& sketchface, - const TopoDS_Face& uptoface, - const gp_Dir& direction, - PrismMode Mode, - Standard_Boolean Modify); + static void generatePrism(TopoDS_Shape& prism, + const std::string& method, + const TopoDS_Shape& baseshape, + const TopoDS_Shape& profileshape, + const TopoDS_Face& sketchface, + const TopoDS_Face& uptoface, + const gp_Dir& direction, + PrismMode Mode, + Standard_Boolean Modify); /** - * Generates a tapered prism of the input sketchshape and stores it in the given &prism + * Generates a tapered prism of the input sketchshape and stores it in the given \a prism */ void generateTaperedPrism(TopoDS_Shape& prism, - const TopoDS_Shape& sketchshape, - const std::string& method, - const gp_Dir& direction, - const double L, - const double L2, - const double angle, - const double angle2, - const bool midplane); + const TopoDS_Shape& sketchshape, + const std::string& method, + const gp_Dir& direction, + const double L, + const double L2, + const double angle, + const double angle2, + const bool midplane); }; } //namespace PartDesign diff --git a/src/Mod/PartDesign/App/FeaturePad.cpp b/src/Mod/PartDesign/App/FeaturePad.cpp index 43f4b7262f..02dba2bd54 100644 --- a/src/Mod/PartDesign/App/FeaturePad.cpp +++ b/src/Mod/PartDesign/App/FeaturePad.cpp @@ -190,7 +190,7 @@ App::DocumentObjectExecReturn *Pad::execute() supportface = TopoDS_Face(); PrismMode mode = PrismMode::None; - Extrude(prism, method, base, sketchshape, supportface, upToFace, dir, mode, Standard_True); + generatePrism(prism, method, base, sketchshape, supportface, upToFace, dir, mode, Standard_True); base.Nullify(); } else { @@ -207,12 +207,12 @@ App::DocumentObjectExecReturn *Pad::execute() if (!Ex.More()) supportface = TopoDS_Face(); PrismMode mode = PrismMode::None; - Extrude(prism, method, base, sketchshape, supportface, upToFace, dir, mode, Standard_True); + generatePrism(prism, method, base, sketchshape, supportface, upToFace, dir, mode, Standard_True); } } else { - Extrude(prism, sketchshape, method, dir, L, L2, - TaperAngle.getValue(), TaperAngle2.getValue(), hasMidplane, hasReversed); + generatePrism(prism, sketchshape, method, dir, L, L2, + TaperAngle.getValue(), TaperAngle2.getValue(), hasMidplane, hasReversed); } if (prism.IsNull()) diff --git a/src/Mod/PartDesign/App/FeaturePocket.cpp b/src/Mod/PartDesign/App/FeaturePocket.cpp index 1c0e11346f..ac5d96b63c 100644 --- a/src/Mod/PartDesign/App/FeaturePocket.cpp +++ b/src/Mod/PartDesign/App/FeaturePocket.cpp @@ -200,7 +200,7 @@ App::DocumentObjectExecReturn *Pocket::execute() supportface = TopoDS_Face(); TopoDS_Shape prism; PrismMode mode = PrismMode::CutFromBase; - Extrude(prism, method, base, profileshape, supportface, upToFace, dir, mode, Standard_True); + generatePrism(prism, method, base, profileshape, supportface, upToFace, dir, mode, Standard_True); // And the really expensive way to get the SubShape... BRepAlgoAPI_Cut mkCut(base, prism); @@ -219,8 +219,8 @@ App::DocumentObjectExecReturn *Pocket::execute() } else { TopoDS_Shape prism; - Extrude(prism, profileshape, method, dir, L, L2, TaperAngle.getValue(), TaperAngle2.getValue(), - Midplane.getValue(), Reversed.getValue()); + generatePrism(prism, profileshape, method, dir, L, L2, TaperAngle.getValue(), TaperAngle2.getValue(), + Midplane.getValue(), Reversed.getValue()); if (prism.IsNull()) return new App::DocumentObjectExecReturn("Pocket: Resulting shape is empty");