logic: Simplified node bundling by collecting relevant data upfront

This commit is contained in:
Eberhard Graether
2016-05-13 14:17:20 +02:00
parent c61efbbcde
commit 7bb40f2630
6 changed files with 143 additions and 231 deletions
@@ -4,8 +4,6 @@
#include "component/controller/helper/DummyNode.h"
#include "component/view/GraphViewStyle.h"
const Edge::EdgeTypeMask BucketGrid::s_verticalEdgeMask = Edge::EDGE_INHERITANCE | Edge::EDGE_OVERRIDE;
Bucket::Bucket()
: i(0)
, j(0)
@@ -169,7 +167,7 @@ void BucketGrid::createBuckets(std::vector<DummyNode>& nodes, const std::vector<
}
else
{
bool horizontal = edge->data ? !edge->data->isType(s_verticalEdgeMask) : true;
bool horizontal = !owner->bundleInfo.layoutVertical && !target->bundleInfo.layoutVertical;
removeEdge = addNode(owner, target, horizontal);
}
@@ -13,6 +13,23 @@ class Node;
struct DummyNode
{
public:
struct BundleInfo
{
BundleInfo()
: isActive(false)
, isDefined(false)
, layoutVertical(false)
, isReferenced(false)
, isReferencing(false)
{}
bool isActive;
bool isDefined;
bool layoutVertical;
bool isReferenced;
bool isReferencing;
};
DummyNode()
: visible(false)
, childVisible(false)
@@ -200,6 +217,9 @@ public:
// ExpandToggleNode
size_t invisibleSubNodeCount;
// Bundling
BundleInfo bundleInfo;
// BundleNode
std::vector<DummyNode> bundledNodes;
size_t bundledNodeCount;