ui: switch Graph to bucket grid layouting

This change introduces bucket grid layouting, which sorts the nodes into buckets based on how they are connected. Each
bucket is then layouted individually before they are arranged next to each other. Edges go from left to right, except
for inheritance edges that go from bottom to top.
This commit is contained in:
Eberhard Graether
2015-09-24 03:12:42 +02:00
parent c18bd6a8bc
commit 5825fe77ab
15 changed files with 575 additions and 56 deletions
@@ -7,6 +7,7 @@
#include "component/controller/helper/DummyEdge.h"
#include "component/controller/helper/DummyNode.h"
#include "component/controller/helper/GraphLayouter.h"
#include "component/controller/helper/GraphPostprocessor.h"
#include "component/view/GraphView.h"
#include "component/view/GraphViewStyle.h"
@@ -88,8 +89,7 @@ void GraphController::handleMessage(MessageGraphNodeBundleSplit* message)
setActiveAndVisibility(utility::concat(m_activeNodeIds, m_activeEdgeIds));
layoutNesting();
GraphLayouter::layoutSpectralPrototype(m_dummyNodes, m_dummyEdges);
GraphPostprocessor::doPostprocessing(m_dummyNodes);
layoutGraph();
buildGraph(message);
}
@@ -102,9 +102,9 @@ void GraphController::handleMessage(MessageGraphNodeExpand* message)
node->expanded = message->expand;
setActiveAndVisibility(utility::concat(m_activeNodeIds, m_activeEdgeIds));
layoutNesting();
GraphPostprocessor::doPostprocessing(m_dummyNodes);
layoutNesting();
layoutGraph();
buildGraph(message);
}
@@ -179,8 +179,7 @@ void GraphController::createDummyGraphForTokenIds(const std::vector<Id>& tokenId
bundleNodes();
layoutNesting();
GraphLayouter::layoutSpectralPrototype(m_dummyNodes, m_dummyEdges);
GraphPostprocessor::doPostprocessing(m_dummyNodes);
layoutGraph();
m_graph = graph;
}
@@ -867,6 +866,14 @@ void GraphController::layoutToGrid(DummyNode& node) const
}
}
void GraphController::layoutGraph()
{
// GraphLayouter::layoutSpectralPrototype(m_dummyNodes, m_dummyEdges);
// GraphPostprocessor::doPostprocessing(m_dummyNodes);
GraphLayouter::layoutBucket(m_dummyNodes, m_dummyEdges, getView()->getViewSize());
}
DummyNode* GraphController::findDummyNodeRecursive(std::vector<DummyNode>& nodes, Id tokenId) const
{
for (DummyNode& node : nodes)