App: circular reference testing routine for new links

DocumentObject::testIfLinkDAGCompatible: return true if link can be
created (no cycles will be made). False if the link will cause a
circular dependency and break recomputes.
This commit is contained in:
DeepSOIC
2015-07-08 21:36:39 +03:00
committed by Stefan Tröger
parent a8781fdacc
commit 565a191689
3 changed files with 56 additions and 2 deletions

View File

@@ -1662,8 +1662,11 @@ Document::getDependencyList(const std::vector<App::DocumentObject*>& objs) const
// this sort gives the execute
boost::topological_sort(DepList, std::front_inserter(make_order));
}
catch (const std::exception&) {
return std::vector<App::DocumentObject*>();
catch (const std::exception& e) {
std::stringstream ss;
ss << "Gathering all dependencies failed, probably due to circular dependencies. Error: ";
ss << e.what();
throw Base::Exception(ss.str().c_str());
}
std::set<Vertex> out;