ui: graph view edges
Added simple edges to the graph view. Also fixed a memory leak source in QtMainWindow. fortune cookie message = Good health will be with you.
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
#ifndef GRAPH_VIEW_H
|
||||
#define GRAPH_VIEW_H
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
#include "component/view/View.h"
|
||||
|
||||
class GraphEdge;
|
||||
class GraphNode;
|
||||
|
||||
class GraphView : public View
|
||||
{
|
||||
public:
|
||||
@@ -11,7 +17,12 @@ public:
|
||||
|
||||
virtual std::string getName() const;
|
||||
|
||||
virtual void addNode(const Vec2i& position, const std::string& name) = 0;
|
||||
virtual std::weak_ptr<GraphNode> addNode(const Vec2i& position, const std::string& name) = 0;
|
||||
virtual void addEdge(const std::weak_ptr<GraphNode>& owner, const std::weak_ptr<GraphNode>& target) = 0;
|
||||
|
||||
protected:
|
||||
std::list<std::shared_ptr<GraphNode> > m_nodes;
|
||||
std::list<std::weak_ptr<GraphEdge> > m_edges;
|
||||
};
|
||||
|
||||
#endif // GRAPH_VIEW_H
|
||||
Reference in New Issue
Block a user