cleanup: fill type into superclass

Fill type translation gets into superclass BSurf
This commit is contained in:
balazs-bamer
2015-01-02 18:27:16 +01:00
committed by wmayer
parent 1fb63c097e
commit 1311d5cf2c
3 changed files with 16 additions and 16 deletions

View File

@@ -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;

View File

@@ -26,6 +26,7 @@
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/PropertyLinks.h>
#include <GeomFill_BezierCurves.hxx>
#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);
};

View File

@@ -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