-
Notifications
You must be signed in to change notification settings - Fork 5
/
GraphicsMaker2D.cpp
53 lines (47 loc) · 1.76 KB
/
GraphicsMaker2D.cpp
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
#include "GraphicsMaker2D.h"
namespace nV {
namespace Graphics {
GraphicsMaker2D::GraphicsMaker2D() {
axeX = true;
axeY = true;
}
var GraphicsMaker2D::makeGlobalOptions() {
var range = GraphicsMaker::makeRange(xmin, xmax, ymin, ymax);
optlist.add(range);
var opts = list(optlist.size(), SYS(Options));
for (size_t i = 0; i < optlist.size(); i++) {
opts.tuple()[i + 1] = optlist[i];
}
return opts;
}
var GraphicsMaker2D::makeGraphics(var shape, var opts) {
return tuple(SYS(Graphics2D), shape, opts);
}
var GraphicsMaker2D::makeGraphics(var shape) {
var opts = makeGlobalOptions();
return makeGraphics(shape, opts);
}
void GraphicsMaker2D::setCommonRule(var title, var rule) {
if (title == SYS(Axes)) {
if(rule.tuple().size == 3) {
var op = tuple(title, rule.tuple()[1], rule.tuple()[2]);
optlist.add(op);
}
}
if (title == SYS(AxesLabel)) {
if(rule.tuple().size == 3) {
//var op = tuple(title, rule.tuple()[1], rule.tuple()[2]);
//var op = list(rule, title);
var temp = list(rule.tuple()[1], rule.tuple()[2]);
//var op = tuple(title, temp);
var op = list(temp, SYS(AxesLabel));
optlist.add(op);
}
}
if (title == SYS(GraphLabel)) {
var op = tuple(title, rule);
optlist.add(op);
}
}
}
}