Prevent cross GeoFeatureGroup links on recompute

This commit is contained in:
Stefan Tröger
2017-06-05 08:41:55 +02:00
committed by wmayer
parent 85125f2a49
commit 2b7e0dc327
5 changed files with 32 additions and 12 deletions

View File

@@ -305,6 +305,20 @@ void GeoFeatureGroupExtension::getCSRelevantLinks(DocumentObject* obj, std::vect
vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
}
bool GeoFeatureGroupExtension::areLinksValid(DocumentObject* obj) {
//we get all linked objects. We can't use outList() as this includes the links from expressions
auto result = getObjectsFromLinks(obj);
//no cross CS links.
auto group = obj->hasExtension(App::GeoFeatureGroupExtension::getExtensionClassTypeId()) ? obj : getGroupOfObject(obj);
for(auto link : result) {
if(getGroupOfObject(link) != group)
return false;
}
return true;
}
// Python feature ---------------------------------------------------------
namespace App {