Part: reversed -- fix so it works with App::Links and App::Parts
This commit is contained in:
@@ -119,13 +119,13 @@ App::DocumentObjectExecReturn *RuledSurface::execute(void)
|
||||
// get the first input shape
|
||||
TopoDS_Shape S1;
|
||||
ret = getShape(Curve1, S1);
|
||||
if (ret)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
// get the second input shape
|
||||
TopoDS_Shape S2;
|
||||
ret = getShape(Curve2, S2);
|
||||
if (ret)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
// check for expected type
|
||||
@@ -711,16 +711,21 @@ Reverse::Reverse()
|
||||
|
||||
App::DocumentObjectExecReturn* Reverse::execute(void)
|
||||
{
|
||||
Part::Feature* source = Source.getValue<Part::Feature*>();
|
||||
if (!source)
|
||||
App::DocumentObject* source = Source.getValue<App::DocumentObject*>();
|
||||
Part::TopoShape topoShape = Part::Feature::getShape(source);
|
||||
if (topoShape.isNull())
|
||||
return new App::DocumentObjectExecReturn("No part object linked.");
|
||||
|
||||
try {
|
||||
TopoDS_Shape myShape = source->Shape.getValue();
|
||||
if (!myShape.IsNull())
|
||||
TopoDS_Shape myShape = topoShape.getShape();
|
||||
if (!myShape.IsNull()){
|
||||
this->Shape.setValue(myShape.Reversed());
|
||||
this->Placement.setValue(source->Placement.getValue());
|
||||
return App::DocumentObject::StdReturn;
|
||||
Base::Placement p;
|
||||
p.fromMatrix(topoShape.getTransform());
|
||||
this->Placement.setValue(p);
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
return new App::DocumentObjectExecReturn("Shape is null.");
|
||||
}
|
||||
catch (Standard_Failure & e) {
|
||||
return new App::DocumentObjectExecReturn(e.GetMessageString());
|
||||
|
||||
Reference in New Issue
Block a user