logic: don't show implicit or undefined child nodes in graph unless connected
* visit implicit declarations in ASTVisitor * show implicit and undefined child nodes only when connected * fixed some bundle edges couldn't be split * add "implicit" to tooltip * show undefiend and implicit nodes hatched
This commit is contained in:
@@ -376,6 +376,8 @@ void GraphController::setActiveAndVisibility(const std::vector<Id>& activeTokenI
|
||||
|
||||
for (DummyNode& node : m_dummyNodes)
|
||||
{
|
||||
removeImplicitAndUndefinedChildrenRecursive(node);
|
||||
|
||||
setNodeVisibilityRecursiveBottomUp(node, noActive);
|
||||
}
|
||||
}
|
||||
@@ -395,6 +397,35 @@ void GraphController::setNodeActiveRecursive(DummyNode& node, const std::vector<
|
||||
}
|
||||
}
|
||||
|
||||
void GraphController::removeImplicitAndUndefinedChildrenRecursive(DummyNode& node)
|
||||
{
|
||||
for (size_t i = 0; i < node.subNodes.size(); i++)
|
||||
{
|
||||
bool removeNode = false;
|
||||
|
||||
DummyNode& subNode = node.subNodes[i];
|
||||
if (subNode.isGraphNode() && !subNode.data->isExplicit() && !subNode.connected && !subNode.active && !subNode.subNodes.size())
|
||||
{
|
||||
removeNode = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
removeImplicitAndUndefinedChildrenRecursive(subNode);
|
||||
|
||||
if (subNode.isAccessNode() && subNode.subNodes.size() == 0)
|
||||
{
|
||||
removeNode = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (removeNode)
|
||||
{
|
||||
node.subNodes.erase(node.subNodes.begin() + i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool GraphController::setNodeVisibilityRecursiveBottomUp(DummyNode& node, bool noActive) const
|
||||
{
|
||||
node.visible = false;
|
||||
|
||||
Reference in New Issue
Block a user