Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0825a3c

Browse files
committed
Add layout feature
1 parent4f636a5 commit0825a3c

14 files changed

+414
-428
lines changed

‎CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION3.2)
22

3-
project(algorithm-visualizerVERSION2.1.0)
3+
project(algorithm-visualizerVERSION2.3.0)
44

55
set(CMAKE_CXX_STANDARD11)
66

‎include/Array1DTracer.h

Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,17 @@
11
#ifndef CPP_ARRAY1DTRACER_H
22
#defineCPP_ARRAY1DTRACER_H
33

4-
#include"Tracer.h"
4+
#include"BaseArray1DTracer.h"
55
#include"ChartTracer.h"
66

7-
classArray1DTracer :publicTracer {
7+
classArray1DTracer :publicBaseArray1DTracer {
88
public:
9-
Array1DTracer(string title ="") : Tracer("Array1DTracer", title) {
9+
Array1DTracer(const string &title ="",const string &className ="Array1DTracer") : BaseArray1DTracer(title,
10+
className) {
1011
}
1112

12-
Array1DTracerset(json array1d) {
13-
addTrace(key,"set", {array1d});
14-
return *this;
15-
}
16-
17-
Array1DTracerset() {
18-
addTrace(key,"set", {});
19-
return *this;
20-
}
21-
22-
Array1DTracerreset() {
23-
addTrace(key,"reset", {});
24-
return *this;
25-
}
26-
27-
Array1DTracerdelay() {
28-
addTrace(key,"delay", {});
29-
return *this;
30-
}
31-
32-
Array1DTracerpatch(json x, json v) {
33-
addTrace(key,"patch", {x, v});
34-
return *this;
35-
}
36-
37-
Array1DTracerdepatch(json x) {
38-
addTrace(key,"depatch", {x});
39-
return *this;
40-
}
41-
42-
Array1DTracerselect(json x) {
43-
addTrace(key,"select", {x});
44-
return *this;
45-
}
46-
47-
Array1DTracerselect(json sx, json ex) {
48-
addTrace(key,"select", {sx, ex});
49-
return *this;
50-
}
51-
52-
Array1DTracerdeselect(json x) {
53-
addTrace(key,"deselect", {x});
54-
return *this;
55-
}
56-
57-
Array1DTracerdeselect(json sx, json ex) {
58-
addTrace(key,"deselect", {sx, ex});
59-
return *this;
60-
}
61-
62-
Array1DTracerchart(ChartTracer chartTracer) {
63-
addTrace(key,"chart", {chartTracer.key});
64-
return *this;
13+
voidchart(const ChartTracer &chartTracer) {
14+
command("chart", {chartTracer.key});
6515
}
6616
};
6717

‎include/Array2DTracer.h

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,55 @@
55

66
classArray2DTracer :publicTracer {
77
public:
8-
Array2DTracer(string title ="") : Tracer("Array2DTracer", title) {
8+
Array2DTracer(conststring&title ="",const string &className ="Array2DTracer") : Tracer(title, className) {
99
}
1010

11-
Array2DTracerset(json array2d) {
12-
addTrace(key,"set", {array2d});
13-
return *this;
11+
voidset(const json &array2d) {
12+
command("set", {array2d});
1413
}
1514

16-
Array2DTracerset() {
17-
addTrace(key,"set", {});
18-
return *this;
15+
voidpatch(int x,int y,const json &v) {
16+
command("patch", {x, y, v});
1917
}
2018

21-
Array2DTracerreset() {
22-
addTrace(key,"reset", {});
23-
return *this;
19+
voidpatch(int x,int y) {
20+
command("patch", {x, y});
2421
}
2522

26-
Array2DTracerdelay() {
27-
addTrace(key,"delay", {});
28-
return *this;
23+
voiddepatch(int x,int y) {
24+
command("depatch", {x, y});
2925
}
3026

31-
Array2DTracerpatch(json x, json y, json v) {
32-
addTrace(key,"patch", {x, y, v});
33-
return *this;
27+
voidselect(int sx,int sy,int ex,int ey) {
28+
command("select", {sx, sy, ex, ey});
3429
}
3530

36-
Array2DTracerdepatch(json x, json y) {
37-
addTrace(key,"depatch", {x, y});
38-
return *this;
31+
voidselect(int x,int y) {
32+
command("select", {x, y});
3933
}
4034

41-
Array2DTracerselect(json x, json y) {
42-
addTrace(key,"select", {x, y});
43-
return *this;
35+
voidselectRow(int x,int sy,int ey) {
36+
command("selectRow", {x, sy, ey});
4437
}
4538

46-
Array2DTracerselect(json sx, json sy, json ex, json ey) {
47-
addTrace(key,"select", {sx, sy, ex, ey});
48-
return *this;
39+
voidselectCol(int y,int sx,int ex) {
40+
command("selectCol", {y, sx, ex});
4941
}
5042

51-
Array2DTracerselectRow(json x, json sy, json ey) {
52-
addTrace(key,"selectRow", {x, sy, ey});
53-
return *this;
43+
voiddeselect(int sx,int sy,int ex,int ey) {
44+
command("deselect", {sx, sy, ex, ey});
5445
}
5546

56-
Array2DTracerselectCol(json y, json sx, json ex) {
57-
addTrace(key,"selectCol", {y, sx, ex});
58-
return *this;
47+
voiddeselect(int x,int y) {
48+
command("deselect", {x, y});
5949
}
6050

61-
Array2DTracerdeselect(json x, json y) {
62-
addTrace(key,"deselect", {x, y});
63-
return *this;
51+
voiddeselectRow(int x,int sy,int ey) {
52+
command("deselectRow", {x, sy, ey});
6453
}
6554

66-
Array2DTracerdeselect(json sx, json sy, json ex, json ey) {
67-
addTrace(key,"deselect", {sx, sy, ex, ey});
68-
return *this;
69-
}
70-
71-
Array2DTracerdeselectRow(json x, json sy, json ey) {
72-
addTrace(key,"deselectRow", {x, sy, ey});
73-
return *this;
74-
}
75-
76-
Array2DTracerdeselectCol(json y, json sx, json ex) {
77-
addTrace(key,"deselectCol", {y, sx, ex});
78-
return *this;
55+
voiddeselectCol(int y,int sx,int ex) {
56+
command("deselectCol", {y, sx, ex});
7957
}
8058
};
8159

‎include/BaseArray1DTracer.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#ifndef CPP_BASEARRAY1DTRACER_H
2+
#defineCPP_BASEARRAY1DTRACER_H
3+
4+
#include"Array2DTracer.h"
5+
6+
classBaseArray1DTracer :publicArray2DTracer {
7+
public:
8+
BaseArray1DTracer(const string &title ="",const string &className ="BaseArray1DTracer") : Array2DTracer(title,
9+
className) {
10+
}
11+
12+
voidset(const json &array1d) {
13+
command("set", {array1d});
14+
}
15+
16+
voidpatch(int x,const json &v) {
17+
command("patch", {x, v});
18+
}
19+
20+
voidpatch(int x) {
21+
command("patch", {x});
22+
}
23+
24+
voiddepatch(int x) {
25+
command("depatch", {x});
26+
}
27+
28+
voidselect(int sx,int ex) {
29+
command("select", {sx, ex});
30+
}
31+
32+
voidselect(int x) {
33+
command("select", {x});
34+
}
35+
36+
voiddeselect(int sx,int ex) {
37+
command("deselect", {sx, ex});
38+
}
39+
40+
voiddeselect(int x) {
41+
command("deselect", {x});
42+
}
43+
};
44+
45+
#endif

‎include/ChartTracer.h

Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,16 @@
11
#ifndef CPP_CHARTTRACER_H
22
#defineCPP_CHARTTRACER_H
33

4-
#include"Tracer.h"
4+
#include"Array1DTracer.h"
55

6-
classChartTracer :publicTracer {
6+
classChartTracer :publicBaseArray1DTracer {
77
public:
8-
ChartTracer(string title ="") : Tracer("ChartTracer", title) {
8+
ChartTracer(const string &title ="",const string &className ="ChartTracer") : BaseArray1DTracer(title,
9+
className) {
910
}
1011

11-
ChartTracerset(json array1d) {
12-
addTrace(key,"set", {array1d});
13-
return *this;
14-
}
15-
16-
ChartTracerset() {
17-
addTrace(key,"set", {});
18-
return *this;
19-
}
20-
21-
ChartTracerreset() {
22-
addTrace(key,"reset", {});
23-
return *this;
24-
}
25-
26-
ChartTracerdelay() {
27-
addTrace(key,"delay", {});
28-
return *this;
29-
}
30-
31-
ChartTracerpatch(json x, json v) {
32-
addTrace(key,"patch", {x, v});
33-
return *this;
34-
}
35-
36-
ChartTracerdepatch(json x) {
37-
addTrace(key,"depatch", {x});
38-
return *this;
39-
}
40-
41-
ChartTracerselect(json x) {
42-
addTrace(key,"select", {x});
43-
return *this;
44-
}
45-
46-
ChartTracerselect(json sx, json ex) {
47-
addTrace(key,"select", {sx, ex});
48-
return *this;
49-
}
50-
51-
ChartTracerdeselect(json x) {
52-
addTrace(key,"deselect", {x});
53-
return *this;
54-
}
55-
56-
ChartTracerdeselect(json sx, json ex) {
57-
addTrace(key,"deselect", {sx, ex});
58-
return *this;
59-
}
60-
61-
ChartTracerchart(ChartTracer chartTracer) {
62-
addTrace(key,"chart", {chartTracer.key});
63-
return *this;
12+
voidchart(const ChartTracer &chartTracer) {
13+
command("chart", {chartTracer.key});
6414
}
6515
};
6616

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp