logic: refactored GraphAccess and GraphController to use single call that returns Graph

This change refactors the GraphController to use the GraphAccess only with a single call that returns a Graph. The Graph
contains all information for visually representing the active Token with all parent and child nodes and edges. This
reduces coupling of the data and logic tiers.
This commit is contained in:
Eberhard Graether
2014-09-10 01:07:26 +02:00
parent 9a546b4312
commit 760e5ffafd
18 changed files with 164 additions and 544 deletions
+6 -13
View File
@@ -1,19 +1,20 @@
#ifndef GRAPH_CONTROLLER_H
#define GRAPH_CONTROLLER_H
#include <set>
#include <vector>
#include "component/controller/Controller.h"
#include "component/controller/GraphLayouter.h"
#include "utility/messaging/MessageListener.h"
#include "utility/messaging/type/MessageActivateToken.h"
#include "utility/messaging/type/MessageActivateTokens.h"
#include "component/controller/Controller.h"
#include "component/controller/GraphLayouter.h"
struct DummyNode;
struct DummyEdge;
class GraphView;
class GraphAccess;
class Node;
class GraphController
: public Controller
@@ -29,17 +30,9 @@ private:
virtual void handleMessage(MessageActivateTokens* message);
GraphView* getView();
void createDummyGraph(const Id activeId, const LayoutFunction layoutFunction);
DummyNode createDummyNode(const Id nodeId);
Id findTopLevelNode(const Id nodeId);
DummyNode buildNodeTopDown(const Id nodeId);
std::vector<DummyNode> createNeighbourNodes(const Id nodeId);
std::vector<DummyNode> createNeighbourNodes(const DummyNode& node);
std::vector<DummyEdge> createEdges(const std::vector<DummyNode>& nodes);
std::set<DummyEdge> getNeighbourEdgesOfNode(const DummyNode& node);
void createDummyGraphForTokenId(Id tokenId, const GraphLayouter::LayoutFunction layoutFunction);
DummyNode createDummyNodeTopDown(Node* node, std::vector<DummyEdge>* dummyEdges) const;
GraphAccess* m_graphAccess;
};