PartDesign: change SubShapeBinder claim children behavior
This commit is contained in:
@@ -343,9 +343,26 @@ void ViewProviderSubShapeBinder::updatePlacement(bool transaction) {
|
||||
|
||||
std::vector<App::DocumentObject*> ViewProviderSubShapeBinder::claimChildren(void) const {
|
||||
std::vector<App::DocumentObject *> ret;
|
||||
auto self = dynamic_cast<PartDesign::SubShapeBinder*>(getObject());
|
||||
if(self && self->ClaimChildren.getValue() && self->Support.getValue())
|
||||
ret.push_back(self->Support.getValue());
|
||||
auto self = Base::freecad_dynamic_cast<PartDesign::SubShapeBinder>(getObject());
|
||||
if(self && self->ClaimChildren.getValue() && self->Support.getValue()) {
|
||||
std::set<App::DocumentObject *> objSet;
|
||||
for(auto &l : self->Support.getSubListValues()) {
|
||||
auto obj = l.getValue();
|
||||
if(!obj)
|
||||
continue;
|
||||
const auto &subs = l.getSubValues();
|
||||
if(subs.empty()) {
|
||||
if(objSet.insert(obj).second)
|
||||
ret.push_back(obj);
|
||||
continue;
|
||||
}
|
||||
for(auto &sub : subs) {
|
||||
auto sobj = obj->getSubObject(sub.c_str());
|
||||
if(sobj && objSet.insert(sobj).second)
|
||||
ret.push_back(sobj);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user