-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprod_classes.js
More file actions
120 lines (114 loc) · 2.86 KB
/
prod_classes.js
File metadata and controls
120 lines (114 loc) · 2.86 KB
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
'use strict';
function Vial(x, y, isTop, count) {
this.x = x || 0;
this.y = y || 0;
this.isTop = isTop || false;
this.count = (typeof count != 'undefined') ? count : 1;
}
function Region(x, y, type) {
this.x = x || 0;
this.y = y || 0;
this.type = type || "Small";
}
function Pipe(x1, y1, x2, y2, offsets) {
var undef;
this.x1 = (x1 !== undef) ? x1 : -1;
this.y1 = (y1 !== undef) ? y1 : 0;
this.x2 = (x2 !== undef) ? x2 : 1;
this.y2 = (y2 !== undef) ? y2 : 0;
this.offsets = (offsets !== undef) ? offsets : [{"x": 0, "y": 0}];
}
function ProductionInfo(shrinkLeft, shrinkRight, isolateIO, regions, pipes, vials) {
this.shrinkLeft = shrinkLeft || false;
this.shrinkRight = shrinkRight || false;
this.isolateIO = isolateIO || false;
this.regions = regions || [];
this.pipes = pipes || [];
this.vials = vials || [];
}
function getProductionToolboxObjects() {
return [{
"is" : "region",
"type" : "Small",
"image" : "region-small.png"
}, {
"is" : "region",
"type" : "SmallWide",
"image" : "region-smallwide.png"
}, {
"is" : "region",
"type" : "SmallWider",
"image" : "region-smallwider.png"
}, {
"is" : "region",
"type" : "Medium",
"image" : "region-medium.png"
}, {
"is" : "region",
"type" : "MediumWide",
"image" : "region-mediumwide.png"
}, {
"is" : "region",
"type" : "Large",
"image" : "region-large.png"
}, {
"is" : "vial",
"isTop" : true,
"count" : 1,
"image" : "vial-vt1.png"
}, {
"is" : "vial",
"isTop" : true,
"count" : 2,
"image" : "vial-vt2.png"
}, {
"is" : "vial",
"isTop" : true,
"count" : 3,
"image" : "vial-vt3.png"
}, {
"is" : "vial",
"isTop" : false,
"count" : 1,
"image" : "vial-vb1.png"
}, {
"is" : "vial",
"isTop" : false,
"count" : 2,
"image" : "vial-vb2.png"
}, {
"is" : "vial",
"isTop" : false,
"count" : 3,
"image" : "vial-vb3.png"
}, {
"is" : "pipe",
"type" : "shape",
"image" : "pipe.png"
}, {
"is" : "pipe",
"type" : "input",
"image" : "pipe-red.png"
}, {
"is" : "pipe",
"type" : "output",
"image" : "pipe-blue.png"
}, {
"is" : "vial",
"isTop" : true,
"count" : 0,
"image" : "vial-vt0.png"
}, {
"is" : "vial",
"isTop" : false,
"count" : 0,
"image" : "vial-vb0.png"
}];
}
function generatePipeMolecule(offsets) {
var primes = offsets.map(function(d) {
return new Prime("salt", d.x, d.y);
});
var bonds = fullBond(primes);
return new Molecule(primes, bonds);
}