-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathGraphTracer.h
194 lines (148 loc) · 5.3 KB
/
GraphTracer.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#ifndef CPP_GRAPHTRACER_H
#define CPP_GRAPHTRACER_H
#include "Tracer.h"
#include "LogTracer.h"
class GraphTracer : public Tracer {
public:
GraphTracer(const string &title = "", const string &className = "GraphTracer") : Tracer(title, className) {
}
void set(const json &array2d) {
command("set", {array2d});
}
GraphTracer directed(bool isDirected) {
command("directed", {isDirected});
return *this;
}
GraphTracer directed() {
command("directed", {});
return *this;
}
GraphTracer weighted(bool isWeighted) {
command("weighted", {isWeighted});
return *this;
}
GraphTracer weighted() {
command("weighted", {});
return *this;
}
GraphTracer layoutCircle() {
command("layoutCircle", {});
return *this;
}
GraphTracer layoutTree(const json &root, bool sorted) {
command("layoutTree", {root, sorted});
return *this;
}
GraphTracer layoutTree(const json &root) {
command("layoutTree", {root});
return *this;
}
GraphTracer layoutTree() {
command("layoutTree", {});
return *this;
}
GraphTracer layoutRandom() {
command("layoutRandom", {});
return *this;
}
void addNode(const json &id, double weight, double x, double y, int visitedCount, int selectedCount) {
command("addNode", {id, weight, x, y, visitedCount, selectedCount});
}
void addNode(const json &id, double weight, double x, double y, int visitedCount) {
command("addNode", {id, weight, x, y, visitedCount});
}
void addNode(const json &id, double weight, double x, double y) {
command("addNode", {id, weight, x, y});
}
void addNode(const json &id, double weight, double x) {
command("addNode", {id, weight, x});
}
void addNode(const json &id, double weight) {
command("addNode", {id, weight});
}
void addNode(const json &id) {
command("addNode", {id});
}
void updateNode(const json &id, double weight, double x, double y, int visitedCount, int selectedCount) {
command("updateNode", {id, weight, x, y, visitedCount, selectedCount});
}
void updateNode(const json &id, double weight, double x, double y, int visitedCount) {
command("updateNode", {id, weight, x, y, visitedCount});
}
void updateNode(const json &id, double weight, double x, double y) {
command("updateNode", {id, weight, x, y});
}
void updateNode(const json &id, double weight, double x) {
command("updateNode", {id, weight, x});
}
void updateNode(const json &id, double weight) {
command("updateNode", {id, weight});
}
void updateNode(const json &id) {
command("updateNode", {id});
}
void removeNode(const json &id) {
command("removeNode", {id});
}
void addEdge(const json &source, const json &target, double weight, int visitedCount, int selectedCount) {
command("addEdge", {source, target, weight, visitedCount, selectedCount});
}
void addEdge(const json &source, const json &target, double weight, int visitedCount) {
command("addEdge", {source, target, weight, visitedCount});
}
void addEdge(const json &source, const json &target, double weight) {
command("addEdge", {source, target, weight});
}
void addEdge(const json &source, const json &target) {
command("addEdge", {source, target});
}
void updateEdge(const json &source, const json &target, double weight, int visitedCount, int selectedCount) {
command("updateEdge", {source, target, weight, visitedCount, selectedCount});
}
void updateEdge(const json &source, const json &target, double weight, int visitedCount) {
command("updateEdge", {source, target, weight, visitedCount});
}
void updateEdge(const json &source, const json &target, double weight) {
command("updateEdge", {source, target, weight});
}
void updateEdge(const json &source, const json &target) {
command("updateEdge", {source, target});
}
void removeEdge(const json &source, const json &target) {
command("removeEdge", {source, target});
}
void visit(const json &target, const json &source, double weight) {
command("visit", {target, source, weight});
}
void visit(const json &target, const json &source) {
command("visit", {target, source});
}
void visit(const json &target) {
command("visit", {target});
}
void leave(const json &target, const json &source, double weight) {
command("leave", {target, source, weight});
}
void leave(const json &target, const json &source) {
command("leave", {target, source});
}
void leave(const json &target) {
command("leave", {target});
}
void select(const json &target, const json &source) {
command("select", {target, source});
}
void select(const json &target) {
command("select", {target});
}
void deselect(const json &target, const json &source) {
command("deselect", {target, source});
}
void deselect(const json &target) {
command("deselect", {target});
}
void log(LogTracer &logTracer) {
command("log", {logTracer.key});
}
};
#endif