Toposhape/Part: Cleanup and tests for FeatureCompound and FeatureRevolution
This commit is contained in:
@@ -66,10 +66,6 @@ App::DocumentObjectExecReturn *Compound::execute()
|
||||
TopoDS_Compound comp;
|
||||
builder.MakeCompound(comp);
|
||||
|
||||
// avoid duplicates without changing the order
|
||||
// See also ViewProviderCompound::updateData
|
||||
std::set<DocumentObject*> tempLinks;
|
||||
|
||||
const std::vector<DocumentObject*>& links = Links.getValues();
|
||||
for (auto link : links) {
|
||||
if (link) {
|
||||
@@ -102,12 +98,14 @@ App::DocumentObjectExecReturn *Compound::execute()
|
||||
return App::DocumentObject::StdReturn;
|
||||
#else
|
||||
std::vector<TopoShape> shapes;
|
||||
for(auto obj : Links.getValues()) {
|
||||
if(!tempLinks.insert(obj).second)
|
||||
for (auto obj : Links.getValues()) {
|
||||
if (!tempLinks.insert(obj).second) {
|
||||
continue;
|
||||
}
|
||||
auto sh = Feature::getTopoShape(obj);
|
||||
if(!sh.isNull())
|
||||
if (!sh.isNull()) {
|
||||
shapes.push_back(sh);
|
||||
}
|
||||
}
|
||||
this->Shape.setValue(TopoShape().makeElementCompound(shapes));
|
||||
return Part::Feature::execute();
|
||||
|
||||
@@ -191,9 +191,13 @@ App::DocumentObjectExecReturn *Revolution::execute()
|
||||
return App::DocumentObject::StdReturn;
|
||||
#else
|
||||
TopoShape revolve(0);
|
||||
revolve.makeElementRevolve(sourceShape,revAx,angle,Solid.getValue()?FaceMakerClass.getValue():0);
|
||||
if (revolve.isNull())
|
||||
revolve.makeElementRevolve(sourceShape,
|
||||
revAx,
|
||||
angle,
|
||||
Solid.getValue() ? FaceMakerClass.getValue() : 0);
|
||||
if (revolve.isNull()) {
|
||||
return new App::DocumentObjectExecReturn("Resulting shape is null");
|
||||
}
|
||||
this->Shape.setValue(revolve);
|
||||
return Part::Feature::execute();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user