Made the rest of the PartDesign features aware of the Body

This commit is contained in:
jrheinlaender
2013-04-21 09:24:12 +04:30
committed by Stefan Tröger
parent 4bb14de504
commit 7330d4357e
19 changed files with 923 additions and 746 deletions

View File

@@ -87,12 +87,14 @@ App::DocumentObjectExecReturn *Draft::execute(void)
{
// Get parameters
// Base shape
App::DocumentObject* link = Base.getValue();
App::DocumentObject* link = BaseFeature.getValue();
if (!link)
link = Base.getValue(); // For legacy features
if (!link)
return new App::DocumentObjectExecReturn("No object linked");
if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))
return new App::DocumentObjectExecReturn("Linked object is not a Part object");
Part::Feature *base = static_cast<Part::Feature*>(Base.getValue());
Part::Feature *base = static_cast<Part::Feature*>(link);
const Part::TopoShape& TopShape = base->Shape.getShape();
if (TopShape._Shape.IsNull())
return new App::DocumentObjectExecReturn("Cannot draft invalid shape");
@@ -239,7 +241,7 @@ App::DocumentObjectExecReturn *Draft::execute(void)
if (reversed)
angle *= -1.0;
this->positionByBase();
this->positionByBaseFeature();
// create an untransformed copy of the base shape
Part::TopoShape baseShape(TopShape);
baseShape.setTransform(Base::Matrix4D());