Some fixes in Body visualls (ongoing)

This commit is contained in:
jriegel
2013-01-02 12:31:04 +01:00
committed by Stefan Tröger
parent 96f2a734ae
commit 39d6d914a8
5 changed files with 91 additions and 17 deletions

View File

@@ -27,6 +27,7 @@
#include <Base/Placement.h>
#include "Feature.h"
#include "Body.h"
#include "BodyPy.h"
@@ -52,7 +53,23 @@ short Body::mustExecute() const
App::DocumentObjectExecReturn *Body::execute(void)
{
// TODO right selection for Body
App::DocumentObject* link = Tip.getValue();
if (!link)
//return new App::DocumentObjectExecReturn("No object!");
return App::DocumentObject::StdReturn;
if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))
return new App::DocumentObjectExecReturn("Linked object is not a PartDesign object");
//return App::DocumentObject::StdReturn;
// get the shape of the tip
const Part::TopoShape& TipShape = static_cast<Part::Feature*>(link)->Shape.getShape();
if (TipShape._Shape.IsNull())
//return new App::DocumentObjectExecReturn("empty shape");
return App::DocumentObject::StdReturn;
Shape.setValue(TipShape);
return App::DocumentObject::StdReturn;
}