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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user