Corrected feature property names
aBList -> BoundaryList filltype -> FillType
This commit is contained in:
@@ -89,7 +89,7 @@ App::DocumentObjectExecReturn *BSplineSurf::execute(void)
|
||||
|
||||
GeomFill_FillingStyle fstyle = getFillingStyle();
|
||||
GeomFill_BSplineCurves aSurfBuilder; //Create Surface Builder
|
||||
int ncrv = aBList.getSize();
|
||||
int ncrv = BoundaryList.getSize();
|
||||
if(ncrv==2) {aSurfBuilder.Init(crvs[0], crvs[1], fstyle);}
|
||||
else if(ncrv==3) {aSurfBuilder.Init(crvs[0], crvs[1], crvs[2], fstyle);}
|
||||
else if(ncrv==4) {aSurfBuilder.Init(crvs[0], crvs[1], crvs[2], crvs[3], fstyle);}
|
||||
|
||||
@@ -46,16 +46,16 @@ PROPERTY_SOURCE(Surface::BSurf, Part::Feature)
|
||||
|
||||
BSurf::BSurf(): Feature()
|
||||
{
|
||||
ADD_PROPERTY(filltype,(1));
|
||||
ADD_PROPERTY(aBList,(0,"Dummy"));
|
||||
ADD_PROPERTY(FillType,(1));
|
||||
ADD_PROPERTY(BoundaryList,(0,"Dummy"));
|
||||
}
|
||||
|
||||
|
||||
//Check if any components of the surface have been modified
|
||||
short BSurf::mustExecute() const
|
||||
{
|
||||
if (aBList.isTouched() ||
|
||||
filltype.isTouched())
|
||||
if (BoundaryList.isTouched() ||
|
||||
FillType.isTouched())
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ short BSurf::mustExecute() const
|
||||
GeomFill_FillingStyle BSurf::getFillingStyle()
|
||||
{
|
||||
//Identify filling style
|
||||
int ftype = filltype.getValue();
|
||||
int ftype = FillType.getValue();
|
||||
if(ftype==StretchStyle) {return GeomFill_StretchStyle;}
|
||||
else if(ftype==CoonsStyle) {return GeomFill_CoonsStyle;}
|
||||
else if(ftype==CurvedStyle) {return GeomFill_CurvedStyle;}
|
||||
@@ -78,16 +78,16 @@ void BSurf::getWire(TopoDS_Wire& aWire)
|
||||
Handle(ShapeFix_Wire) aShFW = new ShapeFix_Wire;
|
||||
Handle(ShapeExtend_WireData) aWD = new ShapeExtend_WireData;
|
||||
|
||||
if(aBList.getSize()>4 || aBList.getSize()<2){Standard_Failure::Raise("Only 2-4 curves are allowed");return;}
|
||||
if(BoundaryList.getSize()>4 || BoundaryList.getSize()<2){Standard_Failure::Raise("Only 2-4 curves are allowed");return;}
|
||||
|
||||
for(int i=0; i<aBList.getSize(); i++){
|
||||
for(int i=0; i<BoundaryList.getSize(); i++){
|
||||
|
||||
Part::TopoShape ts; //Curve TopoShape
|
||||
TopoDS_Shape sub; //Curve TopoDS_Shape
|
||||
TopoDS_Edge etmp; //Curve TopoDS_Edge
|
||||
|
||||
//Get Edge
|
||||
App::PropertyLinkSubList::SubSet set = aBList[i];
|
||||
App::PropertyLinkSubList::SubSet set = BoundaryList[i];
|
||||
|
||||
if(set.obj->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) {
|
||||
|
||||
@@ -144,9 +144,9 @@ void BSurf::createFace(const Handle_Geom_BoundedSurface &aSurface)
|
||||
|
||||
void BSurf::correcteInvalidFillType()
|
||||
{
|
||||
int ftype = filltype.getValue();
|
||||
int ftype = FillType.getValue();
|
||||
if(ftype == InvalidStyle)
|
||||
{
|
||||
filltype.setValue(StretchStyle);
|
||||
FillType.setValue(StretchStyle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ class BSurf : public Part::Feature
|
||||
|
||||
public:
|
||||
BSurf();
|
||||
App::PropertyLinkSubList aBList; //curves to be turned into a face (2-4 curves allowed).
|
||||
App::PropertyInteger filltype; //Fill method (1, 2, or 3 for Stretch, Coons, and Curved)
|
||||
App::PropertyLinkSubList BoundaryList; //curves to be turned into a face (2-4 curves allowed).
|
||||
App::PropertyInteger FillType; //Fill method (1, 2, or 3 for Stretch, Coons, and Curved)
|
||||
|
||||
short mustExecute() const;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ App::DocumentObjectExecReturn *BezSurf::execute(void)
|
||||
|
||||
GeomFill_FillingStyle fstyle = getFillingStyle();
|
||||
GeomFill_BezierCurves aSurfBuilder; //Create Surface Builder
|
||||
int ncrv = aBList.getSize();
|
||||
int ncrv = BoundaryList.getSize();
|
||||
if(ncrv==2) {aSurfBuilder.Init(crvs[0], crvs[1], fstyle);}
|
||||
else if(ncrv==3) {aSurfBuilder.Init(crvs[0], crvs[1], crvs[2], fstyle);}
|
||||
else if(ncrv==4) {aSurfBuilder.Init(crvs[0], crvs[1], crvs[2], crvs[3], fstyle);}
|
||||
|
||||
@@ -97,7 +97,7 @@ BSurf::~BSurf()
|
||||
void BSurf::setEditedObject(Surface::BSurf* obj)
|
||||
{
|
||||
editedObject = obj;
|
||||
oldFillType = (filltype_t)(editedObject->filltype.getValue());
|
||||
oldFillType = (filltype_t)(editedObject->FillType.getValue());
|
||||
switch(oldFillType)
|
||||
{
|
||||
case StretchStyle:
|
||||
@@ -152,9 +152,9 @@ void BSurf::reject()
|
||||
else
|
||||
{
|
||||
// if the object fill type was changed, reset the old one
|
||||
if(editedObject->filltype.getValue() != oldFillType)
|
||||
if(editedObject->FillType.getValue() != oldFillType)
|
||||
{
|
||||
editedObject->filltype.setValue(oldFillType);
|
||||
editedObject->FillType.setValue(oldFillType);
|
||||
}
|
||||
Gui::Command::commitCommand();
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()");
|
||||
@@ -165,9 +165,9 @@ void BSurf::reject()
|
||||
void BSurf::apply()
|
||||
{
|
||||
// apply the change only if it is a real change
|
||||
if(editedObject->filltype.getValue() != fillType)
|
||||
if(editedObject->FillType.getValue() != fillType)
|
||||
{
|
||||
editedObject->filltype.setValue(fillType);
|
||||
editedObject->FillType.setValue(fillType);
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user