ui: GraphView can set active tokenId on node clicked
By now the graph displays the active node, without neighbours or anything, and clicking a node sets the active token id to the clicked nodes id. fortune cookie message = Be prepared to accept an exciting opportunity in the future.
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
#ifndef QT_GRAPH_VIEW_H
|
||||
#define QT_GRAPH_VIEW_H
|
||||
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
|
||||
#include "component/view/GraphView.h"
|
||||
|
||||
struct DummyEdge;
|
||||
struct DummyNode;
|
||||
class QGraphicsView;
|
||||
|
||||
class QtGraphView : public GraphView
|
||||
@@ -15,11 +19,22 @@ public:
|
||||
virtual void createWidgetWrapper();
|
||||
virtual void initGui();
|
||||
|
||||
virtual std::weak_ptr<GraphNode> addNode(const Vec2i& position, const std::string& name);
|
||||
virtual void addEdge(const std::weak_ptr<GraphNode>& owner, const std::weak_ptr<GraphNode>& target);
|
||||
virtual void rebuildGraph(const std::vector<DummyNode>& nodes, const std::vector<DummyEdge>& edges);
|
||||
|
||||
virtual void clear();
|
||||
|
||||
private:
|
||||
QGraphicsView* getView();
|
||||
|
||||
void doRebuildGraph(const std::vector<DummyNode>& nodes, const std::vector<DummyEdge>& edges);
|
||||
void doClear();
|
||||
|
||||
std::shared_ptr<GraphNode> findOrCreateNode(QGraphicsView* view, const DummyNode& node);
|
||||
std::shared_ptr<GraphNode> findNode(const DummyNode& node);
|
||||
std::shared_ptr<GraphNode> createNode(QGraphicsView* view, const DummyNode& node);
|
||||
|
||||
QtThreadedFunctor<const std::vector<DummyNode>&, const std::vector<DummyEdge>&> m_rebuildGraph;
|
||||
QtThreadedFunctor<void> m_clear;
|
||||
};
|
||||
|
||||
#endif // QT_GRAPH_VIEW_H
|
||||
|
||||
Reference in New Issue
Block a user