DependencyGraph: show invalid links in red

This commit is contained in:
Stefan Tröger
2017-07-21 08:26:36 +02:00
committed by wmayer
parent d0954e6e42
commit 79bb7b7f50
3 changed files with 124 additions and 39 deletions

View File

@@ -258,6 +258,7 @@ void Document::exportGraphviz(std::ostream& out) const
buildAdjacencyList();
addEdges();
markCycles();
markOutOfScopeLinks();
}
/**
@@ -663,6 +664,7 @@ void Document::exportGraphviz(std::ostream& out) const
edgeAttrMap[edge]["ltail"] = getClusterName(docObj);
if (GraphList[*It2])
edgeAttrMap[edge]["lhead"] = getClusterName(*It2);
}
}
@@ -767,6 +769,24 @@ void Document::exportGraphviz(std::ostream& out) const
for (auto ei = out_edges.begin(), ei_end = out_edges.end(); ei != ei_end; ++ei)
edgeAttrMap[ei->second]["color"] = "red";
}
void markOutOfScopeLinks() {
const boost::property_map<Graph, boost::edge_attribute_t>::type& edgeAttrMap = boost::get(boost::edge_attribute, DepList);
for( auto obj : objects) {
std::vector<App::DocumentObject*> invalids;
GeoFeatureGroupExtension::getInvalidLinkObjects(obj, invalids);
//isLinkValid returns true for non-link properties
for(auto linkedObj : invalids) {
auto res = edge(GlobalVertexList[getId(obj)], GlobalVertexList[getId(linkedObj)], DepList);
if(res.second)
edgeAttrMap[res.first]["color"] = "red";
}
}
}
const struct DocumentP* d;
Graph DepList;