ui: bundling nodes in the graph view

This change bundles similar nodes in the graph view together. When the bundled node or it's aggregation edge are clicked,
then the bundle is split. This change also adds an arrow to the aggregation edge based on the direction of it's edges.
This commit is contained in:
Eberhard Graether
2015-06-17 22:47:08 +02:00
parent eb4b82c015
commit d6269f9608
31 changed files with 834 additions and 98 deletions
@@ -40,7 +40,12 @@ public:
bool isExpandToggleNode() const
{
return !data && !isAccessNode();
return !isGraphNode() && !isAccessNode() && !isBundleNode();
}
bool isBundleNode() const
{
return bundledNodes.size() > 0;
}
bool isExpanded() const
@@ -48,6 +53,55 @@ public:
return expanded || autoExpanded;
}
bool hasVisibleSubNode() const
{
for (const DummyNode& node : subNodes)
{
if (node.visible)
{
return true;
}
}
return false;
}
bool hasActiveSubNode() const
{
if (active)
{
return true;
}
for (const DummyNode& node : subNodes)
{
if (node.hasActiveSubNode())
{
return true;
}
}
return false;
}
bool hasConnectedSubNode() const
{
if (connected)
{
return true;
}
for (const DummyNode& node : subNodes)
{
if (node.hasConnectedSubNode())
{
return true;
}
}
return false;
}
Vec2i position;
Vec2i size;
@@ -72,6 +126,10 @@ public:
// ExpandToggleNode
size_t invisibleSubNodeCount;
// BundleNode
std::vector<DummyNode> bundledNodes;
std::string name;
};
#endif // DUMMY_NODE_H