forked from Kitware/itk-vtk-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainMachineContext.js
96 lines (80 loc) · 1.9 KB
/
MainMachineContext.js
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
class MainMachineContext {
constructor(config) {
if (config) {
if (typeof config.backgroundColor !== 'undefined') {
this.backgroundColor = config.backgroundColor
}
if (typeof config.units !== 'undefined') {
this.units = config.units
}
// Todo: more
}
}
getConfig() {
const config = {
backgroundColor: [...this.backgroundColor],
units: this.units,
}
return config
}
// Background color of the renderer
backgroundColor = [0.5, 0.5, 0.5]
// Background colors to step through when clicking the background color
// button
backgroundColors = [
[0.5, 0.5, 0.5],
[0, 0, 0],
[1, 1, 1],
]
// Index of the selected background color from the backgroundColors
selectedBackgroundColor = 0
// Is fullscreen mode enabled?
fullscreenEnabled = false
// Are annotations, e.g. pixel values, an orientation widget, displayed?
annotationsEnabled = true
// Continuously rotate the 3D rendering?
rotateEnabled = false
// Visualize the spatial axes on the viewable scene content
axesEnabled = false
// Spatial length units displayed in the scale bar
units = ''
// In the single view layout, the an X plane, Y plane, Z plane, or volume
// rendering.
viewMode = 'Volume'
// Current viewer frames per second
fps = null
// Slicing planes specification
slicingPlanes = {
x: {
min: 0.0,
max: 1.0,
step: 0.1,
scroll: false,
scrollDirection: 1,
visible: true,
},
y: {
min: 0.0,
max: 1.0,
step: 0.1,
scroll: false,
scrollDirection: 1,
visible: true,
},
z: {
min: 0.0,
max: 1.0,
step: 0.1,
scroll: false,
scrollDirection: 1,
visible: true,
},
}
// x slice value
xSlice = null
// y slice value
ySlice = null
// z slice value
zSlice = null
}
export default MainMachineContext