blob: 8a995d2c87dd4169befbb7b79491f1be034097ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#include "graph.h"
Graph::Graph(QObject *parent) : QObject(parent)
{
_data = new GraphElementData();
}
Graph::~Graph()
{
delete _data;
}
void Graph::removeNode(Node *n) {
nodes.removeAll(n);
inEdges.remove(n);
outEdges.remove(n);
}
Edge *Graph::addEdge(Node *s, Node *t)
{
}
void Graph::removeEdge(Edge *e)
{
}
GraphElementData *Graph::data() const
{
return _data;
}
void Graph::setData(GraphElementData *data)
{
delete _data;
_data = data;
}
Node *Graph::addNode() {
Node *n = new Node(this);
nodes << n;
return n;
}
|