From fbef2d7ced70f9c93a3888dffe701fceee9fc0f0 Mon Sep 17 00:00:00 2001 From: balazs-bamer Date: Fri, 2 Jan 2015 18:27:16 +0100 Subject: [PATCH] cleanup: fill type into superclass Fill type translation gets into superclass BSurf --- src/Mod/Surface/App/FeatureBSurf.cpp | 13 +++++++++++++ src/Mod/Surface/App/FeatureBSurf.h | 2 ++ src/Mod/Surface/App/FeatureBezSurf.cpp | 17 +---------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Mod/Surface/App/FeatureBSurf.cpp b/src/Mod/Surface/App/FeatureBSurf.cpp index 9f0fcacd3f..4a86082225 100644 --- a/src/Mod/Surface/App/FeatureBSurf.cpp +++ b/src/Mod/Surface/App/FeatureBSurf.cpp @@ -43,10 +43,23 @@ short BSurf::mustExecute() const { if (aBList.isTouched() || filltype.isTouched()) + { return 1; + } return 0; } +GeomFill_FillingStyle BSurf::getFillingStyle() +{ + //Identify filling style + int ftype = filltype.getValue(); + if(ftype==StretchStyle) {return GeomFill_StretchStyle;} + else if(ftype==CoonsStyle) {return GeomFill_CoonsStyle;} + else if(ftype==CurvedStyle) {return GeomFill_CurvedStyle;} + else {Standard_Failure::Raise("Filling style must be 1 (Stretch), 2 (Coons), or 3 (Curved).");} +} + + void BSurf::getWire(TopoDS_Wire& aWire) { Handle(ShapeFix_Wire) aShFW = new ShapeFix_Wire; diff --git a/src/Mod/Surface/App/FeatureBSurf.h b/src/Mod/Surface/App/FeatureBSurf.h index 719b55e031..b6d5831dc6 100644 --- a/src/Mod/Surface/App/FeatureBSurf.h +++ b/src/Mod/Surface/App/FeatureBSurf.h @@ -26,6 +26,7 @@ #include #include #include +#include #include "Mod/Part/App/PartFeature.h" namespace Surface @@ -45,6 +46,7 @@ public: short mustExecute() const; protected: + GeomFill_FillingStyle getFillingStyle(); void getWire(TopoDS_Wire& aWire); }; diff --git a/src/Mod/Surface/App/FeatureBezSurf.cpp b/src/Mod/Surface/App/FeatureBezSurf.cpp index 83af828cc0..f9e3b20a1e 100644 --- a/src/Mod/Surface/App/FeatureBezSurf.cpp +++ b/src/Mod/Surface/App/FeatureBezSurf.cpp @@ -72,24 +72,9 @@ struct crvs{ App::DocumentObjectExecReturn *BezSurf::execute(void) { - - //Set Variables - - int ftype = filltype.getValue(); - //Begin Construction try{ - - //Identify filling style - - GeomFill_FillingStyle fstyle; - if(ftype==StretchStyle) {fstyle = GeomFill_StretchStyle;} - else if(ftype==CoonsStyle) {fstyle = GeomFill_CoonsStyle;} - else if(ftype==CurvedStyle) {fstyle = GeomFill_CurvedStyle;} - else {return new App::DocumentObjectExecReturn("Filling style must be 1 (Stretch), 2 (Coons), or 3 (Curved).");} - - //Create Bezier Surface - + GeomFill_FillingStyle fstyle = getFillingStyle(); GeomFill_BezierCurves aSurfBuilder; //Create Surface Builder TopoDS_Wire aWire; //Create empty wire