PartDesign: Modeling features work with faces

-Rename Sketchbased to ProfileBased to show new behavior
-Adopt ProfileBased to make the relevant helper functions work with faces too
-Adopt features for unified use of helper functions
-Adopt commands to allow face selection
This commit is contained in:
Stefan Tröger
2016-01-20 07:11:59 +01:00
parent 7dea66872e
commit f712f5e4ac
26 changed files with 417 additions and 203 deletions

View File

@@ -49,7 +49,7 @@
using namespace PartDesign;
PROPERTY_SOURCE(PartDesign::Loft, PartDesign::SketchBased)
PROPERTY_SOURCE(PartDesign::Loft, PartDesign::ProfileBased)
Loft::Loft()
{
@@ -68,7 +68,7 @@ short Loft::mustExecute() const
if (Closed.isTouched())
return 1;
return SketchBased::mustExecute();
return ProfileBased::mustExecute();
}
App::DocumentObjectExecReturn *Loft::execute(void)
@@ -76,12 +76,12 @@ App::DocumentObjectExecReturn *Loft::execute(void)
std::vector<TopoDS_Wire> wires;
try {
wires = getSketchWires();
wires = getProfileWires();
} catch (const Base::Exception& e) {
return new App::DocumentObjectExecReturn(e.what());
}
TopoDS_Shape sketchshape = makeFace(wires);
TopoDS_Shape sketchshape = getVerifiedFace();
if (sketchshape.IsNull())
return new App::DocumentObjectExecReturn("Loft: Creating a face from sketch failed");
@@ -145,7 +145,7 @@ App::DocumentObjectExecReturn *Loft::execute(void)
}
//build the top and bottom face, sew the shell and build the final solid
TopoDS_Shape front = makeFace(wires);
TopoDS_Shape front = getVerifiedFace();
front.Move(invObjLoc);
std::vector<TopoDS_Wire> backwires;
for(std::vector<TopoDS_Wire>& wires : wiresections)
@@ -213,7 +213,7 @@ App::DocumentObjectExecReturn *Loft::execute(void)
return App::DocumentObject::StdReturn;
return SketchBased::execute();
return ProfileBased::execute();
}
catch (Standard_Failure) {
Handle_Standard_Failure e = Standard_Failure::Caught();