Allow GroupExtension as Source for Views
- DrawViewPart had special case logic for App::Part. It now handles DocumentObjectGroup and any other GroupExtensions as Source.
This commit is contained in:
@@ -119,40 +119,6 @@ void DrawViewMulti::onChanged(const App::Property* prop)
|
||||
DrawViewPart::onChanged(prop);
|
||||
}
|
||||
|
||||
TopoDS_Shape DrawViewMulti::getSourceShape(void) const
|
||||
{
|
||||
TopoDS_Shape result;
|
||||
const std::vector<App::DocumentObject*>& links = Sources.getValues();
|
||||
if (links.empty()) {
|
||||
Base::Console().Log("DVM::execute - No Sources - creation? - %s\n",getNameInDocument());
|
||||
} else {
|
||||
BRep_Builder builder;
|
||||
TopoDS_Compound comp;
|
||||
builder.MakeCompound(comp);
|
||||
for (auto& l:links) {
|
||||
if (l->isDerivedFrom(Part::Feature::getClassTypeId())){
|
||||
const Part::TopoShape &partTopo = static_cast<Part::Feature*>(l)->Shape.getShape();
|
||||
if (partTopo.isNull()) {
|
||||
continue; //has no shape
|
||||
}
|
||||
BRepBuilderAPI_Copy BuilderCopy(partTopo.getShape());
|
||||
TopoDS_Shape shape = BuilderCopy.Shape();
|
||||
builder.Add(comp, shape);
|
||||
} else if (l->getTypeId().isDerivedFrom(App::Part::getClassTypeId())) {
|
||||
TopoDS_Shape s = getShapeFromPart(static_cast<App::Part*>(l));
|
||||
if (s.IsNull()) {
|
||||
continue;
|
||||
}
|
||||
BRepBuilderAPI_Copy BuilderCopy(s);
|
||||
TopoDS_Shape shape = BuilderCopy.Shape();
|
||||
builder.Add(comp, shape);
|
||||
}
|
||||
}
|
||||
result = comp;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *DrawViewMulti::execute(void)
|
||||
{
|
||||
if (!keepUpdated()) {
|
||||
|
||||
Reference in New Issue
Block a user