@abi-software/scaffoldvuer 0.2.3-alpha-2 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +12 -12
- package/CHANGELOG.md +344 -316
- package/LICENSE +201 -201
- package/README.md +164 -164
- package/babel.config.js +14 -14
- package/dist/scaffoldvuer-wc.common.js +277 -34
- package/dist/scaffoldvuer-wc.umd.js +277 -34
- package/dist/scaffoldvuer-wc.umd.min.js +277 -34
- package/dist/scaffoldvuer.common.js +1252 -529
- package/dist/scaffoldvuer.common.js.map +1 -1
- package/dist/scaffoldvuer.css +1 -1
- package/dist/scaffoldvuer.umd.js +1252 -529
- package/dist/scaffoldvuer.umd.js.map +1 -1
- package/dist/scaffoldvuer.umd.min.js +1 -1
- package/dist/scaffoldvuer.umd.min.js.map +1 -1
- package/package-lock.json +18121 -18119
- package/package.json +89 -89
- package/public/index.html +17 -17
- package/src/App.vue +669 -669
- package/src/ScaffoldVuer-wc.js +13 -13
- package/src/app/DropZone.vue +114 -114
- package/src/app/ModelsInformation.js +35 -35
- package/src/app/ModelsTable.vue +113 -113
- package/src/app/TextureDemos.js +114 -114
- package/src/assets/_variables.scss +43 -43
- package/src/assets/styles.scss +7 -7
- package/src/components/OpacityControls.vue +123 -222
- package/src/components/PrimitiveControls.vue +173 -0
- package/src/components/ScaffoldTooltip.vue +142 -142
- package/src/components/ScaffoldVuer.md +44 -44
- package/src/components/ScaffoldVuer.vue +2007 -2007
- package/src/components/TextureSlidesControls.vue +272 -0
- package/src/components/TreeControls.vue +707 -699
- package/src/components/index.js +7 -7
- package/src/credential.json +12 -0
- package/src/main.js +14 -14
- package/src/scripts/BaseModule.js +80 -80
- package/src/scripts/RendererModule.js +289 -289
- package/src/scripts/WebGL.js +94 -94
- package/src/scripts/annotation.js +5 -5
- package/src/scripts/eventNotifier.js +66 -66
- package/src/scripts/graphicsHighlight.js +134 -134
- package/src/scripts/organsRenderer.js +587 -587
- package/src/scripts/search.js +182 -182
- package/src/scripts/utilities.js +146 -146
- package/styleguide.config.js +22 -22
- package/vue.config.js +41 -41
- package/src/components/test.pdf +0 -0
- package/src/searchControls.vue +0 -122
|
@@ -1,2007 +1,2007 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="scaffoldContainer"
|
|
4
|
-
v-loading="loading"
|
|
5
|
-
class="scaffold-container"
|
|
6
|
-
element-loading-text="Loading..."
|
|
7
|
-
element-loading-spinner="el-icon-loading"
|
|
8
|
-
element-loading-background="rgba(0, 0, 0, 0.3)"
|
|
9
|
-
>
|
|
10
|
-
<map-svg-sprite-color />
|
|
11
|
-
<scaffold-tooltip
|
|
12
|
-
:label="tData.label"
|
|
13
|
-
:region="tData.region"
|
|
14
|
-
:visible="tData.visible"
|
|
15
|
-
:x="tData.x"
|
|
16
|
-
:y="tData.y"
|
|
17
|
-
/>
|
|
18
|
-
<div
|
|
19
|
-
id="organsDisplayArea"
|
|
20
|
-
ref="display"
|
|
21
|
-
tabindex="-1"
|
|
22
|
-
style="height: 100%; width: 100%"
|
|
23
|
-
@keydown.66="backgroundChangeCallback"
|
|
24
|
-
/>
|
|
25
|
-
<div v-show="displayUI && !isTransitioning">
|
|
26
|
-
<el-popover
|
|
27
|
-
v-if="displayWarning"
|
|
28
|
-
ref="warningPopover"
|
|
29
|
-
v-model="hoverVisibilities[6].value"
|
|
30
|
-
:content="warningMessage"
|
|
31
|
-
placement="right"
|
|
32
|
-
:append-to-body="false"
|
|
33
|
-
trigger="manual"
|
|
34
|
-
popper-class="scaffold-popper message-popper right-popper non-selectable"
|
|
35
|
-
/>
|
|
36
|
-
<i
|
|
37
|
-
v-if="displayWarning"
|
|
38
|
-
v-popover:warningPopover
|
|
39
|
-
class="el-icon-warning message-icon warning-icon"
|
|
40
|
-
@mouseover="showHelpText(6)"
|
|
41
|
-
@mouseout="hideHelpText(6)"
|
|
42
|
-
>
|
|
43
|
-
<span class="message-text">Beta</span>
|
|
44
|
-
</i>
|
|
45
|
-
<el-popover
|
|
46
|
-
v-if="displayLatestChanges"
|
|
47
|
-
ref="latestChangesPopover"
|
|
48
|
-
v-model="hoverVisibilities[7].value"
|
|
49
|
-
:content="latestChangesMessage"
|
|
50
|
-
placement="right"
|
|
51
|
-
:append-to-body="false"
|
|
52
|
-
trigger="manual"
|
|
53
|
-
popper-class="scaffold-popper message-popper right-popper non-selectable"
|
|
54
|
-
/>
|
|
55
|
-
<i
|
|
56
|
-
v-if="displayLatestChanges && latestChangesMessage"
|
|
57
|
-
v-popover:latestChangesPopover
|
|
58
|
-
class="el-icon-warning message-icon latest-changesicon"
|
|
59
|
-
@mouseover="showHelpText(7)"
|
|
60
|
-
@mouseout="hideHelpText(7)"
|
|
61
|
-
>
|
|
62
|
-
<span class="message-text">What's new?</span>
|
|
63
|
-
</i>
|
|
64
|
-
<el-popover
|
|
65
|
-
ref="checkBoxPopover"
|
|
66
|
-
v-model="hoverVisibilities[5].value"
|
|
67
|
-
content="Change region visibility"
|
|
68
|
-
placement="right"
|
|
69
|
-
:append-to-body="false"
|
|
70
|
-
trigger="manual"
|
|
71
|
-
popper-class="scaffold-popper right-popper non-selectable"
|
|
72
|
-
/>
|
|
73
|
-
<tree-controls
|
|
74
|
-
ref="treeControls"
|
|
75
|
-
v-popover:checkBoxPopover
|
|
76
|
-
:help-mode="helpMode"
|
|
77
|
-
:isReady="isReady"
|
|
78
|
-
:show-colour-picker="showColourPicker"
|
|
79
|
-
@object-selected="objectSelected"
|
|
80
|
-
@object-hovered="objectHovered"
|
|
81
|
-
@drawer-toggled="drawerToggled"
|
|
82
|
-
/>
|
|
83
|
-
<div class="
|
|
84
|
-
<
|
|
85
|
-
</div>
|
|
86
|
-
<el-popover
|
|
87
|
-
v-if="sceneData.timeVarying"
|
|
88
|
-
ref="sliderPopover"
|
|
89
|
-
v-model="hoverVisibilities[4].value"
|
|
90
|
-
content="Move the slider to animate the region"
|
|
91
|
-
placement="top"
|
|
92
|
-
:append-to-body="false"
|
|
93
|
-
trigger="manual"
|
|
94
|
-
popper-class="scaffold-popper top-popper non-selectable"
|
|
95
|
-
/>
|
|
96
|
-
<div
|
|
97
|
-
v-if="sceneData.timeVarying"
|
|
98
|
-
v-popover:sliderPopover
|
|
99
|
-
class="time-slider-container"
|
|
100
|
-
:class="[minimisedSlider ? 'minimised' : '', sliderPosition]"
|
|
101
|
-
>
|
|
102
|
-
<el-tabs type="card">
|
|
103
|
-
<el-tab-pane label="Animate scaffold">
|
|
104
|
-
<el-row class="tab-content">
|
|
105
|
-
<map-svg-icon
|
|
106
|
-
v-if="isPlaying"
|
|
107
|
-
icon="pause"
|
|
108
|
-
class="icon-button video-button"
|
|
109
|
-
@click.native="play(false)"
|
|
110
|
-
/>
|
|
111
|
-
<map-svg-icon
|
|
112
|
-
v-else
|
|
113
|
-
icon="play"
|
|
114
|
-
class="video-button icon-button"
|
|
115
|
-
@click.native="play(true)"
|
|
116
|
-
/>
|
|
117
|
-
<el-slider
|
|
118
|
-
:min="0"
|
|
119
|
-
:max="timeMax"
|
|
120
|
-
:value="(sceneData.currentTime / 100) * timeMax"
|
|
121
|
-
:step="0.1"
|
|
122
|
-
tooltip-class="time-slider-tooltip"
|
|
123
|
-
class="slider"
|
|
124
|
-
:format-tooltip="formatTooltip"
|
|
125
|
-
:marks="timeStamps"
|
|
126
|
-
@input="timeChange($event)"
|
|
127
|
-
/>
|
|
128
|
-
</el-row>
|
|
129
|
-
</el-tab-pane>
|
|
130
|
-
<el-tab-pane label="Animation data">
|
|
131
|
-
<el-row class="tab-content">
|
|
132
|
-
<div class="animation-data">
|
|
133
|
-
Original duration:
|
|
134
|
-
<div class="purple">
|
|
135
|
-
{{ orginalDuration }}
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
<div class="animation-data">
|
|
139
|
-
Animation duration:
|
|
140
|
-
<div class="purple">
|
|
141
|
-
{{ animateDuration }}
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
<div class="animation-data">
|
|
145
|
-
Playback speed
|
|
146
|
-
<el-select
|
|
147
|
-
:popper-append-to-body="true"
|
|
148
|
-
:value="currentSpeed"
|
|
149
|
-
placeholder="Select"
|
|
150
|
-
class="select-box"
|
|
151
|
-
popper-class="scaffold_viewer_dropdown"
|
|
152
|
-
@change="speedChanged($event)"
|
|
153
|
-
>
|
|
154
|
-
<el-option
|
|
155
|
-
v-for="item in playSpeed"
|
|
156
|
-
:key="item.value"
|
|
157
|
-
:label="item.label"
|
|
158
|
-
:value="item.value"
|
|
159
|
-
/>
|
|
160
|
-
</el-select>
|
|
161
|
-
</div>
|
|
162
|
-
</el-row>
|
|
163
|
-
</el-tab-pane>
|
|
164
|
-
</el-tabs>
|
|
165
|
-
</div>
|
|
166
|
-
<div class="bottom-right-control">
|
|
167
|
-
<el-popover
|
|
168
|
-
v-model="hoverVisibilities[0].value"
|
|
169
|
-
content="Zoom in"
|
|
170
|
-
placement="left"
|
|
171
|
-
:append-to-body="false"
|
|
172
|
-
trigger="manual"
|
|
173
|
-
popper-class="scaffold-popper left-popper non-selectable"
|
|
174
|
-
>
|
|
175
|
-
<map-svg-icon
|
|
176
|
-
slot="reference"
|
|
177
|
-
icon="zoomIn"
|
|
178
|
-
class="icon-button zoomIn"
|
|
179
|
-
@click.native="zoomIn()"
|
|
180
|
-
@mouseover.native="showHelpText(0)"
|
|
181
|
-
@mouseout.native="hideHelpText(0)"
|
|
182
|
-
/>
|
|
183
|
-
</el-popover>
|
|
184
|
-
<el-popover
|
|
185
|
-
v-model="hoverVisibilities[1].value"
|
|
186
|
-
content="Zoom out"
|
|
187
|
-
placement="top-end"
|
|
188
|
-
:append-to-body="false"
|
|
189
|
-
trigger="manual"
|
|
190
|
-
popper-class="scaffold-popper popper-zoomout non-selectable"
|
|
191
|
-
>
|
|
192
|
-
<map-svg-icon
|
|
193
|
-
slot="reference"
|
|
194
|
-
icon="zoomOut"
|
|
195
|
-
class="icon-button zoomOut"
|
|
196
|
-
@click.native="zoomOut()"
|
|
197
|
-
@mouseover.native="showHelpText(1)"
|
|
198
|
-
@mouseout.native="hideHelpText(1)"
|
|
199
|
-
/>
|
|
200
|
-
</el-popover>
|
|
201
|
-
<el-popover
|
|
202
|
-
v-model="hoverVisibilities[2].value"
|
|
203
|
-
placement="top"
|
|
204
|
-
:append-to-body="false"
|
|
205
|
-
trigger="manual"
|
|
206
|
-
popper-class="scaffold-popper non-selectable"
|
|
207
|
-
>
|
|
208
|
-
<div>
|
|
209
|
-
Fit to
|
|
210
|
-
<br />
|
|
211
|
-
window
|
|
212
|
-
</div>
|
|
213
|
-
<map-svg-icon
|
|
214
|
-
slot="reference"
|
|
215
|
-
icon="fitWindow"
|
|
216
|
-
class="icon-button fitWindow"
|
|
217
|
-
@click.native="fitWindow()"
|
|
218
|
-
@mouseover.native="showHelpText(2)"
|
|
219
|
-
@mouseout.native="hideHelpText(2)"
|
|
220
|
-
/>
|
|
221
|
-
</el-popover>
|
|
222
|
-
</div>
|
|
223
|
-
<el-popover
|
|
224
|
-
ref="open-map-popover"
|
|
225
|
-
placement="top-start"
|
|
226
|
-
width="128"
|
|
227
|
-
:append-to-body="false"
|
|
228
|
-
trigger="click"
|
|
229
|
-
popper-class="open-map-popper"
|
|
230
|
-
>
|
|
231
|
-
<el-row v-for="item in openMapOptions" :key="item.key">
|
|
232
|
-
<el-button
|
|
233
|
-
type="primary"
|
|
234
|
-
plain
|
|
235
|
-
@click="$emit('open-map', item.key)"
|
|
236
|
-
>
|
|
237
|
-
{{ item.display }}
|
|
238
|
-
</el-button>
|
|
239
|
-
</el-row>
|
|
240
|
-
</el-popover>
|
|
241
|
-
<el-popover
|
|
242
|
-
ref="backgroundPopover"
|
|
243
|
-
placement="top-start"
|
|
244
|
-
width="128"
|
|
245
|
-
:append-to-body="false"
|
|
246
|
-
trigger="click"
|
|
247
|
-
popper-class="background-popper non-selectable"
|
|
248
|
-
>
|
|
249
|
-
<el-row class="backgroundText"> Change background </el-row>
|
|
250
|
-
<el-row class="backgroundChooser">
|
|
251
|
-
<div
|
|
252
|
-
v-for="item in availableBackground"
|
|
253
|
-
:key="item"
|
|
254
|
-
:class="[
|
|
255
|
-
'backgroundChoice',
|
|
256
|
-
item,
|
|
257
|
-
item == currentBackground ? 'active' : '',
|
|
258
|
-
]"
|
|
259
|
-
@click="backgroundChangeCallback(item)"
|
|
260
|
-
/>
|
|
261
|
-
</el-row>
|
|
262
|
-
</el-popover>
|
|
263
|
-
<div
|
|
264
|
-
class="settings-group"
|
|
265
|
-
:class="{ open: drawerOpen, close: !drawerOpen }"
|
|
266
|
-
>
|
|
267
|
-
<el-row>
|
|
268
|
-
<el-popover
|
|
269
|
-
v-model="hoverVisibilities[8].value"
|
|
270
|
-
content="Open new map"
|
|
271
|
-
placement="right"
|
|
272
|
-
:append-to-body="false"
|
|
273
|
-
trigger="manual"
|
|
274
|
-
popper-class="scaffold-popper right-popper non-selectable"
|
|
275
|
-
>
|
|
276
|
-
<map-svg-icon
|
|
277
|
-
v-if="enableOpenMapUI && openMapOptions.length > 0"
|
|
278
|
-
slot="reference"
|
|
279
|
-
v-popover:open-map-popover
|
|
280
|
-
icon="openMap"
|
|
281
|
-
class="icon-button"
|
|
282
|
-
@mouseover.native="showHelpText(8)"
|
|
283
|
-
@mouseout.native="hideHelpText(8)"
|
|
284
|
-
/>
|
|
285
|
-
</el-popover>
|
|
286
|
-
</el-row>
|
|
287
|
-
<el-row>
|
|
288
|
-
<el-popover
|
|
289
|
-
v-model="hoverVisibilities[3].value"
|
|
290
|
-
content="Change background color"
|
|
291
|
-
placement="right"
|
|
292
|
-
:append-to-body="false"
|
|
293
|
-
trigger="manual"
|
|
294
|
-
popper-class="scaffold-popper right-popper non-selectable"
|
|
295
|
-
>
|
|
296
|
-
<map-svg-icon
|
|
297
|
-
slot="reference"
|
|
298
|
-
v-popover:backgroundPopover
|
|
299
|
-
icon="changeBckgd"
|
|
300
|
-
class="icon-button"
|
|
301
|
-
@mouseover.native="showHelpText(3)"
|
|
302
|
-
@mouseout.native="hideHelpText(3)"
|
|
303
|
-
/>
|
|
304
|
-
</el-popover>
|
|
305
|
-
</el-row>
|
|
306
|
-
</div>
|
|
307
|
-
</div>
|
|
308
|
-
</div>
|
|
309
|
-
</template>
|
|
310
|
-
|
|
311
|
-
<script>
|
|
312
|
-
/* eslint-disable no-alert, no-console */
|
|
313
|
-
import Vue from "vue";
|
|
314
|
-
import
|
|
315
|
-
import ScaffoldTooltip from "./ScaffoldTooltip";
|
|
316
|
-
import TreeControls from "./TreeControls";
|
|
317
|
-
import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
|
|
318
|
-
import { findObjectsWithNames, getObjectsFromAnnotations } from "../scripts/utilities.js";
|
|
319
|
-
import { SearchIndex } from "../scripts/search.js";
|
|
320
|
-
import {
|
|
321
|
-
Button,
|
|
322
|
-
Col,
|
|
323
|
-
Loading,
|
|
324
|
-
Option,
|
|
325
|
-
Popover,
|
|
326
|
-
Row,
|
|
327
|
-
Select,
|
|
328
|
-
Slider,
|
|
329
|
-
TabPane,
|
|
330
|
-
Tabs,
|
|
331
|
-
} from "element-ui";
|
|
332
|
-
import lang from "element-ui/lib/locale/lang/en";
|
|
333
|
-
import locale from "element-ui/lib/locale";
|
|
334
|
-
|
|
335
|
-
locale.use(lang);
|
|
336
|
-
Vue.use(Button);
|
|
337
|
-
Vue.use(Col);
|
|
338
|
-
Vue.use(Loading.directive);
|
|
339
|
-
Vue.use(Option);
|
|
340
|
-
Vue.use(Popover);
|
|
341
|
-
Vue.use(Row);
|
|
342
|
-
Vue.use(Select);
|
|
343
|
-
Vue.use(Slider);
|
|
344
|
-
Vue.use(TabPane);
|
|
345
|
-
Vue.use(Tabs);
|
|
346
|
-
|
|
347
|
-
const OrgansViewer = require("../scripts/organsRenderer").OrgansViewer;
|
|
348
|
-
const EventNotifier = require("../scripts/eventNotifier").EventNotifier;
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* A vue component of the scaffold viewer.
|
|
352
|
-
*
|
|
353
|
-
* @requires ./
|
|
354
|
-
* @requires ./TreeControls.vue
|
|
355
|
-
*/
|
|
356
|
-
export default {
|
|
357
|
-
name: "ScaffoldVuer",
|
|
358
|
-
components: {
|
|
359
|
-
MapSvgIcon,
|
|
360
|
-
MapSvgSpriteColor,
|
|
361
|
-
|
|
362
|
-
ScaffoldTooltip,
|
|
363
|
-
TreeControls,
|
|
364
|
-
},
|
|
365
|
-
props: {
|
|
366
|
-
/**
|
|
367
|
-
* URL of the zincjs metadata. This value will be ignored if a valid
|
|
368
|
-
* state prop is also provided.
|
|
369
|
-
* If the url needs to be updated with state present, please use
|
|
370
|
-
* the setURL method.
|
|
371
|
-
*/
|
|
372
|
-
url: {
|
|
373
|
-
type: String,
|
|
374
|
-
default: "",
|
|
375
|
-
},
|
|
376
|
-
/**
|
|
377
|
-
* Show the colour control of set to true.
|
|
378
|
-
*/
|
|
379
|
-
showColourPicker: {
|
|
380
|
-
type: Boolean,
|
|
381
|
-
default: false,
|
|
382
|
-
},
|
|
383
|
-
/**
|
|
384
|
-
* Flag to show/hide the UI.
|
|
385
|
-
*/
|
|
386
|
-
displayUI: {
|
|
387
|
-
type: Boolean,
|
|
388
|
-
default: true,
|
|
389
|
-
},
|
|
390
|
-
/**
|
|
391
|
-
* Display all graphics at start.
|
|
392
|
-
*
|
|
393
|
-
* This setting only works when traditional is set to false.
|
|
394
|
-
*/
|
|
395
|
-
displayAtStartUp: {
|
|
396
|
-
type: Boolean,
|
|
397
|
-
default: true,
|
|
398
|
-
},
|
|
399
|
-
/**
|
|
400
|
-
* Use for toggling the help tooltips.
|
|
401
|
-
*/
|
|
402
|
-
helpMode: {
|
|
403
|
-
type: Boolean,
|
|
404
|
-
default: false,
|
|
405
|
-
},
|
|
406
|
-
/**
|
|
407
|
-
* Use for show/display beta warning icon.
|
|
408
|
-
*/
|
|
409
|
-
displayWarning: {
|
|
410
|
-
type: Boolean,
|
|
411
|
-
default: true,
|
|
412
|
-
},
|
|
413
|
-
/**
|
|
414
|
-
* Warning message for the hovered over text
|
|
415
|
-
* on the warning icon.
|
|
416
|
-
*/
|
|
417
|
-
warningMessage: {
|
|
418
|
-
type: String,
|
|
419
|
-
default: "Beta feature - under active development",
|
|
420
|
-
},
|
|
421
|
-
displayLatestChanges: {
|
|
422
|
-
type: Boolean,
|
|
423
|
-
default: false,
|
|
424
|
-
},
|
|
425
|
-
latestChangesMessage: {
|
|
426
|
-
type: String,
|
|
427
|
-
default: "New feature - Local search is now available",
|
|
428
|
-
},
|
|
429
|
-
/**
|
|
430
|
-
* Show/hide pickable markers for regions.
|
|
431
|
-
*/
|
|
432
|
-
displayMarkers: {
|
|
433
|
-
type: Boolean,
|
|
434
|
-
default: false,
|
|
435
|
-
},
|
|
436
|
-
markerLabels : {
|
|
437
|
-
type: Array,
|
|
438
|
-
default: function () {
|
|
439
|
-
return []
|
|
440
|
-
}
|
|
441
|
-
},
|
|
442
|
-
/**
|
|
443
|
-
* Show/hide minimap.
|
|
444
|
-
*/
|
|
445
|
-
displayMinimap: {
|
|
446
|
-
type: Boolean,
|
|
447
|
-
default: false,
|
|
448
|
-
},
|
|
449
|
-
/**
|
|
450
|
-
* Format of the input URL
|
|
451
|
-
*/
|
|
452
|
-
format: {
|
|
453
|
-
type: String,
|
|
454
|
-
default: "metadata",
|
|
455
|
-
},
|
|
456
|
-
/**
|
|
457
|
-
* Settings for minimap position, size and alignment.
|
|
458
|
-
*/
|
|
459
|
-
minimapSettings: {
|
|
460
|
-
type: Object,
|
|
461
|
-
default: function () {
|
|
462
|
-
return {
|
|
463
|
-
x_offset: 16,
|
|
464
|
-
y_offset: 16,
|
|
465
|
-
width: 128,
|
|
466
|
-
height: 128,
|
|
467
|
-
align: "top-right",
|
|
468
|
-
};
|
|
469
|
-
},
|
|
470
|
-
},
|
|
471
|
-
/**
|
|
472
|
-
* Flag to determine rather open map UI should be
|
|
473
|
-
* presented or not.
|
|
474
|
-
*/
|
|
475
|
-
enableOpenMapUI: {
|
|
476
|
-
type: Boolean,
|
|
477
|
-
default: false,
|
|
478
|
-
},
|
|
479
|
-
openMapOptions: {
|
|
480
|
-
type: Array,
|
|
481
|
-
default: function () {
|
|
482
|
-
return [
|
|
483
|
-
{
|
|
484
|
-
display: "Open AC Map",
|
|
485
|
-
key: "AC"
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
display: "Open FC Map",
|
|
489
|
-
key: "FC"
|
|
490
|
-
},
|
|
491
|
-
{
|
|
492
|
-
display: "Open 3D Human Map",
|
|
493
|
-
key: "3D"
|
|
494
|
-
},
|
|
495
|
-
]
|
|
496
|
-
},
|
|
497
|
-
},
|
|
498
|
-
/**
|
|
499
|
-
* State containing state of the scaffold.
|
|
500
|
-
*/
|
|
501
|
-
state: {
|
|
502
|
-
type: Object,
|
|
503
|
-
default: undefined,
|
|
504
|
-
},
|
|
505
|
-
/**
|
|
506
|
-
* Optional prop for the name of the region to focus on,
|
|
507
|
-
* this option is ignored if state or viewURL is also provided.
|
|
508
|
-
*/
|
|
509
|
-
region: {
|
|
510
|
-
type: String,
|
|
511
|
-
default: "",
|
|
512
|
-
},
|
|
513
|
-
/**
|
|
514
|
-
* Optional prop for an URL of containing information of a viewport.
|
|
515
|
-
* This option is ignored if state is also provided.
|
|
516
|
-
* It will use the provided URL as base if a relative parth is provided.
|
|
517
|
-
*/
|
|
518
|
-
viewURL: {
|
|
519
|
-
type: String,
|
|
520
|
-
default: "",
|
|
521
|
-
},
|
|
522
|
-
/**
|
|
523
|
-
* Settings for turning on/off rendering
|
|
524
|
-
*/
|
|
525
|
-
render: {
|
|
526
|
-
type: Boolean,
|
|
527
|
-
default: true,
|
|
528
|
-
},
|
|
529
|
-
},
|
|
530
|
-
data: function () {
|
|
531
|
-
return {
|
|
532
|
-
sceneData: this.$module.sceneData,
|
|
533
|
-
isPlaying: false,
|
|
534
|
-
isReady: false,
|
|
535
|
-
/**
|
|
536
|
-
* This is set when scene is transitioning.
|
|
537
|
-
*/
|
|
538
|
-
isTransitioning: false,
|
|
539
|
-
tooltipAppendToBody: false,
|
|
540
|
-
hoverVisibilities: [
|
|
541
|
-
{ value: false },
|
|
542
|
-
{ value: false },
|
|
543
|
-
{ value: false },
|
|
544
|
-
{ value: false },
|
|
545
|
-
{ value: false },
|
|
546
|
-
{ value: false },
|
|
547
|
-
{ value: false },
|
|
548
|
-
{ value: false },
|
|
549
|
-
{ value: false },
|
|
550
|
-
],
|
|
551
|
-
inHelp: false,
|
|
552
|
-
loading: false,
|
|
553
|
-
duration: 3000,
|
|
554
|
-
drawerOpen: true,
|
|
555
|
-
currentBackground: "white",
|
|
556
|
-
availableBackground: ["white", "lightskyblue", "black"],
|
|
557
|
-
minimisedSlider: false,
|
|
558
|
-
sliderPosition: "",
|
|
559
|
-
timeMax: 100,
|
|
560
|
-
orginalDuration: "",
|
|
561
|
-
animateDuration: "6secs",
|
|
562
|
-
playSpeed: [
|
|
563
|
-
{
|
|
564
|
-
value: 0.1,
|
|
565
|
-
label: "0.1x",
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
value: 0.5,
|
|
569
|
-
label: "0.5x",
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
value: 1,
|
|
573
|
-
label: "1x",
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
value: 2,
|
|
577
|
-
label: "2x",
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
value: 5,
|
|
581
|
-
label: "5x",
|
|
582
|
-
},
|
|
583
|
-
{
|
|
584
|
-
value: 10,
|
|
585
|
-
label: "10x",
|
|
586
|
-
},
|
|
587
|
-
],
|
|
588
|
-
currentSpeed: 1,
|
|
589
|
-
timeStamps: {},
|
|
590
|
-
defaultCheckedKeys: [],
|
|
591
|
-
tData: {
|
|
592
|
-
label: "",
|
|
593
|
-
region: "",
|
|
594
|
-
visible: false,
|
|
595
|
-
x: 200,
|
|
596
|
-
y: 200,
|
|
597
|
-
},
|
|
598
|
-
fileFormat: "metadata",
|
|
599
|
-
previousMarkerLabels: [],
|
|
600
|
-
};
|
|
601
|
-
},
|
|
602
|
-
watch: {
|
|
603
|
-
format: {
|
|
604
|
-
handler: function (value) {
|
|
605
|
-
this.fileFormat = value;
|
|
606
|
-
},
|
|
607
|
-
immediate: true,
|
|
608
|
-
},
|
|
609
|
-
url: {
|
|
610
|
-
handler: function (newValue) {
|
|
611
|
-
if (this.state === undefined || this.state.url === undefined)
|
|
612
|
-
this.setURL(newValue);
|
|
613
|
-
},
|
|
614
|
-
immediate: true,
|
|
615
|
-
},
|
|
616
|
-
region: {
|
|
617
|
-
handler: function (region) {
|
|
618
|
-
if (!(this.state || this.viewURL)) this.setFocusedRegion(region);
|
|
619
|
-
},
|
|
620
|
-
immediate: true,
|
|
621
|
-
},
|
|
622
|
-
state: {
|
|
623
|
-
handler: function (state) {
|
|
624
|
-
this.setState(state);
|
|
625
|
-
},
|
|
626
|
-
immediate: true,
|
|
627
|
-
deep: true,
|
|
628
|
-
},
|
|
629
|
-
viewURL: {
|
|
630
|
-
handler: function (viewURL) {
|
|
631
|
-
this.updateViewURL(viewURL);
|
|
632
|
-
},
|
|
633
|
-
immediate: true,
|
|
634
|
-
},
|
|
635
|
-
helpMode: function (val) {
|
|
636
|
-
this.setHelpMode(val);
|
|
637
|
-
},
|
|
638
|
-
displayMarkers: function (val) {
|
|
639
|
-
this.$module.scene.displayMarkers = val;
|
|
640
|
-
//Update pickable objects
|
|
641
|
-
this.$module.scene.forcePickableObjectsUpdate = true;
|
|
642
|
-
},
|
|
643
|
-
displayMinimap: function (val) {
|
|
644
|
-
this.$module.scene.displayMinimap = val;
|
|
645
|
-
},
|
|
646
|
-
"sceneData.currentTime": function () {
|
|
647
|
-
/**
|
|
648
|
-
* Triggers when scene time changes.
|
|
649
|
-
*
|
|
650
|
-
* @property {number} time Current build-in time of scene.
|
|
651
|
-
* of selected object.
|
|
652
|
-
*/
|
|
653
|
-
this.$emit("timeChanged", this.sceneData.currentTime);
|
|
654
|
-
},
|
|
655
|
-
duration: function () {
|
|
656
|
-
this.$module.scene.setDuration(this.duration);
|
|
657
|
-
},
|
|
658
|
-
minimapSettings: {
|
|
659
|
-
deep: true,
|
|
660
|
-
handler: "updateMinimapScissor",
|
|
661
|
-
},
|
|
662
|
-
render: function (val) {
|
|
663
|
-
this.toggleRendering(val);
|
|
664
|
-
},
|
|
665
|
-
markerLabels: function(labels) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
this
|
|
678
|
-
this.
|
|
679
|
-
this.
|
|
680
|
-
this.
|
|
681
|
-
this.
|
|
682
|
-
this
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
this.$module.
|
|
690
|
-
this.$module.
|
|
691
|
-
this
|
|
692
|
-
this.
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
);
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
this.$module
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
this
|
|
707
|
-
this.zincObjectAdded(zincObject);
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
this.
|
|
716
|
-
this.$
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
this.
|
|
737
|
-
|
|
738
|
-
.
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
*
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
.
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
hrefElement.
|
|
758
|
-
hrefElement.
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
*
|
|
763
|
-
*
|
|
764
|
-
*
|
|
765
|
-
*
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
this.
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
*
|
|
776
|
-
*
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
if (this.$
|
|
781
|
-
if (this.$
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
let
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
*
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
*
|
|
807
|
-
*
|
|
808
|
-
*
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
*
|
|
818
|
-
*
|
|
819
|
-
*
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
*
|
|
829
|
-
*
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
this.
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
*
|
|
838
|
-
*
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
const
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
this.$module.scene.
|
|
868
|
-
this.$module.scene.camera.
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
*
|
|
906
|
-
*
|
|
907
|
-
*
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
cameracontrol.
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
*
|
|
921
|
-
*
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
* Event Type
|
|
941
|
-
* Event Type
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
this.
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
this.
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
this.tData.
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
this.tData.
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
this.tData.
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
*
|
|
999
|
-
*
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
*
|
|
1010
|
-
*
|
|
1011
|
-
*
|
|
1012
|
-
*
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
this.selectedObjects
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
this.$module.setSelectedByZincObjects(objects, undefined, propagate);
|
|
1036
|
-
},
|
|
1037
|
-
/**
|
|
1038
|
-
* A callback used by children components. Set the highlighted zinc object
|
|
1039
|
-
*
|
|
1040
|
-
* @param {object} object Zinc object
|
|
1041
|
-
*/
|
|
1042
|
-
objectHovered: function (objects, propagate) {
|
|
1043
|
-
this.hoveredObjects = objects;
|
|
1044
|
-
this.$module.setHighlightedByZincObjects(objects, undefined, propagate);
|
|
1045
|
-
},
|
|
1046
|
-
/**
|
|
1047
|
-
* Set the selected by name.
|
|
1048
|
-
*
|
|
1049
|
-
* @param {} name Name of the group
|
|
1050
|
-
*/
|
|
1051
|
-
changeActiveByName: function (names, region, propagate) {
|
|
1052
|
-
const isArray = Array.isArray(names);
|
|
1053
|
-
if (names === undefined || (isArray && names.length === 0)) {
|
|
1054
|
-
this.$refs.treeControls.removeActive(propagate);
|
|
1055
|
-
} else {
|
|
1056
|
-
let array = names;
|
|
1057
|
-
if (!isArray) array = [array];
|
|
1058
|
-
this.$refs.treeControls.changeActiveByNames(array, region, propagate);
|
|
1059
|
-
}
|
|
1060
|
-
},
|
|
1061
|
-
/**
|
|
1062
|
-
* Set the highlighted by name.
|
|
1063
|
-
*
|
|
1064
|
-
* @param {name} name Name of the group
|
|
1065
|
-
*/
|
|
1066
|
-
changeHighlightedByName: function (names, region, propagate) {
|
|
1067
|
-
const isArray = Array.isArray(names);
|
|
1068
|
-
if (names === undefined || (isArray && names.length === 0)) {
|
|
1069
|
-
this.$refs.treeControls.removeHover(propagate);
|
|
1070
|
-
} else {
|
|
1071
|
-
let array = names;
|
|
1072
|
-
if (!isArray) array = [array];
|
|
1073
|
-
this.$refs.treeControls.changeHoverByNames(array, region, propagate);
|
|
1074
|
-
}
|
|
1075
|
-
},
|
|
1076
|
-
/**
|
|
1077
|
-
* Start the animation.
|
|
1078
|
-
*
|
|
1079
|
-
* @param {object} object Zinc object
|
|
1080
|
-
*/
|
|
1081
|
-
play: function (flag) {
|
|
1082
|
-
this.$module.playAnimation(flag);
|
|
1083
|
-
this.isPlaying = flag;
|
|
1084
|
-
//Hide tooltip as location may
|
|
1085
|
-
//this.hideRegionTooltip();
|
|
1086
|
-
},
|
|
1087
|
-
/**
|
|
1088
|
-
* Function to toggle on/off overlay help.
|
|
1089
|
-
*/
|
|
1090
|
-
setHelpMode: function (helpMode) {
|
|
1091
|
-
if (helpMode) {
|
|
1092
|
-
this.inHelp = true;
|
|
1093
|
-
this.hoverVisibilities.forEach((item) => {
|
|
1094
|
-
item.value = true;
|
|
1095
|
-
});
|
|
1096
|
-
} else {
|
|
1097
|
-
this.inHelp = false;
|
|
1098
|
-
this.hoverVisibilities.forEach((item) => {
|
|
1099
|
-
item.value = false;
|
|
1100
|
-
});
|
|
1101
|
-
}
|
|
1102
|
-
},
|
|
1103
|
-
/**
|
|
1104
|
-
* Callback function used by showRegionTooltip in the case when the tooltip
|
|
1105
|
-
* is out of view.
|
|
1106
|
-
*/
|
|
1107
|
-
displayTooltipOfObjectsCallback: function (
|
|
1108
|
-
name,
|
|
1109
|
-
objects,
|
|
1110
|
-
regionPath,
|
|
1111
|
-
resetView,
|
|
1112
|
-
liveUpdates
|
|
1113
|
-
) {
|
|
1114
|
-
const instance = this;
|
|
1115
|
-
return function () {
|
|
1116
|
-
instance.$module.zincRenderer.removePostRenderCallbackFunction(
|
|
1117
|
-
instance.$_regionTooltipCallback
|
|
1118
|
-
);
|
|
1119
|
-
instance.$_regionTooltipCallback = undefined;
|
|
1120
|
-
instance.displayTooltipOfObjects(name, objects, regionPath, resetView, liveUpdates);
|
|
1121
|
-
};
|
|
1122
|
-
},
|
|
1123
|
-
liveUpdateTooltipPosition: function () {
|
|
1124
|
-
if (this.$module.selectedCenter) {
|
|
1125
|
-
this.tData.x = this.$module.selectedScreenCoordinates.x;
|
|
1126
|
-
this.tData.y = this.$module.selectedScreenCoordinates.y;
|
|
1127
|
-
}
|
|
1128
|
-
},
|
|
1129
|
-
displayTooltipOfObjects: function (name, objects, regionPath, resetView, liveUpdates) {
|
|
1130
|
-
if (objects.length > 0) {
|
|
1131
|
-
let coords = objects[0].getClosestVertexDOMElementCoords(
|
|
1132
|
-
this.$module.scene
|
|
1133
|
-
);
|
|
1134
|
-
if (coords) {
|
|
1135
|
-
//The coords is not in view, view all if resetView flag is true
|
|
1136
|
-
if (!coords.inView) {
|
|
1137
|
-
this.hideRegionTooltip();
|
|
1138
|
-
if (resetView) {
|
|
1139
|
-
this.$module.scene.viewAll();
|
|
1140
|
-
//Use the post render callback to make sure the scene has been updated
|
|
1141
|
-
//before getting the position of the tooltip.
|
|
1142
|
-
if (this.$_regionTooltipCallback) {
|
|
1143
|
-
this.$module.zincRenderer.removePostRenderCallbackFunction(
|
|
1144
|
-
this.$_regionTooltipCallback
|
|
1145
|
-
);
|
|
1146
|
-
}
|
|
1147
|
-
this.$_regionTooltipCallback =
|
|
1148
|
-
this.$module.zincRenderer.addPostRenderCallbackFunction(
|
|
1149
|
-
this.displayTooltipOfObjectsCallback(
|
|
1150
|
-
name,
|
|
1151
|
-
objects,
|
|
1152
|
-
regionPath,
|
|
1153
|
-
resetView,
|
|
1154
|
-
liveUpdates
|
|
1155
|
-
)
|
|
1156
|
-
);
|
|
1157
|
-
}
|
|
1158
|
-
} else {
|
|
1159
|
-
this.tData.visible = true;
|
|
1160
|
-
this.tData.label = name;
|
|
1161
|
-
this.tData.x = coords.position.x;
|
|
1162
|
-
this.tData.y = coords.position.y;
|
|
1163
|
-
this.tData.region = regionPath;
|
|
1164
|
-
if (this.$_liveCoordinatesUpdated) {
|
|
1165
|
-
this.$module.zincRenderer.removePostRenderCallbackFunction(
|
|
1166
|
-
this.$_liveCoordinatesUpdated
|
|
1167
|
-
);
|
|
1168
|
-
}
|
|
1169
|
-
if (liveUpdates) {
|
|
1170
|
-
this.$module.setupLiveCoordinates(objects);
|
|
1171
|
-
this.$_liveCoordinatesUpdated =
|
|
1172
|
-
this.$module.zincRenderer.addPostRenderCallbackFunction(
|
|
1173
|
-
this.liveUpdateTooltipPosition
|
|
1174
|
-
);
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
return true;
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
this.hideRegionTooltip();
|
|
1181
|
-
return false;
|
|
1182
|
-
},
|
|
1183
|
-
/**
|
|
1184
|
-
* Display the tooltip used for displaying search result.
|
|
1185
|
-
* When resetView is set to true, it will
|
|
1186
|
-
* reset view if the tooltip is not in view.
|
|
1187
|
-
* Setting liveUpdates to true will update the tooltip location
|
|
1188
|
-
* at every rendering loop.
|
|
1189
|
-
*/
|
|
1190
|
-
showRegionTooltipWithObjects: function (label, zincObjects, regionPath, resetView, liveUpdates) {
|
|
1191
|
-
if (label && zincObjects && zincObjects.length > 0 && this.$module.scene) {
|
|
1192
|
-
return this.displayTooltipOfObjects(
|
|
1193
|
-
label,
|
|
1194
|
-
zincObjects,
|
|
1195
|
-
regionPath,
|
|
1196
|
-
resetView,
|
|
1197
|
-
liveUpdates
|
|
1198
|
-
);
|
|
1199
|
-
}
|
|
1200
|
-
this.hideRegionTooltip();
|
|
1201
|
-
return false;
|
|
1202
|
-
},
|
|
1203
|
-
/**
|
|
1204
|
-
* Display the tooltip. When resetView is set to true, it will
|
|
1205
|
-
* reset view if the tooltip is not in view.
|
|
1206
|
-
* Setting liveUpdates to true will update the tooltip location
|
|
1207
|
-
* at every rendering loop.
|
|
1208
|
-
*/
|
|
1209
|
-
showRegionTooltip: function (name, resetView, liveUpdates) {
|
|
1210
|
-
if (name && this.$module.scene) {
|
|
1211
|
-
const rootRegion = this.$module.scene.getRootRegion();
|
|
1212
|
-
const groups = [name];
|
|
1213
|
-
const objects = findObjectsWithNames(rootRegion, groups, "", true);
|
|
1214
|
-
let regionPath = undefined;
|
|
1215
|
-
if (objects && objects.length > 0) {
|
|
1216
|
-
regionPath = objects[0].getRegion().getFullPath();
|
|
1217
|
-
}
|
|
1218
|
-
return this.showRegionTooltipWithObjects(
|
|
1219
|
-
name,
|
|
1220
|
-
objects,
|
|
1221
|
-
regionPath,
|
|
1222
|
-
resetView,
|
|
1223
|
-
liveUpdates
|
|
1224
|
-
);
|
|
1225
|
-
}
|
|
1226
|
-
this.hideRegionTooltip();
|
|
1227
|
-
return false;
|
|
1228
|
-
},
|
|
1229
|
-
/**
|
|
1230
|
-
* Display the tooltip using the list of annotations.
|
|
1231
|
-
* When resetView is set to true, it will
|
|
1232
|
-
* reset view if the tooltip is not in view.
|
|
1233
|
-
* Setting liveUpdates to true will update the tooltip location
|
|
1234
|
-
* at every rendering loop.
|
|
1235
|
-
*/
|
|
1236
|
-
showRegionTooltipWithAnnotations: function (annotations, resetView, liveUpdates) {
|
|
1237
|
-
if (this.$module.scene) {
|
|
1238
|
-
const result = getObjectsFromAnnotations(this.$module.scene, annotations);
|
|
1239
|
-
if (result && result.objects.length > 0) {
|
|
1240
|
-
return this.showRegionTooltipWithObjects(
|
|
1241
|
-
result.label,
|
|
1242
|
-
result.objects,
|
|
1243
|
-
result.regionPath,
|
|
1244
|
-
resetView,
|
|
1245
|
-
liveUpdates
|
|
1246
|
-
);
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
this.hideRegionTooltip();
|
|
1250
|
-
return false;
|
|
1251
|
-
},
|
|
1252
|
-
hideRegionTooltip: function () {
|
|
1253
|
-
if (this.$_liveCoordinatesUpdated) {
|
|
1254
|
-
this.$module.zincRenderer.removePostRenderCallbackFunction(
|
|
1255
|
-
this.$_liveCoordinatesUpdated
|
|
1256
|
-
);
|
|
1257
|
-
//Unset the tracking
|
|
1258
|
-
this.$module.setupLiveCoordinates(undefined);
|
|
1259
|
-
}
|
|
1260
|
-
this.tData.visible = false;
|
|
1261
|
-
this.tData.region = undefined;
|
|
1262
|
-
},
|
|
1263
|
-
/**
|
|
1264
|
-
* Set the marker modes for objects with the provided name, mode can
|
|
1265
|
-
* be "on", "off" or "inherited".
|
|
1266
|
-
*/
|
|
1267
|
-
setMarkerModeForObjectsWithName: function (name, mode) {
|
|
1268
|
-
if (name && this.$module.scene) {
|
|
1269
|
-
const rootRegion = this.$module.scene.getRootRegion();
|
|
1270
|
-
const groups = [name];
|
|
1271
|
-
const objects = findObjectsWithNames(rootRegion, groups, "", true);
|
|
1272
|
-
objects.forEach(object => object.setMarkerMode(mode));
|
|
1273
|
-
}
|
|
1274
|
-
},
|
|
1275
|
-
/**
|
|
1276
|
-
* Set the marker modes for objects specified by the list of annotations
|
|
1277
|
-
*/
|
|
1278
|
-
setMarkerModeWithAnnotations: function (annotations, mode) {
|
|
1279
|
-
if (this.$module.scene) {
|
|
1280
|
-
const result = getObjectsFromAnnotations(this.$module.scene, annotations);
|
|
1281
|
-
if (result && result.objects.length > 0) {
|
|
1282
|
-
result.objects.forEach(object => object.setMarkerMode(mode));
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
},
|
|
1286
|
-
/**
|
|
1287
|
-
* This is called when mouse cursor enters supported elements
|
|
1288
|
-
* with help tootltips.
|
|
1289
|
-
*/
|
|
1290
|
-
showHelpText: function (helpTextNumber) {
|
|
1291
|
-
if (!this.inHelp) {
|
|
1292
|
-
this.helpTextWait = setTimeout(() => {
|
|
1293
|
-
this.hoverVisibilities[helpTextNumber].value = true;
|
|
1294
|
-
}, 500);
|
|
1295
|
-
}
|
|
1296
|
-
},
|
|
1297
|
-
/**
|
|
1298
|
-
* This is called when mouse cursor exits supported element..
|
|
1299
|
-
*/
|
|
1300
|
-
hideHelpText: function (helpTextNumber) {
|
|
1301
|
-
if (!this.inHelp) {
|
|
1302
|
-
this.hoverVisibilities[helpTextNumber].value = false;
|
|
1303
|
-
clearTimeout(this.helpTextWait);
|
|
1304
|
-
}
|
|
1305
|
-
},
|
|
1306
|
-
search: function (text, displayLabel) {
|
|
1307
|
-
if (this.$_searchIndex) {
|
|
1308
|
-
if (text === undefined || text === "" ||
|
|
1309
|
-
((Array.isArray(text) && text.length === 0))
|
|
1310
|
-
) {
|
|
1311
|
-
this.objectSelected([], true);
|
|
1312
|
-
return false;
|
|
1313
|
-
} else {
|
|
1314
|
-
const result = this.$_searchIndex.searchAndProcessResult(text);
|
|
1315
|
-
const zincObjects = result.zincObjects;
|
|
1316
|
-
if (zincObjects.length > 0) {
|
|
1317
|
-
this.objectSelected(zincObjects, true);
|
|
1318
|
-
if (displayLabel) {
|
|
1319
|
-
for (let i = 0; i < zincObjects.length; i++) {
|
|
1320
|
-
if (zincObjects[i] && zincObjects[i].groupName) {
|
|
1321
|
-
this.showRegionTooltipWithObjects(
|
|
1322
|
-
result.label,
|
|
1323
|
-
zincObjects,
|
|
1324
|
-
result.regionPath,
|
|
1325
|
-
true,
|
|
1326
|
-
true
|
|
1327
|
-
);
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
return true;
|
|
1332
|
-
} else {
|
|
1333
|
-
this.objectSelected([], true);
|
|
1334
|
-
}
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
return false;
|
|
1338
|
-
},
|
|
1339
|
-
/**
|
|
1340
|
-
* Get the list of suggested terms
|
|
1341
|
-
*/
|
|
1342
|
-
fetchSuggestions: function (term) {
|
|
1343
|
-
if (this.$_searchIndex === undefined) return [];
|
|
1344
|
-
return this.$_searchIndex.auto_suggest(term);
|
|
1345
|
-
},
|
|
1346
|
-
/**
|
|
1347
|
-
* Called when minimap settings has changed. Pass the
|
|
1348
|
-
* parameters to ZincJS and marked it for update.
|
|
1349
|
-
*/
|
|
1350
|
-
updateMinimapScissor: function () {
|
|
1351
|
-
Object.keys(this.minimapSettings).forEach((key) => {
|
|
1352
|
-
this.$module.scene.minimapScissor[key] = this.minimapSettings[key];
|
|
1353
|
-
});
|
|
1354
|
-
this.$module.scene.minimapScissor.updateRequired = true;
|
|
1355
|
-
},
|
|
1356
|
-
updateSettingsfromScene: function () {
|
|
1357
|
-
this.currentSpeed = 1;
|
|
1358
|
-
this.$module.setPlayRate(this.defaultRate);
|
|
1359
|
-
this.orginalDuration =
|
|
1360
|
-
this.$module.scene.getMetadataTag("OriginalDuration");
|
|
1361
|
-
this.animateDuration = this.$module.scene.getMetadataTag("Duration");
|
|
1362
|
-
let timeStamps = this.$module.scene.getMetadataTag("TimeStamps");
|
|
1363
|
-
this.timeStamps = {};
|
|
1364
|
-
for (const key in timeStamps) {
|
|
1365
|
-
this.timeStamps[timeStamps[key]] = key;
|
|
1366
|
-
}
|
|
1367
|
-
this.timeMax = this.$module.scene.getDuration();
|
|
1368
|
-
},
|
|
1369
|
-
setURLFinishCallback: function (options) {
|
|
1370
|
-
return () => {
|
|
1371
|
-
if (options) {
|
|
1372
|
-
if (options.viewport) {
|
|
1373
|
-
this.$module.scene
|
|
1374
|
-
.getZincCameraControls()
|
|
1375
|
-
.setCurrentCameraSettings(options.viewport);
|
|
1376
|
-
} else if (options.viewURL && options.viewURL !== "") {
|
|
1377
|
-
const url = new URL(options.viewURL, this.url);
|
|
1378
|
-
this.$module.scene.loadViewURL(url);
|
|
1379
|
-
} else if (options.region && options.region !== "") {
|
|
1380
|
-
this.viewRegion(options.region);
|
|
1381
|
-
}
|
|
1382
|
-
if (options.visibility) {
|
|
1383
|
-
// Some UIs may not be ready at this time.
|
|
1384
|
-
this.$nextTick(() => {
|
|
1385
|
-
this.$refs.treeControls.setState(options.visibility);
|
|
1386
|
-
});
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
this.updateSettingsfromScene();
|
|
1390
|
-
this.$module.updateTime(0.01);
|
|
1391
|
-
this.$module.updateTime(0);
|
|
1392
|
-
this.$module.unsetFinishDownloadCallback();
|
|
1393
|
-
this.addRegionsToSearchIndex();
|
|
1394
|
-
this.$emit("on-ready");
|
|
1395
|
-
this.setMarkers();
|
|
1396
|
-
this.isReady = true;
|
|
1397
|
-
};
|
|
1398
|
-
},
|
|
1399
|
-
/**
|
|
1400
|
-
* Function used for getting the current states of the scene. This exported states
|
|
1401
|
-
* can be imported using the importStates method.
|
|
1402
|
-
*
|
|
1403
|
-
* @public
|
|
1404
|
-
*/
|
|
1405
|
-
getState: function () {
|
|
1406
|
-
let state = {
|
|
1407
|
-
format: this.fileFormat,
|
|
1408
|
-
url: this._currentURL,
|
|
1409
|
-
viewport: undefined,
|
|
1410
|
-
visibility: undefined,
|
|
1411
|
-
};
|
|
1412
|
-
if (this.$refs.treeControls)
|
|
1413
|
-
state.visibility = this.$refs.treeControls.getState();
|
|
1414
|
-
if (this.$module.scene) {
|
|
1415
|
-
let zincCameraControls = this.$module.scene.getZincCameraControls();
|
|
1416
|
-
state.viewport = zincCameraControls.getCurrentViewport();
|
|
1417
|
-
}
|
|
1418
|
-
return state;
|
|
1419
|
-
},
|
|
1420
|
-
/**
|
|
1421
|
-
* Function used for importing the states of the scene. This exported states
|
|
1422
|
-
* can be imported using the read states method.
|
|
1423
|
-
*
|
|
1424
|
-
* @public
|
|
1425
|
-
*/
|
|
1426
|
-
setState: function (state) {
|
|
1427
|
-
if (state) {
|
|
1428
|
-
if (state.url && state.url !== this._currentURL) {
|
|
1429
|
-
this.setURLAndState(state.url, {
|
|
1430
|
-
fileFormat: state.fileFormat,
|
|
1431
|
-
viewport: state.viewport,
|
|
1432
|
-
visibility: state.visibility,
|
|
1433
|
-
});
|
|
1434
|
-
} else {
|
|
1435
|
-
if (state.viewport || state.visibility) {
|
|
1436
|
-
if (this.isReady && this.$module.scene) {
|
|
1437
|
-
if (state.viewport)
|
|
1438
|
-
this.$module.scene
|
|
1439
|
-
.getZincCameraControls()
|
|
1440
|
-
.setCurrentCameraSettings(state.viewport);
|
|
1441
|
-
if (state.visibility)
|
|
1442
|
-
this.$refs.treeControls.setState(state.visibility);
|
|
1443
|
-
} else {
|
|
1444
|
-
this.$module.setFinishDownloadCallback(
|
|
1445
|
-
this.setURLFinishCallback({
|
|
1446
|
-
viewport: state.viewport,
|
|
1447
|
-
visibility: state.visibility,
|
|
1448
|
-
})
|
|
1449
|
-
);
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
},
|
|
1455
|
-
exportGLTF: function (binary) {
|
|
1456
|
-
return this.$module.scene.exportGLTF(binary);
|
|
1457
|
-
},
|
|
1458
|
-
/**
|
|
1459
|
-
* Function used for reading in new scaffold metadata and a custom
|
|
1460
|
-
* viewport. This function will ignore the state prop and
|
|
1461
|
-
* read in the new url.
|
|
1462
|
-
*
|
|
1463
|
-
* @public
|
|
1464
|
-
*/
|
|
1465
|
-
setURLAndState: function (newValue, state) {
|
|
1466
|
-
if (newValue != this._currentURL) {
|
|
1467
|
-
if (state && state.format) this.fileFormat = state.format;
|
|
1468
|
-
let viewport = state && state.viewport ? state.viewport : undefined;
|
|
1469
|
-
let visibility =
|
|
1470
|
-
state && state.visibility ? state.visibility : undefined;
|
|
1471
|
-
this._currentURL = newValue;
|
|
1472
|
-
if (this.$refs.treeControls) this.$refs.treeControls.clear();
|
|
1473
|
-
this.loading = true;
|
|
1474
|
-
this.isReady = false;
|
|
1475
|
-
this.$_searchIndex.removeAll();
|
|
1476
|
-
this.hideRegionTooltip();
|
|
1477
|
-
this.$module.setFinishDownloadCallback(
|
|
1478
|
-
this.setURLFinishCallback({
|
|
1479
|
-
viewport: viewport,
|
|
1480
|
-
region: this.region,
|
|
1481
|
-
viewURL: this.viewURL,
|
|
1482
|
-
visibility: visibility,
|
|
1483
|
-
})
|
|
1484
|
-
);
|
|
1485
|
-
if (this.fileFormat === "gltf") {
|
|
1486
|
-
this.$module.loadGLTFFromURL(newValue, "scene", true);
|
|
1487
|
-
} else {
|
|
1488
|
-
this.$module.loadOrgansFromURL(
|
|
1489
|
-
newValue,
|
|
1490
|
-
undefined,
|
|
1491
|
-
undefined,
|
|
1492
|
-
"scene",
|
|
1493
|
-
undefined,
|
|
1494
|
-
true
|
|
1495
|
-
);
|
|
1496
|
-
}
|
|
1497
|
-
this.$module.scene.displayMarkers = this.displayMarkers;
|
|
1498
|
-
this.$module.scene.forcePickableObjectsUpdate = true;
|
|
1499
|
-
this.$module.scene.displayMinimap = this.displayMinimap;
|
|
1500
|
-
this.updateMinimapScissor();
|
|
1501
|
-
}
|
|
1502
|
-
},
|
|
1503
|
-
/**
|
|
1504
|
-
* Function used for reading in new scaffold metadata. This function will ignore
|
|
1505
|
-
* the state prop and read in the new url.
|
|
1506
|
-
*
|
|
1507
|
-
* @public
|
|
1508
|
-
*/
|
|
1509
|
-
setURL: function (newValue) {
|
|
1510
|
-
this.setURLAndState(newValue, undefined);
|
|
1511
|
-
},
|
|
1512
|
-
/**
|
|
1513
|
-
* Callback when drawer is toggled.
|
|
1514
|
-
*/
|
|
1515
|
-
drawerToggled: function (flag) {
|
|
1516
|
-
this.drawerOpen = flag;
|
|
1517
|
-
this.adjustLayout();
|
|
1518
|
-
},
|
|
1519
|
-
/**
|
|
1520
|
-
* Callback using ResizeObserver.
|
|
1521
|
-
*/
|
|
1522
|
-
adjustLayout: function () {
|
|
1523
|
-
let width = this.$refs.scaffoldContainer.clientWidth;
|
|
1524
|
-
this.minimisedSlider = width < 812;
|
|
1525
|
-
if (this.minimisedSlider) {
|
|
1526
|
-
this.sliderPosition = this.drawerOpen ? "right" : "left";
|
|
1527
|
-
} else {
|
|
1528
|
-
this.sliderPosition = "";
|
|
1529
|
-
}
|
|
1530
|
-
},
|
|
1531
|
-
toggleRendering: function (flag) {
|
|
1532
|
-
if (this.$module.zincRenderer) {
|
|
1533
|
-
if (flag) {
|
|
1534
|
-
this.$module.zincRenderer.animate();
|
|
1535
|
-
} else {
|
|
1536
|
-
this.$module.zincRenderer.stopAnimate();
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
},
|
|
1540
|
-
forceResize: function () {
|
|
1541
|
-
if (this.$module.zincRenderer) {
|
|
1542
|
-
this.$module.zincRenderer.onWindowResize();
|
|
1543
|
-
}
|
|
1544
|
-
},
|
|
1545
|
-
syncControlCallback: function () {
|
|
1546
|
-
const payload = this.$module.NDCCameraControl.getPanZoom();
|
|
1547
|
-
if (this.tData.visible) {
|
|
1548
|
-
this.showRegionTooltip(this.tData.label, true, true);
|
|
1549
|
-
}
|
|
1550
|
-
this.$emit("scaffold-navigated", payload);
|
|
1551
|
-
},
|
|
1552
|
-
/**
|
|
1553
|
-
* Rotate mode - "none", "horizontal", "vertical", "free" but
|
|
1554
|
-
* it will be ignored if flag is set to false.
|
|
1555
|
-
*/
|
|
1556
|
-
toggleSyncControl: function (flag, rotateMode) {
|
|
1557
|
-
this.$module.toggleSyncControl(flag, rotateMode);
|
|
1558
|
-
this.$module.setSyncControlCallback(this.syncControlCallback);
|
|
1559
|
-
},
|
|
1560
|
-
|
|
1561
|
-
/**
|
|
1562
|
-
* Set the markers for the scene.
|
|
1563
|
-
*/
|
|
1564
|
-
setMarkers: function () {
|
|
1565
|
-
this.markerLabels.forEach((l)=>{
|
|
1566
|
-
this.setMarkerModeForObjectsWithName(l, "on");
|
|
1567
|
-
})
|
|
1568
|
-
},
|
|
1569
|
-
},
|
|
1570
|
-
};
|
|
1571
|
-
</script>
|
|
1572
|
-
|
|
1573
|
-
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
1574
|
-
<style scoped lang="scss">
|
|
1575
|
-
@import "~element-ui/packages/theme-chalk/src/button";
|
|
1576
|
-
@import "~element-ui/packages/theme-chalk/src/col";
|
|
1577
|
-
@import "~element-ui/packages/theme-chalk/src/loading";
|
|
1578
|
-
@import "~element-ui/packages/theme-chalk/src/option";
|
|
1579
|
-
@import "~element-ui/packages/theme-chalk/src/popover";
|
|
1580
|
-
@import "~element-ui/packages/theme-chalk/src/row";
|
|
1581
|
-
@import "~element-ui/packages/theme-chalk/src/select";
|
|
1582
|
-
@import "~element-ui/packages/theme-chalk/src/slider";
|
|
1583
|
-
@import "~element-ui/packages/theme-chalk/src/tabs";
|
|
1584
|
-
@import "~element-ui/packages/theme-chalk/src/tab-pane";
|
|
1585
|
-
|
|
1586
|
-
.message-icon {
|
|
1587
|
-
position: absolute;
|
|
1588
|
-
top: 15px;
|
|
1589
|
-
left: 37px;
|
|
1590
|
-
text-align: left;
|
|
1591
|
-
font-size: 25px;
|
|
1592
|
-
color: $warning;
|
|
1593
|
-
|
|
1594
|
-
&:hover {
|
|
1595
|
-
cursor: pointer;
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
.warning-icon {
|
|
1600
|
-
color: $warning;
|
|
1601
|
-
top: 15px;
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
.latest-changesicon {
|
|
1605
|
-
color: $success;
|
|
1606
|
-
top: 45px;
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
.message-text {
|
|
1610
|
-
font-size: 15px;
|
|
1611
|
-
vertical-align: 5px;
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1614
|
-
::v-deep .message-popper {
|
|
1615
|
-
padding: 9px 10px;
|
|
1616
|
-
min-width: 150px;
|
|
1617
|
-
font-size: 12px;
|
|
1618
|
-
color: #fff;
|
|
1619
|
-
}
|
|
1620
|
-
|
|
1621
|
-
#organsDisplayArea {
|
|
1622
|
-
&:focus {
|
|
1623
|
-
outline: none !important;
|
|
1624
|
-
border: 0px;
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
.scaffold-container {
|
|
1629
|
-
height: 100%;
|
|
1630
|
-
width: 100%;
|
|
1631
|
-
position: relative;
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
.time-slider-container {
|
|
1635
|
-
text-align: left;
|
|
1636
|
-
position: absolute;
|
|
1637
|
-
right: 155px;
|
|
1638
|
-
width: calc(100% - 530px);
|
|
1639
|
-
bottom: 16px;
|
|
1640
|
-
transition: all 1s ease;
|
|
1641
|
-
outline: none;
|
|
1642
|
-
|
|
1643
|
-
&.minimised {
|
|
1644
|
-
width: calc(40%);
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
|
-
&.left {
|
|
1648
|
-
right: 155px;
|
|
1649
|
-
width: calc(100% - 250px);
|
|
1650
|
-
}
|
|
1651
|
-
|
|
1652
|
-
&.right {
|
|
1653
|
-
right: 8px;
|
|
1654
|
-
bottom: 54px;
|
|
1655
|
-
}
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
.slider-display-text {
|
|
1659
|
-
height: 20px;
|
|
1660
|
-
color: rgb(48, 49, 51);
|
|
1661
|
-
font-size: 14px;
|
|
1662
|
-
font-weight: normal;
|
|
1663
|
-
line-height: 20px;
|
|
1664
|
-
padding-left: 8px;
|
|
1665
|
-
text-shadow: -1px -1px #fff, 1px -1px #fff, -1px 1px #fff, 1px -1px #fff;
|
|
1666
|
-
}
|
|
1667
|
-
|
|
1668
|
-
.tab-content {
|
|
1669
|
-
display: flex;
|
|
1670
|
-
height: 34px;
|
|
1671
|
-
padding-top: 8px;
|
|
1672
|
-
font-size: 14px;
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
|
-
.tab-content ::v-deep .el-slider__marks-text {
|
|
1676
|
-
margin-top: 12px;
|
|
1677
|
-
margin-left: 8px;
|
|
1678
|
-
font-size: 10px;
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
.tab-content ::v-deep .el-slider__stop {
|
|
1682
|
-
width: 10px;
|
|
1683
|
-
height: 10px;
|
|
1684
|
-
top: -1px;
|
|
1685
|
-
border: solid 1px $app-primary-color;
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
.animation-data {
|
|
1689
|
-
margin-left: 8px;
|
|
1690
|
-
line-height: 26px;
|
|
1691
|
-
display: flex;
|
|
1692
|
-
|
|
1693
|
-
:not(:first-child) {
|
|
1694
|
-
margin-left: 8px;
|
|
1695
|
-
}
|
|
1696
|
-
.purple {
|
|
1697
|
-
padding-left: 2px;
|
|
1698
|
-
color: $app-primary-color;
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
.slider {
|
|
1702
|
-
margin-left: 30px;
|
|
1703
|
-
width: calc(100% - 88px);
|
|
1704
|
-
margin-top: -7px;
|
|
1705
|
-
|
|
1706
|
-
::v-deep .el-slider__runway {
|
|
1707
|
-
height: 10px;
|
|
1708
|
-
margin: 14px 0;
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1711
|
-
::v-deep .el-slider__button-wrapper {
|
|
1712
|
-
top: -13px;
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
.zoomOut {
|
|
1717
|
-
padding-left: 8px;
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
.fitWindow {
|
|
1721
|
-
padding-left: 8px;
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
::v-deep .non-selectable {
|
|
1725
|
-
user-select: none;
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
::v-deep .background-popper {
|
|
1729
|
-
padding: 5px 12px;
|
|
1730
|
-
background-color: #ffffff;
|
|
1731
|
-
border: 1px solid $app-primary-color;
|
|
1732
|
-
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
|
|
1733
|
-
height: 72px;
|
|
1734
|
-
width: 128px;
|
|
1735
|
-
min-width: 128px;
|
|
1736
|
-
|
|
1737
|
-
&.el-popper[x-placement^="top"] {
|
|
1738
|
-
.popper__arrow {
|
|
1739
|
-
border-top-color: $app-primary-color !important;
|
|
1740
|
-
&:after {
|
|
1741
|
-
border-top-color: #fff !important;
|
|
1742
|
-
}
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
::v-deep .open-map-popper {
|
|
1748
|
-
padding-top: 5px;
|
|
1749
|
-
padding-bottom: 5px;
|
|
1750
|
-
background-color: #ffffff;
|
|
1751
|
-
border: 1px solid $app-primary-color;
|
|
1752
|
-
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
|
|
1753
|
-
width: 178px;
|
|
1754
|
-
min-width: 178px;
|
|
1755
|
-
|
|
1756
|
-
.el-row ~ .el-row {
|
|
1757
|
-
margin-top: 8px;
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
.el-button {
|
|
1761
|
-
padding-top:5px;
|
|
1762
|
-
padding-bottom:5px;
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
&.el-popper[x-placement^="top"] {
|
|
1766
|
-
.popper__arrow {
|
|
1767
|
-
border-top-color: $app-primary-color !important;
|
|
1768
|
-
&:after {
|
|
1769
|
-
border-top-color: #fff !important;
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
}
|
|
1773
|
-
}
|
|
1774
|
-
|
|
1775
|
-
.settings-group {
|
|
1776
|
-
bottom: 16px;
|
|
1777
|
-
position: absolute;
|
|
1778
|
-
transition: all 1s ease;
|
|
1779
|
-
|
|
1780
|
-
&.open {
|
|
1781
|
-
left: 322px;
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
&.close {
|
|
1785
|
-
left: 24px;
|
|
1786
|
-
}
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
|
-
.backgroundText {
|
|
1790
|
-
color: rgb(48, 49, 51);
|
|
1791
|
-
font-size: 14px;
|
|
1792
|
-
font-weight: normal;
|
|
1793
|
-
line-height: 20px;
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
.backgroundChooser {
|
|
1797
|
-
display: flex;
|
|
1798
|
-
margin-top: 16px;
|
|
1799
|
-
}
|
|
1800
|
-
|
|
1801
|
-
.backgroundChoice {
|
|
1802
|
-
width: 20px;
|
|
1803
|
-
height: 20px;
|
|
1804
|
-
border: 1px solid rgb(144, 147, 153);
|
|
1805
|
-
margin-left: 20px;
|
|
1806
|
-
|
|
1807
|
-
&.active {
|
|
1808
|
-
border: 2px solid $app-primary-color;
|
|
1809
|
-
}
|
|
1810
|
-
|
|
1811
|
-
&:hover {
|
|
1812
|
-
cursor: pointer;
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
&.white {
|
|
1816
|
-
background-color: white;
|
|
1817
|
-
margin-left: 10px;
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
&.black {
|
|
1821
|
-
background-color: black;
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
&.lightskyblue {
|
|
1825
|
-
background-color: lightskyblue;
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
.icon-button {
|
|
1830
|
-
height: 24px !important;
|
|
1831
|
-
width: 24px !important;
|
|
1832
|
-
|
|
1833
|
-
&:hover {
|
|
1834
|
-
cursor: pointer;
|
|
1835
|
-
}
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1838
|
-
.bottom-right-control {
|
|
1839
|
-
position: absolute;
|
|
1840
|
-
right: 16px;
|
|
1841
|
-
bottom: 16px;
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
.video-button {
|
|
1845
|
-
margin-left: 8px;
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
.time-slider-container {
|
|
1849
|
-
::v-deep .el-tabs__header {
|
|
1850
|
-
margin: 0px;
|
|
1851
|
-
border-bottom: 1px solid rgb(144, 147, 153);
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
.el-row {
|
|
1855
|
-
margin-bottom: 5px;
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
::v-deep .el-tabs__content {
|
|
1859
|
-
border-left: 1px solid rgb(144, 147, 153);
|
|
1860
|
-
border-bottom: 1px solid rgb(144, 147, 153);
|
|
1861
|
-
border-right: 1px solid rgb(144, 147, 153);
|
|
1862
|
-
border-radius: 0px 0px 4px 4px;
|
|
1863
|
-
background-color: white;
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
::v-deep .el-tabs--card {
|
|
1867
|
-
> .el-tabs__header {
|
|
1868
|
-
.el-tabs__nav {
|
|
1869
|
-
border: 1px solid rgb(144, 147, 153);
|
|
1870
|
-
border-bottom: none;
|
|
1871
|
-
border-radius: 4px 4px 0px 0px;
|
|
1872
|
-
background-color: white;
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
.el-tabs__item {
|
|
1876
|
-
height: 24px;
|
|
1877
|
-
line-height: 24px;
|
|
1878
|
-
padding: 0 8px !important;
|
|
1879
|
-
border-bottom: 1px solid;
|
|
1880
|
-
border-left: 1px solid rgb(144, 147, 153);
|
|
1881
|
-
&:first-child {
|
|
1882
|
-
border-left: none;
|
|
1883
|
-
}
|
|
1884
|
-
&.is-active {
|
|
1885
|
-
border-bottom: 1px solid white;
|
|
1886
|
-
color: rgb(48, 49, 51);
|
|
1887
|
-
}
|
|
1888
|
-
&:hover {
|
|
1889
|
-
color: $app-primary-color;
|
|
1890
|
-
}
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
}
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
::v-deep .scaffold-popper {
|
|
1897
|
-
padding: 6px 4px;
|
|
1898
|
-
font-size: 12px;
|
|
1899
|
-
color: rgb(48, 49, 51);
|
|
1900
|
-
background-color: #f3ecf6;
|
|
1901
|
-
border: 1px solid $app-primary-color;
|
|
1902
|
-
white-space: nowrap;
|
|
1903
|
-
min-width: unset;
|
|
1904
|
-
pointer-events: none;
|
|
1905
|
-
|
|
1906
|
-
&.left-popper {
|
|
1907
|
-
.popper__arrow {
|
|
1908
|
-
border-left-color: $app-primary-color !important;
|
|
1909
|
-
&:after {
|
|
1910
|
-
border-left-color: #f3ecf6 !important;
|
|
1911
|
-
}
|
|
1912
|
-
}
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
&.right-popper {
|
|
1916
|
-
.popper__arrow {
|
|
1917
|
-
border-right-color: $app-primary-color !important;
|
|
1918
|
-
&:after {
|
|
1919
|
-
border-right-color: #f3ecf6 !important;
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
|
|
1924
|
-
&.el-popper[x-placement^="top"] {
|
|
1925
|
-
.popper__arrow {
|
|
1926
|
-
border-top-color: $app-primary-color !important;
|
|
1927
|
-
&:after {
|
|
1928
|
-
border-top-color: #f3ecf6 !important;
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
}
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
|
-
::v-deep .el-slider__button {
|
|
1935
|
-
border: 2px solid $app-primary-color;
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
::v-deep .el-slider__bar {
|
|
1939
|
-
background-color: $app-primary-color;
|
|
1940
|
-
height: 10px;
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
::v-deep .el-loading-spinner {
|
|
1944
|
-
i,
|
|
1945
|
-
.el-loading-text {
|
|
1946
|
-
color: $app-primary-color;
|
|
1947
|
-
}
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
::v-deep .popper-zoomout {
|
|
1951
|
-
padding-right: 11px;
|
|
1952
|
-
left: -21px !important;
|
|
1953
|
-
.popper__arrow {
|
|
1954
|
-
left: 53px !important;
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
.select-box {
|
|
1959
|
-
width: 57px;
|
|
1960
|
-
border-radius: 4px;
|
|
1961
|
-
border: 1px solid rgb(144, 147, 153);
|
|
1962
|
-
background-color: var(--white);
|
|
1963
|
-
font-weight: 500;
|
|
1964
|
-
color: rgb(48, 49, 51);
|
|
1965
|
-
margin-left: 8px;
|
|
1966
|
-
|
|
1967
|
-
::v-deep .el-input__inner {
|
|
1968
|
-
color: $app-primary-color;
|
|
1969
|
-
height: 22px;
|
|
1970
|
-
padding-left: 8px;
|
|
1971
|
-
padding-right: 8px;
|
|
1972
|
-
border: none;
|
|
1973
|
-
font-family: "Asap", sans-serif;
|
|
1974
|
-
line-height: 22px;
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
::v-deep .el-input,
|
|
1978
|
-
::v-deep .el-input__icon {
|
|
1979
|
-
line-height: 22px;
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
</style>
|
|
1983
|
-
|
|
1984
|
-
<style lang="scss">
|
|
1985
|
-
.time-slider-tooltip {
|
|
1986
|
-
padding: 6px 4px !important;
|
|
1987
|
-
font-family: "Asap", sans-serif;
|
|
1988
|
-
font-size: 12px !important;
|
|
1989
|
-
color: rgb(48, 49, 51) !important;
|
|
1990
|
-
background-color: #f3ecf6 !important;
|
|
1991
|
-
border: 1px solid $app-primary-color !important;
|
|
1992
|
-
white-space: nowrap !important;
|
|
1993
|
-
min-width: unset !important;
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
.scaffold_viewer_dropdown .el-select-dropdown__item {
|
|
1997
|
-
white-space: nowrap;
|
|
1998
|
-
text-align: left;
|
|
1999
|
-
font-family: "Asap", sans-serif;
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
.
|
|
2003
|
-
right: 0px;
|
|
2004
|
-
bottom: 200px;
|
|
2005
|
-
position: absolute;
|
|
2006
|
-
}
|
|
2007
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="scaffoldContainer"
|
|
4
|
+
v-loading="loading"
|
|
5
|
+
class="scaffold-container"
|
|
6
|
+
element-loading-text="Loading..."
|
|
7
|
+
element-loading-spinner="el-icon-loading"
|
|
8
|
+
element-loading-background="rgba(0, 0, 0, 0.3)"
|
|
9
|
+
>
|
|
10
|
+
<map-svg-sprite-color />
|
|
11
|
+
<scaffold-tooltip
|
|
12
|
+
:label="tData.label"
|
|
13
|
+
:region="tData.region"
|
|
14
|
+
:visible="tData.visible"
|
|
15
|
+
:x="tData.x"
|
|
16
|
+
:y="tData.y"
|
|
17
|
+
/>
|
|
18
|
+
<div
|
|
19
|
+
id="organsDisplayArea"
|
|
20
|
+
ref="display"
|
|
21
|
+
tabindex="-1"
|
|
22
|
+
style="height: 100%; width: 100%"
|
|
23
|
+
@keydown.66="backgroundChangeCallback"
|
|
24
|
+
/>
|
|
25
|
+
<div v-show="displayUI && !isTransitioning">
|
|
26
|
+
<el-popover
|
|
27
|
+
v-if="displayWarning"
|
|
28
|
+
ref="warningPopover"
|
|
29
|
+
v-model="hoverVisibilities[6].value"
|
|
30
|
+
:content="warningMessage"
|
|
31
|
+
placement="right"
|
|
32
|
+
:append-to-body="false"
|
|
33
|
+
trigger="manual"
|
|
34
|
+
popper-class="scaffold-popper message-popper right-popper non-selectable"
|
|
35
|
+
/>
|
|
36
|
+
<i
|
|
37
|
+
v-if="displayWarning"
|
|
38
|
+
v-popover:warningPopover
|
|
39
|
+
class="el-icon-warning message-icon warning-icon"
|
|
40
|
+
@mouseover="showHelpText(6)"
|
|
41
|
+
@mouseout="hideHelpText(6)"
|
|
42
|
+
>
|
|
43
|
+
<span class="message-text">Beta</span>
|
|
44
|
+
</i>
|
|
45
|
+
<el-popover
|
|
46
|
+
v-if="displayLatestChanges"
|
|
47
|
+
ref="latestChangesPopover"
|
|
48
|
+
v-model="hoverVisibilities[7].value"
|
|
49
|
+
:content="latestChangesMessage"
|
|
50
|
+
placement="right"
|
|
51
|
+
:append-to-body="false"
|
|
52
|
+
trigger="manual"
|
|
53
|
+
popper-class="scaffold-popper message-popper right-popper non-selectable"
|
|
54
|
+
/>
|
|
55
|
+
<i
|
|
56
|
+
v-if="displayLatestChanges && latestChangesMessage"
|
|
57
|
+
v-popover:latestChangesPopover
|
|
58
|
+
class="el-icon-warning message-icon latest-changesicon"
|
|
59
|
+
@mouseover="showHelpText(7)"
|
|
60
|
+
@mouseout="hideHelpText(7)"
|
|
61
|
+
>
|
|
62
|
+
<span class="message-text">What's new?</span>
|
|
63
|
+
</i>
|
|
64
|
+
<el-popover
|
|
65
|
+
ref="checkBoxPopover"
|
|
66
|
+
v-model="hoverVisibilities[5].value"
|
|
67
|
+
content="Change region visibility"
|
|
68
|
+
placement="right"
|
|
69
|
+
:append-to-body="false"
|
|
70
|
+
trigger="manual"
|
|
71
|
+
popper-class="scaffold-popper right-popper non-selectable"
|
|
72
|
+
/>
|
|
73
|
+
<tree-controls
|
|
74
|
+
ref="treeControls"
|
|
75
|
+
v-popover:checkBoxPopover
|
|
76
|
+
:help-mode="helpMode"
|
|
77
|
+
:isReady="isReady"
|
|
78
|
+
:show-colour-picker="showColourPicker"
|
|
79
|
+
@object-selected="objectSelected"
|
|
80
|
+
@object-hovered="objectHovered"
|
|
81
|
+
@drawer-toggled="drawerToggled"
|
|
82
|
+
/>
|
|
83
|
+
<div class="primitive-controls-box">
|
|
84
|
+
<primitive-controls ref="primitiveControls" />
|
|
85
|
+
</div>
|
|
86
|
+
<el-popover
|
|
87
|
+
v-if="sceneData.timeVarying"
|
|
88
|
+
ref="sliderPopover"
|
|
89
|
+
v-model="hoverVisibilities[4].value"
|
|
90
|
+
content="Move the slider to animate the region"
|
|
91
|
+
placement="top"
|
|
92
|
+
:append-to-body="false"
|
|
93
|
+
trigger="manual"
|
|
94
|
+
popper-class="scaffold-popper top-popper non-selectable"
|
|
95
|
+
/>
|
|
96
|
+
<div
|
|
97
|
+
v-if="sceneData.timeVarying"
|
|
98
|
+
v-popover:sliderPopover
|
|
99
|
+
class="time-slider-container"
|
|
100
|
+
:class="[minimisedSlider ? 'minimised' : '', sliderPosition]"
|
|
101
|
+
>
|
|
102
|
+
<el-tabs type="card">
|
|
103
|
+
<el-tab-pane label="Animate scaffold">
|
|
104
|
+
<el-row class="tab-content">
|
|
105
|
+
<map-svg-icon
|
|
106
|
+
v-if="isPlaying"
|
|
107
|
+
icon="pause"
|
|
108
|
+
class="icon-button video-button"
|
|
109
|
+
@click.native="play(false)"
|
|
110
|
+
/>
|
|
111
|
+
<map-svg-icon
|
|
112
|
+
v-else
|
|
113
|
+
icon="play"
|
|
114
|
+
class="video-button icon-button"
|
|
115
|
+
@click.native="play(true)"
|
|
116
|
+
/>
|
|
117
|
+
<el-slider
|
|
118
|
+
:min="0"
|
|
119
|
+
:max="timeMax"
|
|
120
|
+
:value="(sceneData.currentTime / 100) * timeMax"
|
|
121
|
+
:step="0.1"
|
|
122
|
+
tooltip-class="time-slider-tooltip"
|
|
123
|
+
class="slider"
|
|
124
|
+
:format-tooltip="formatTooltip"
|
|
125
|
+
:marks="timeStamps"
|
|
126
|
+
@input="timeChange($event)"
|
|
127
|
+
/>
|
|
128
|
+
</el-row>
|
|
129
|
+
</el-tab-pane>
|
|
130
|
+
<el-tab-pane label="Animation data">
|
|
131
|
+
<el-row class="tab-content">
|
|
132
|
+
<div class="animation-data">
|
|
133
|
+
Original duration:
|
|
134
|
+
<div class="purple">
|
|
135
|
+
{{ orginalDuration }}
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
<div class="animation-data">
|
|
139
|
+
Animation duration:
|
|
140
|
+
<div class="purple">
|
|
141
|
+
{{ animateDuration }}
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="animation-data">
|
|
145
|
+
Playback speed
|
|
146
|
+
<el-select
|
|
147
|
+
:popper-append-to-body="true"
|
|
148
|
+
:value="currentSpeed"
|
|
149
|
+
placeholder="Select"
|
|
150
|
+
class="select-box"
|
|
151
|
+
popper-class="scaffold_viewer_dropdown"
|
|
152
|
+
@change="speedChanged($event)"
|
|
153
|
+
>
|
|
154
|
+
<el-option
|
|
155
|
+
v-for="item in playSpeed"
|
|
156
|
+
:key="item.value"
|
|
157
|
+
:label="item.label"
|
|
158
|
+
:value="item.value"
|
|
159
|
+
/>
|
|
160
|
+
</el-select>
|
|
161
|
+
</div>
|
|
162
|
+
</el-row>
|
|
163
|
+
</el-tab-pane>
|
|
164
|
+
</el-tabs>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="bottom-right-control">
|
|
167
|
+
<el-popover
|
|
168
|
+
v-model="hoverVisibilities[0].value"
|
|
169
|
+
content="Zoom in"
|
|
170
|
+
placement="left"
|
|
171
|
+
:append-to-body="false"
|
|
172
|
+
trigger="manual"
|
|
173
|
+
popper-class="scaffold-popper left-popper non-selectable"
|
|
174
|
+
>
|
|
175
|
+
<map-svg-icon
|
|
176
|
+
slot="reference"
|
|
177
|
+
icon="zoomIn"
|
|
178
|
+
class="icon-button zoomIn"
|
|
179
|
+
@click.native="zoomIn()"
|
|
180
|
+
@mouseover.native="showHelpText(0)"
|
|
181
|
+
@mouseout.native="hideHelpText(0)"
|
|
182
|
+
/>
|
|
183
|
+
</el-popover>
|
|
184
|
+
<el-popover
|
|
185
|
+
v-model="hoverVisibilities[1].value"
|
|
186
|
+
content="Zoom out"
|
|
187
|
+
placement="top-end"
|
|
188
|
+
:append-to-body="false"
|
|
189
|
+
trigger="manual"
|
|
190
|
+
popper-class="scaffold-popper popper-zoomout non-selectable"
|
|
191
|
+
>
|
|
192
|
+
<map-svg-icon
|
|
193
|
+
slot="reference"
|
|
194
|
+
icon="zoomOut"
|
|
195
|
+
class="icon-button zoomOut"
|
|
196
|
+
@click.native="zoomOut()"
|
|
197
|
+
@mouseover.native="showHelpText(1)"
|
|
198
|
+
@mouseout.native="hideHelpText(1)"
|
|
199
|
+
/>
|
|
200
|
+
</el-popover>
|
|
201
|
+
<el-popover
|
|
202
|
+
v-model="hoverVisibilities[2].value"
|
|
203
|
+
placement="top"
|
|
204
|
+
:append-to-body="false"
|
|
205
|
+
trigger="manual"
|
|
206
|
+
popper-class="scaffold-popper non-selectable"
|
|
207
|
+
>
|
|
208
|
+
<div>
|
|
209
|
+
Fit to
|
|
210
|
+
<br />
|
|
211
|
+
window
|
|
212
|
+
</div>
|
|
213
|
+
<map-svg-icon
|
|
214
|
+
slot="reference"
|
|
215
|
+
icon="fitWindow"
|
|
216
|
+
class="icon-button fitWindow"
|
|
217
|
+
@click.native="fitWindow()"
|
|
218
|
+
@mouseover.native="showHelpText(2)"
|
|
219
|
+
@mouseout.native="hideHelpText(2)"
|
|
220
|
+
/>
|
|
221
|
+
</el-popover>
|
|
222
|
+
</div>
|
|
223
|
+
<el-popover
|
|
224
|
+
ref="open-map-popover"
|
|
225
|
+
placement="top-start"
|
|
226
|
+
width="128"
|
|
227
|
+
:append-to-body="false"
|
|
228
|
+
trigger="click"
|
|
229
|
+
popper-class="open-map-popper"
|
|
230
|
+
>
|
|
231
|
+
<el-row v-for="item in openMapOptions" :key="item.key">
|
|
232
|
+
<el-button
|
|
233
|
+
type="primary"
|
|
234
|
+
plain
|
|
235
|
+
@click="$emit('open-map', item.key)"
|
|
236
|
+
>
|
|
237
|
+
{{ item.display }}
|
|
238
|
+
</el-button>
|
|
239
|
+
</el-row>
|
|
240
|
+
</el-popover>
|
|
241
|
+
<el-popover
|
|
242
|
+
ref="backgroundPopover"
|
|
243
|
+
placement="top-start"
|
|
244
|
+
width="128"
|
|
245
|
+
:append-to-body="false"
|
|
246
|
+
trigger="click"
|
|
247
|
+
popper-class="background-popper non-selectable"
|
|
248
|
+
>
|
|
249
|
+
<el-row class="backgroundText"> Change background </el-row>
|
|
250
|
+
<el-row class="backgroundChooser">
|
|
251
|
+
<div
|
|
252
|
+
v-for="item in availableBackground"
|
|
253
|
+
:key="item"
|
|
254
|
+
:class="[
|
|
255
|
+
'backgroundChoice',
|
|
256
|
+
item,
|
|
257
|
+
item == currentBackground ? 'active' : '',
|
|
258
|
+
]"
|
|
259
|
+
@click="backgroundChangeCallback(item)"
|
|
260
|
+
/>
|
|
261
|
+
</el-row>
|
|
262
|
+
</el-popover>
|
|
263
|
+
<div
|
|
264
|
+
class="settings-group"
|
|
265
|
+
:class="{ open: drawerOpen, close: !drawerOpen }"
|
|
266
|
+
>
|
|
267
|
+
<el-row>
|
|
268
|
+
<el-popover
|
|
269
|
+
v-model="hoverVisibilities[8].value"
|
|
270
|
+
content="Open new map"
|
|
271
|
+
placement="right"
|
|
272
|
+
:append-to-body="false"
|
|
273
|
+
trigger="manual"
|
|
274
|
+
popper-class="scaffold-popper right-popper non-selectable"
|
|
275
|
+
>
|
|
276
|
+
<map-svg-icon
|
|
277
|
+
v-if="enableOpenMapUI && openMapOptions.length > 0"
|
|
278
|
+
slot="reference"
|
|
279
|
+
v-popover:open-map-popover
|
|
280
|
+
icon="openMap"
|
|
281
|
+
class="icon-button"
|
|
282
|
+
@mouseover.native="showHelpText(8)"
|
|
283
|
+
@mouseout.native="hideHelpText(8)"
|
|
284
|
+
/>
|
|
285
|
+
</el-popover>
|
|
286
|
+
</el-row>
|
|
287
|
+
<el-row>
|
|
288
|
+
<el-popover
|
|
289
|
+
v-model="hoverVisibilities[3].value"
|
|
290
|
+
content="Change background color"
|
|
291
|
+
placement="right"
|
|
292
|
+
:append-to-body="false"
|
|
293
|
+
trigger="manual"
|
|
294
|
+
popper-class="scaffold-popper right-popper non-selectable"
|
|
295
|
+
>
|
|
296
|
+
<map-svg-icon
|
|
297
|
+
slot="reference"
|
|
298
|
+
v-popover:backgroundPopover
|
|
299
|
+
icon="changeBckgd"
|
|
300
|
+
class="icon-button"
|
|
301
|
+
@mouseover.native="showHelpText(3)"
|
|
302
|
+
@mouseout.native="hideHelpText(3)"
|
|
303
|
+
/>
|
|
304
|
+
</el-popover>
|
|
305
|
+
</el-row>
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
</template>
|
|
310
|
+
|
|
311
|
+
<script>
|
|
312
|
+
/* eslint-disable no-alert, no-console */
|
|
313
|
+
import Vue from "vue";
|
|
314
|
+
import PrimitiveControls from "./PrimitiveControls";
|
|
315
|
+
import ScaffoldTooltip from "./ScaffoldTooltip";
|
|
316
|
+
import TreeControls from "./TreeControls";
|
|
317
|
+
import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
|
|
318
|
+
import { findObjectsWithNames, getObjectsFromAnnotations } from "../scripts/utilities.js";
|
|
319
|
+
import { SearchIndex } from "../scripts/search.js";
|
|
320
|
+
import {
|
|
321
|
+
Button,
|
|
322
|
+
Col,
|
|
323
|
+
Loading,
|
|
324
|
+
Option,
|
|
325
|
+
Popover,
|
|
326
|
+
Row,
|
|
327
|
+
Select,
|
|
328
|
+
Slider,
|
|
329
|
+
TabPane,
|
|
330
|
+
Tabs,
|
|
331
|
+
} from "element-ui";
|
|
332
|
+
import lang from "element-ui/lib/locale/lang/en";
|
|
333
|
+
import locale from "element-ui/lib/locale";
|
|
334
|
+
|
|
335
|
+
locale.use(lang);
|
|
336
|
+
Vue.use(Button);
|
|
337
|
+
Vue.use(Col);
|
|
338
|
+
Vue.use(Loading.directive);
|
|
339
|
+
Vue.use(Option);
|
|
340
|
+
Vue.use(Popover);
|
|
341
|
+
Vue.use(Row);
|
|
342
|
+
Vue.use(Select);
|
|
343
|
+
Vue.use(Slider);
|
|
344
|
+
Vue.use(TabPane);
|
|
345
|
+
Vue.use(Tabs);
|
|
346
|
+
|
|
347
|
+
const OrgansViewer = require("../scripts/organsRenderer").OrgansViewer;
|
|
348
|
+
const EventNotifier = require("../scripts/eventNotifier").EventNotifier;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* A vue component of the scaffold viewer.
|
|
352
|
+
*
|
|
353
|
+
* @requires ./PrimitveControls.vue
|
|
354
|
+
* @requires ./TreeControls.vue
|
|
355
|
+
*/
|
|
356
|
+
export default {
|
|
357
|
+
name: "ScaffoldVuer",
|
|
358
|
+
components: {
|
|
359
|
+
MapSvgIcon,
|
|
360
|
+
MapSvgSpriteColor,
|
|
361
|
+
PrimitiveControls,
|
|
362
|
+
ScaffoldTooltip,
|
|
363
|
+
TreeControls,
|
|
364
|
+
},
|
|
365
|
+
props: {
|
|
366
|
+
/**
|
|
367
|
+
* URL of the zincjs metadata. This value will be ignored if a valid
|
|
368
|
+
* state prop is also provided.
|
|
369
|
+
* If the url needs to be updated with state present, please use
|
|
370
|
+
* the setURL method.
|
|
371
|
+
*/
|
|
372
|
+
url: {
|
|
373
|
+
type: String,
|
|
374
|
+
default: "",
|
|
375
|
+
},
|
|
376
|
+
/**
|
|
377
|
+
* Show the colour control of set to true.
|
|
378
|
+
*/
|
|
379
|
+
showColourPicker: {
|
|
380
|
+
type: Boolean,
|
|
381
|
+
default: false,
|
|
382
|
+
},
|
|
383
|
+
/**
|
|
384
|
+
* Flag to show/hide the UI.
|
|
385
|
+
*/
|
|
386
|
+
displayUI: {
|
|
387
|
+
type: Boolean,
|
|
388
|
+
default: true,
|
|
389
|
+
},
|
|
390
|
+
/**
|
|
391
|
+
* Display all graphics at start.
|
|
392
|
+
*
|
|
393
|
+
* This setting only works when traditional is set to false.
|
|
394
|
+
*/
|
|
395
|
+
displayAtStartUp: {
|
|
396
|
+
type: Boolean,
|
|
397
|
+
default: true,
|
|
398
|
+
},
|
|
399
|
+
/**
|
|
400
|
+
* Use for toggling the help tooltips.
|
|
401
|
+
*/
|
|
402
|
+
helpMode: {
|
|
403
|
+
type: Boolean,
|
|
404
|
+
default: false,
|
|
405
|
+
},
|
|
406
|
+
/**
|
|
407
|
+
* Use for show/display beta warning icon.
|
|
408
|
+
*/
|
|
409
|
+
displayWarning: {
|
|
410
|
+
type: Boolean,
|
|
411
|
+
default: true,
|
|
412
|
+
},
|
|
413
|
+
/**
|
|
414
|
+
* Warning message for the hovered over text
|
|
415
|
+
* on the warning icon.
|
|
416
|
+
*/
|
|
417
|
+
warningMessage: {
|
|
418
|
+
type: String,
|
|
419
|
+
default: "Beta feature - under active development",
|
|
420
|
+
},
|
|
421
|
+
displayLatestChanges: {
|
|
422
|
+
type: Boolean,
|
|
423
|
+
default: false,
|
|
424
|
+
},
|
|
425
|
+
latestChangesMessage: {
|
|
426
|
+
type: String,
|
|
427
|
+
default: "New feature - Local search is now available",
|
|
428
|
+
},
|
|
429
|
+
/**
|
|
430
|
+
* Show/hide pickable markers for regions.
|
|
431
|
+
*/
|
|
432
|
+
displayMarkers: {
|
|
433
|
+
type: Boolean,
|
|
434
|
+
default: false,
|
|
435
|
+
},
|
|
436
|
+
markerLabels : {
|
|
437
|
+
type: Array,
|
|
438
|
+
default: function () {
|
|
439
|
+
return []
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
/**
|
|
443
|
+
* Show/hide minimap.
|
|
444
|
+
*/
|
|
445
|
+
displayMinimap: {
|
|
446
|
+
type: Boolean,
|
|
447
|
+
default: false,
|
|
448
|
+
},
|
|
449
|
+
/**
|
|
450
|
+
* Format of the input URL
|
|
451
|
+
*/
|
|
452
|
+
format: {
|
|
453
|
+
type: String,
|
|
454
|
+
default: "metadata",
|
|
455
|
+
},
|
|
456
|
+
/**
|
|
457
|
+
* Settings for minimap position, size and alignment.
|
|
458
|
+
*/
|
|
459
|
+
minimapSettings: {
|
|
460
|
+
type: Object,
|
|
461
|
+
default: function () {
|
|
462
|
+
return {
|
|
463
|
+
x_offset: 16,
|
|
464
|
+
y_offset: 16,
|
|
465
|
+
width: 128,
|
|
466
|
+
height: 128,
|
|
467
|
+
align: "top-right",
|
|
468
|
+
};
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
/**
|
|
472
|
+
* Flag to determine rather open map UI should be
|
|
473
|
+
* presented or not.
|
|
474
|
+
*/
|
|
475
|
+
enableOpenMapUI: {
|
|
476
|
+
type: Boolean,
|
|
477
|
+
default: false,
|
|
478
|
+
},
|
|
479
|
+
openMapOptions: {
|
|
480
|
+
type: Array,
|
|
481
|
+
default: function () {
|
|
482
|
+
return [
|
|
483
|
+
{
|
|
484
|
+
display: "Open AC Map",
|
|
485
|
+
key: "AC"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
display: "Open FC Map",
|
|
489
|
+
key: "FC"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
display: "Open 3D Human Map",
|
|
493
|
+
key: "3D"
|
|
494
|
+
},
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
/**
|
|
499
|
+
* State containing state of the scaffold.
|
|
500
|
+
*/
|
|
501
|
+
state: {
|
|
502
|
+
type: Object,
|
|
503
|
+
default: undefined,
|
|
504
|
+
},
|
|
505
|
+
/**
|
|
506
|
+
* Optional prop for the name of the region to focus on,
|
|
507
|
+
* this option is ignored if state or viewURL is also provided.
|
|
508
|
+
*/
|
|
509
|
+
region: {
|
|
510
|
+
type: String,
|
|
511
|
+
default: "",
|
|
512
|
+
},
|
|
513
|
+
/**
|
|
514
|
+
* Optional prop for an URL of containing information of a viewport.
|
|
515
|
+
* This option is ignored if state is also provided.
|
|
516
|
+
* It will use the provided URL as base if a relative parth is provided.
|
|
517
|
+
*/
|
|
518
|
+
viewURL: {
|
|
519
|
+
type: String,
|
|
520
|
+
default: "",
|
|
521
|
+
},
|
|
522
|
+
/**
|
|
523
|
+
* Settings for turning on/off rendering
|
|
524
|
+
*/
|
|
525
|
+
render: {
|
|
526
|
+
type: Boolean,
|
|
527
|
+
default: true,
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
data: function () {
|
|
531
|
+
return {
|
|
532
|
+
sceneData: this.$module.sceneData,
|
|
533
|
+
isPlaying: false,
|
|
534
|
+
isReady: false,
|
|
535
|
+
/**
|
|
536
|
+
* This is set when scene is transitioning.
|
|
537
|
+
*/
|
|
538
|
+
isTransitioning: false,
|
|
539
|
+
tooltipAppendToBody: false,
|
|
540
|
+
hoverVisibilities: [
|
|
541
|
+
{ value: false },
|
|
542
|
+
{ value: false },
|
|
543
|
+
{ value: false },
|
|
544
|
+
{ value: false },
|
|
545
|
+
{ value: false },
|
|
546
|
+
{ value: false },
|
|
547
|
+
{ value: false },
|
|
548
|
+
{ value: false },
|
|
549
|
+
{ value: false },
|
|
550
|
+
],
|
|
551
|
+
inHelp: false,
|
|
552
|
+
loading: false,
|
|
553
|
+
duration: 3000,
|
|
554
|
+
drawerOpen: true,
|
|
555
|
+
currentBackground: "white",
|
|
556
|
+
availableBackground: ["white", "lightskyblue", "black"],
|
|
557
|
+
minimisedSlider: false,
|
|
558
|
+
sliderPosition: "",
|
|
559
|
+
timeMax: 100,
|
|
560
|
+
orginalDuration: "",
|
|
561
|
+
animateDuration: "6secs",
|
|
562
|
+
playSpeed: [
|
|
563
|
+
{
|
|
564
|
+
value: 0.1,
|
|
565
|
+
label: "0.1x",
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
value: 0.5,
|
|
569
|
+
label: "0.5x",
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
value: 1,
|
|
573
|
+
label: "1x",
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
value: 2,
|
|
577
|
+
label: "2x",
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
value: 5,
|
|
581
|
+
label: "5x",
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
value: 10,
|
|
585
|
+
label: "10x",
|
|
586
|
+
},
|
|
587
|
+
],
|
|
588
|
+
currentSpeed: 1,
|
|
589
|
+
timeStamps: {},
|
|
590
|
+
defaultCheckedKeys: [],
|
|
591
|
+
tData: {
|
|
592
|
+
label: "",
|
|
593
|
+
region: "",
|
|
594
|
+
visible: false,
|
|
595
|
+
x: 200,
|
|
596
|
+
y: 200,
|
|
597
|
+
},
|
|
598
|
+
fileFormat: "metadata",
|
|
599
|
+
previousMarkerLabels: [],
|
|
600
|
+
};
|
|
601
|
+
},
|
|
602
|
+
watch: {
|
|
603
|
+
format: {
|
|
604
|
+
handler: function (value) {
|
|
605
|
+
this.fileFormat = value;
|
|
606
|
+
},
|
|
607
|
+
immediate: true,
|
|
608
|
+
},
|
|
609
|
+
url: {
|
|
610
|
+
handler: function (newValue) {
|
|
611
|
+
if (this.state === undefined || this.state.url === undefined)
|
|
612
|
+
this.setURL(newValue);
|
|
613
|
+
},
|
|
614
|
+
immediate: true,
|
|
615
|
+
},
|
|
616
|
+
region: {
|
|
617
|
+
handler: function (region) {
|
|
618
|
+
if (!(this.state || this.viewURL)) this.setFocusedRegion(region);
|
|
619
|
+
},
|
|
620
|
+
immediate: true,
|
|
621
|
+
},
|
|
622
|
+
state: {
|
|
623
|
+
handler: function (state) {
|
|
624
|
+
this.setState(state);
|
|
625
|
+
},
|
|
626
|
+
immediate: true,
|
|
627
|
+
deep: true,
|
|
628
|
+
},
|
|
629
|
+
viewURL: {
|
|
630
|
+
handler: function (viewURL) {
|
|
631
|
+
this.updateViewURL(viewURL);
|
|
632
|
+
},
|
|
633
|
+
immediate: true,
|
|
634
|
+
},
|
|
635
|
+
helpMode: function (val) {
|
|
636
|
+
this.setHelpMode(val);
|
|
637
|
+
},
|
|
638
|
+
displayMarkers: function (val) {
|
|
639
|
+
this.$module.scene.displayMarkers = val;
|
|
640
|
+
//Update pickable objects
|
|
641
|
+
this.$module.scene.forcePickableObjectsUpdate = true;
|
|
642
|
+
},
|
|
643
|
+
displayMinimap: function (val) {
|
|
644
|
+
this.$module.scene.displayMinimap = val;
|
|
645
|
+
},
|
|
646
|
+
"sceneData.currentTime": function () {
|
|
647
|
+
/**
|
|
648
|
+
* Triggers when scene time changes.
|
|
649
|
+
*
|
|
650
|
+
* @property {number} time Current build-in time of scene.
|
|
651
|
+
* of selected object.
|
|
652
|
+
*/
|
|
653
|
+
this.$emit("timeChanged", this.sceneData.currentTime);
|
|
654
|
+
},
|
|
655
|
+
duration: function () {
|
|
656
|
+
this.$module.scene.setDuration(this.duration);
|
|
657
|
+
},
|
|
658
|
+
minimapSettings: {
|
|
659
|
+
deep: true,
|
|
660
|
+
handler: "updateMinimapScissor",
|
|
661
|
+
},
|
|
662
|
+
render: function (val) {
|
|
663
|
+
this.toggleRendering(val);
|
|
664
|
+
},
|
|
665
|
+
markerLabels: function(labels) {
|
|
666
|
+
this.previousMarkerLabels.forEach((pml)=>{
|
|
667
|
+
this.setMarkerModeForObjectsWithName(pml, "off");
|
|
668
|
+
})
|
|
669
|
+
labels.forEach((l)=>{
|
|
670
|
+
this.setMarkerModeForObjectsWithName(l, "on");
|
|
671
|
+
})
|
|
672
|
+
this.previousMarkerLabels = labels;
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
beforeCreate: function () {
|
|
676
|
+
this.$module = new OrgansViewer();
|
|
677
|
+
this.selectedObjects = [];
|
|
678
|
+
this.hoveredObjects = [];
|
|
679
|
+
this.currentBackground = "white";
|
|
680
|
+
this._currentURL = undefined;
|
|
681
|
+
this.availableBackground = ["white", "black", "lightskyblue"];
|
|
682
|
+
this.$_searchIndex = new SearchIndex();
|
|
683
|
+
},
|
|
684
|
+
mounted: function () {
|
|
685
|
+
this.$refs.treeControls.setModule(this.$module);
|
|
686
|
+
let eventNotifier = new EventNotifier();
|
|
687
|
+
eventNotifier.subscribe(this, this.eventNotifierCallback);
|
|
688
|
+
this.$module.addNotifier(eventNotifier);
|
|
689
|
+
this.$module.addOrganPartAddedCallback(this.zincObjectAdded);
|
|
690
|
+
this.$module.initialiseRenderer(this.$refs.display);
|
|
691
|
+
this.toggleRendering(this.render);
|
|
692
|
+
this.ro = new ResizeObserver(this.adjustLayout).observe(
|
|
693
|
+
this.$refs.scaffoldContainer
|
|
694
|
+
);
|
|
695
|
+
this.defaultRate = this.$module.getPlayRate();
|
|
696
|
+
},
|
|
697
|
+
beforeDestroy: function () {
|
|
698
|
+
if (this.ro) this.ro.disconnect();
|
|
699
|
+
this.$module.destroy();
|
|
700
|
+
this.$module = undefined;
|
|
701
|
+
},
|
|
702
|
+
methods: {
|
|
703
|
+
addZincObject: function (zincObject) {
|
|
704
|
+
if (this.$module.scene) {
|
|
705
|
+
this.$module.scene.addZincObject(zincObject);
|
|
706
|
+
this.zincObjectAdded(zincObject);
|
|
707
|
+
if (this.$refs.treeControls) this.$refs.treeControls.zincObjectAdded(zincObject);
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
/**
|
|
711
|
+
* This is called when a new zinc object is read into the scene.
|
|
712
|
+
*/
|
|
713
|
+
zincObjectAdded: function (zincObject) {
|
|
714
|
+
this.loading = false;
|
|
715
|
+
this.$_searchIndex.addZincObject(zincObject, zincObject.uuid);
|
|
716
|
+
this.$emit("zinc-object-added", zincObject);
|
|
717
|
+
},
|
|
718
|
+
/**
|
|
719
|
+
*
|
|
720
|
+
*/
|
|
721
|
+
addRegionsToSearchIndex: function () {
|
|
722
|
+
const rootRegion = this.$module.scene.getRootRegion();
|
|
723
|
+
const regions = rootRegion.getChildRegions(true);
|
|
724
|
+
regions.forEach(region => {
|
|
725
|
+
this.$_searchIndex.addRegion(region, region.uuid);
|
|
726
|
+
});
|
|
727
|
+
},
|
|
728
|
+
/**
|
|
729
|
+
* This is called when Change backgspeedround colour button
|
|
730
|
+
* is pressed an causes the backgrouColornd colour to be changed
|
|
731
|
+
* to one of the three preset colour: white, black and
|
|
732
|
+
* lightskyblue.
|
|
733
|
+
*/
|
|
734
|
+
backgroundChangeCallback: function (colour) {
|
|
735
|
+
this.currentBackground = colour;
|
|
736
|
+
this.$module.zincRenderer
|
|
737
|
+
.getThreeJSRenderer()
|
|
738
|
+
.setClearColor(this.currentBackground, 1);
|
|
739
|
+
},
|
|
740
|
+
/**
|
|
741
|
+
* This is called by captueeScreenshot and after the last render
|
|
742
|
+
* loop, it download a screenshot of the current scene with no UI.
|
|
743
|
+
*/
|
|
744
|
+
captureScreenshotCallback: function () {
|
|
745
|
+
//Remove the callback, only needs to happen once
|
|
746
|
+
this.$module.zincRenderer.removePostRenderCallbackFunction(
|
|
747
|
+
this.captureID
|
|
748
|
+
);
|
|
749
|
+
let screenshot = this.$module.zincRenderer
|
|
750
|
+
.getThreeJSRenderer()
|
|
751
|
+
.domElement.toDataURL("image/png");
|
|
752
|
+
let hrefElement = document.createElement("a");
|
|
753
|
+
document.body.append(hrefElement);
|
|
754
|
+
if (!this.captureFilename) hrefElement.download = `screenshot.png`;
|
|
755
|
+
else hrefElement.download = this.captureFilename;
|
|
756
|
+
hrefElement.href = screenshot;
|
|
757
|
+
hrefElement.click();
|
|
758
|
+
hrefElement.remove();
|
|
759
|
+
},
|
|
760
|
+
/**
|
|
761
|
+
* Function for capturing a screenshot of the current rendering.
|
|
762
|
+
*
|
|
763
|
+
* @param {String} filename filename given to the screenshot.
|
|
764
|
+
*
|
|
765
|
+
* @public
|
|
766
|
+
*/
|
|
767
|
+
captureScreenshot: function (filename) {
|
|
768
|
+
this.captureFilename = filename;
|
|
769
|
+
this.captureID = this.$module.zincRenderer.addPostRenderCallbackFunction(
|
|
770
|
+
this.captureScreenshotCallback
|
|
771
|
+
);
|
|
772
|
+
},
|
|
773
|
+
/**
|
|
774
|
+
* Function to clear current scene, the tree controls and the search index.
|
|
775
|
+
*
|
|
776
|
+
* @public
|
|
777
|
+
*/
|
|
778
|
+
clearScene: function () {
|
|
779
|
+
if (this.$refs.treeControls) this.$refs.treeControls.clear();
|
|
780
|
+
if (this.$_searchIndex) this.$_searchIndex.removeAll();
|
|
781
|
+
if (this.$module.scene) this.$module.scene.clearAll();
|
|
782
|
+
},
|
|
783
|
+
formatTooltip(val) {
|
|
784
|
+
if (this.timeMax >= 1000) {
|
|
785
|
+
if (val) {
|
|
786
|
+
let sec = ((val % 60000) / 1000).toFixed(2) + "s";
|
|
787
|
+
let min = val > 60000 ? (val / 60000).toFixed(0) + "m " : "";
|
|
788
|
+
return min + sec;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
return val ? val.toFixed(2) + " ms" : "0 ms";
|
|
792
|
+
},
|
|
793
|
+
/**
|
|
794
|
+
* Function to reset the view to default.
|
|
795
|
+
* Also called when the associated button is pressed.
|
|
796
|
+
*
|
|
797
|
+
* @public
|
|
798
|
+
*/
|
|
799
|
+
fitWindow: function () {
|
|
800
|
+
if (this.$module.scene) {
|
|
801
|
+
this.$module.scene.viewAll();
|
|
802
|
+
}
|
|
803
|
+
},
|
|
804
|
+
/**
|
|
805
|
+
* Function to zoom in.
|
|
806
|
+
* Also called when the associated button is pressed.
|
|
807
|
+
*
|
|
808
|
+
* @public
|
|
809
|
+
*/
|
|
810
|
+
zoomIn: function () {
|
|
811
|
+
if (this.$module.scene) {
|
|
812
|
+
this.$module.scene.changeZoomByScrollRateUnit(-1);
|
|
813
|
+
}
|
|
814
|
+
},
|
|
815
|
+
/**
|
|
816
|
+
* Function to zoom out.
|
|
817
|
+
* Also called when the associated button is pressed.
|
|
818
|
+
*
|
|
819
|
+
* @public
|
|
820
|
+
*/
|
|
821
|
+
zoomOut: function () {
|
|
822
|
+
if (this.$module.scene) {
|
|
823
|
+
this.$module.scene.changeZoomByScrollRateUnit(1);
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
/**
|
|
827
|
+
* Function to change the current play speed.
|
|
828
|
+
*
|
|
829
|
+
* @public
|
|
830
|
+
*/
|
|
831
|
+
speedChanged: function (speed) {
|
|
832
|
+
this.currentSpeed = speed;
|
|
833
|
+
this.$module.setPlayRate(this.defaultRate * this.currentSpeed);
|
|
834
|
+
},
|
|
835
|
+
/**
|
|
836
|
+
* Function used to stop the free spin
|
|
837
|
+
*
|
|
838
|
+
* @public
|
|
839
|
+
*/
|
|
840
|
+
stopFreeSpin: function () {
|
|
841
|
+
let cameracontrol = this.$module.scene.getZincCameraControls();
|
|
842
|
+
cameracontrol.stopAutoTumble();
|
|
843
|
+
this.isTransitioning = false;
|
|
844
|
+
},
|
|
845
|
+
findObjectsWithGroupName: function (name) {
|
|
846
|
+
let objects = [];
|
|
847
|
+
if (name && name != "" && this.$module.scene) {
|
|
848
|
+
objects = this.$module.scene.findObjectsWithGroupName(name);
|
|
849
|
+
}
|
|
850
|
+
return objects;
|
|
851
|
+
},
|
|
852
|
+
/**
|
|
853
|
+
* Focus on named region
|
|
854
|
+
*/
|
|
855
|
+
viewRegion: function (names) {
|
|
856
|
+
const rootRegion = this.$module.scene.getRootRegion();
|
|
857
|
+
const groups = Array.isArray(names) ? names : [names];
|
|
858
|
+
const objects = findObjectsWithNames(rootRegion, groups, "", true);
|
|
859
|
+
let box = this.$module.scene.getBoundingBoxOfZincObjects(objects);
|
|
860
|
+
if (box) {
|
|
861
|
+
if (this.$module.isSyncControl()) {
|
|
862
|
+
this.$module.setSyncControlZoomToBox(box);
|
|
863
|
+
} else {
|
|
864
|
+
const dist =
|
|
865
|
+
this.$module.scene.camera.far - this.$module.scene.camera.near;
|
|
866
|
+
this.$module.scene.viewAllWithBoundingBox(box);
|
|
867
|
+
this.$module.scene.camera.far = this.$module.scene.camera.near + dist;
|
|
868
|
+
this.$module.scene.camera.updateProjectionMatrix();
|
|
869
|
+
}
|
|
870
|
+
return true;
|
|
871
|
+
}
|
|
872
|
+
return false;
|
|
873
|
+
},
|
|
874
|
+
setFocusedRegion: function (name) {
|
|
875
|
+
if (name) {
|
|
876
|
+
if (this.isReady) {
|
|
877
|
+
this.viewRegion(name);
|
|
878
|
+
} else {
|
|
879
|
+
this.$module.setFinishDownloadCallback(
|
|
880
|
+
this.setURLFinishCallback({ region: name })
|
|
881
|
+
);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
updateViewURL: function (viewURL) {
|
|
886
|
+
if (viewURL) {
|
|
887
|
+
if (this.isReady) {
|
|
888
|
+
const url = new URL(viewURL, this.url);
|
|
889
|
+
this.$module.scene.loadViewURL(url);
|
|
890
|
+
} else {
|
|
891
|
+
this.$module.setFinishDownloadCallback(
|
|
892
|
+
this.setURLFinishCallback({ viewURL: viewURL })
|
|
893
|
+
);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
getRendererInfo: function () {
|
|
898
|
+
if (this.$module.zincRenderer) {
|
|
899
|
+
return this.$module.zincRenderer.getThreeJSRenderer().info;
|
|
900
|
+
}
|
|
901
|
+
return undefined;
|
|
902
|
+
},
|
|
903
|
+
/**
|
|
904
|
+
* Function used to rotate the scene.
|
|
905
|
+
* Also called when the associated button is pressed.
|
|
906
|
+
*
|
|
907
|
+
* @public
|
|
908
|
+
*/
|
|
909
|
+
freeSpin: function () {
|
|
910
|
+
if (this.$module.scene) {
|
|
911
|
+
let cameracontrol = this.$module.scene.getZincCameraControls();
|
|
912
|
+
this.isTransitioning = true;
|
|
913
|
+
cameracontrol.enableAutoTumble();
|
|
914
|
+
cameracontrol.autoTumble([1.0, 0.0], Math.PI, true);
|
|
915
|
+
setTimeout(this.stopFreeSpin, 4000);
|
|
916
|
+
}
|
|
917
|
+
},
|
|
918
|
+
/**
|
|
919
|
+
* Callback when a region is selected/highlighted.
|
|
920
|
+
* It will also update other controls.
|
|
921
|
+
*
|
|
922
|
+
*/
|
|
923
|
+
eventNotifierCallback: function (event) {
|
|
924
|
+
const names = [];
|
|
925
|
+
let zincObjects = [];
|
|
926
|
+
const region = undefined;
|
|
927
|
+
if (event.eventType == 1 || event.eventType == 2) {
|
|
928
|
+
event.identifiers.forEach((identifier) => {
|
|
929
|
+
if (identifier) {
|
|
930
|
+
let id = identifier.data.id
|
|
931
|
+
? identifier.data.id
|
|
932
|
+
: identifier.data.group;
|
|
933
|
+
names.push(id);
|
|
934
|
+
}
|
|
935
|
+
});
|
|
936
|
+
zincObjects = event.zincObjects;
|
|
937
|
+
}
|
|
938
|
+
/*
|
|
939
|
+
* Event Type 1: Selected
|
|
940
|
+
* Event Type 2: Highlighted
|
|
941
|
+
* Event Type 1: Move
|
|
942
|
+
*/
|
|
943
|
+
if (event.eventType == 1) {
|
|
944
|
+
if (this.$refs.treeControls) {
|
|
945
|
+
if (names.length > 0) {
|
|
946
|
+
//this.$refs.treeControls.changeActiveByNames(names, region, false);
|
|
947
|
+
this.$refs.treeControls.updateActiveUI(zincObjects);
|
|
948
|
+
} else {
|
|
949
|
+
this.hideRegionTooltip();
|
|
950
|
+
this.$refs.treeControls.removeActive(true);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
// Triggers when an object has been selected
|
|
954
|
+
this.$emit("scaffold-selected", event.identifiers);
|
|
955
|
+
} else if (event.eventType == 2) {
|
|
956
|
+
if (this.selectedObjects.length === 0) {
|
|
957
|
+
this.hideRegionTooltip();
|
|
958
|
+
// const offsets = this.$refs.scaffoldContainer.getBoundingClientRect();
|
|
959
|
+
if (this.$refs.treeControls) {
|
|
960
|
+
if (names.length > 0) {
|
|
961
|
+
//this.$refs.treeControls.changeHoverByNames(names, region, false);
|
|
962
|
+
this.$refs.treeControls.updateHoverUI(zincObjects);
|
|
963
|
+
} else {
|
|
964
|
+
this.$refs.treeControls.removeHover(true);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
if (event.identifiers.length > 0 && event.identifiers[0]) {
|
|
968
|
+
let id = event.identifiers[0].data.id
|
|
969
|
+
? event.identifiers[0].data.id
|
|
970
|
+
: event.identifiers[0].data.group;
|
|
971
|
+
if (event.identifiers[0].coords) {
|
|
972
|
+
this.tData.visible = true;
|
|
973
|
+
this.tData.label = id;
|
|
974
|
+
if (event.identifiers[0].data.region)
|
|
975
|
+
this.tData.region = event.identifiers[0].data.region;
|
|
976
|
+
else this.tData.region = undefined;
|
|
977
|
+
this.tData.x = event.identifiers[0].coords.x;
|
|
978
|
+
this.tData.y = event.identifiers[0].coords.y;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
// Triggers when an object has been highlighted
|
|
982
|
+
this.$emit("scaffold-highlighted", event.identifiers);
|
|
983
|
+
}
|
|
984
|
+
} else if (event.eventType == 3) {
|
|
985
|
+
//MOVE
|
|
986
|
+
if (event.identifiers.length > 0 && event.identifiers[0]) {
|
|
987
|
+
if (event.identifiers[0].coords) {
|
|
988
|
+
const offsets =
|
|
989
|
+
this.$refs.scaffoldContainer.getBoundingClientRect();
|
|
990
|
+
this.tData.x = event.identifiers[0].coords.x - offsets.left;
|
|
991
|
+
this.tData.y = event.identifiers[0].coords.y - offsets.top;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
},
|
|
996
|
+
/**
|
|
997
|
+
* Get the coordinates of the current selected region.
|
|
998
|
+
*
|
|
999
|
+
* @public
|
|
1000
|
+
*/
|
|
1001
|
+
getCoordinatesOfSelected: function () {
|
|
1002
|
+
if (this.selectedObjects && this.selectedObjects.length > 0) {
|
|
1003
|
+
return this.$module.scene.getObjectsScreenXY(this.selectedObjects);
|
|
1004
|
+
}
|
|
1005
|
+
return undefined;
|
|
1006
|
+
},
|
|
1007
|
+
/**
|
|
1008
|
+
* Return an object containing the window coordinates of the
|
|
1009
|
+
* current selected region which will be updated after each render
|
|
1010
|
+
* loop.
|
|
1011
|
+
*
|
|
1012
|
+
* @public
|
|
1013
|
+
*/
|
|
1014
|
+
getDynamicSelectedCoordinates: function () {
|
|
1015
|
+
return this.$module.selectedScreenCoordinates;
|
|
1016
|
+
},
|
|
1017
|
+
/**
|
|
1018
|
+
* Callback when time is changed through the UI.
|
|
1019
|
+
*/
|
|
1020
|
+
timeChange: function (event) {
|
|
1021
|
+
let normalizedTime = (event / this.timeMax) * 100;
|
|
1022
|
+
if (normalizedTime != this.sceneData.currentTime)
|
|
1023
|
+
this.$module.updateTime(normalizedTime);
|
|
1024
|
+
},
|
|
1025
|
+
/**
|
|
1026
|
+
* A callback used by children components. Set the selected zinc object
|
|
1027
|
+
*
|
|
1028
|
+
* @param {object} object Zinc object
|
|
1029
|
+
*/
|
|
1030
|
+
objectSelected: function (objects, propagate) {
|
|
1031
|
+
this.selectedObjects = objects;
|
|
1032
|
+
if (this.selectedObjects && this.selectedObjects.length > 0) {
|
|
1033
|
+
this.$refs.primitiveControls.setObject(this.selectedObjects[0]);
|
|
1034
|
+
}
|
|
1035
|
+
this.$module.setSelectedByZincObjects(objects, undefined, propagate);
|
|
1036
|
+
},
|
|
1037
|
+
/**
|
|
1038
|
+
* A callback used by children components. Set the highlighted zinc object
|
|
1039
|
+
*
|
|
1040
|
+
* @param {object} object Zinc object
|
|
1041
|
+
*/
|
|
1042
|
+
objectHovered: function (objects, propagate) {
|
|
1043
|
+
this.hoveredObjects = objects;
|
|
1044
|
+
this.$module.setHighlightedByZincObjects(objects, undefined, propagate);
|
|
1045
|
+
},
|
|
1046
|
+
/**
|
|
1047
|
+
* Set the selected by name.
|
|
1048
|
+
*
|
|
1049
|
+
* @param {} name Name of the group
|
|
1050
|
+
*/
|
|
1051
|
+
changeActiveByName: function (names, region, propagate) {
|
|
1052
|
+
const isArray = Array.isArray(names);
|
|
1053
|
+
if (names === undefined || (isArray && names.length === 0)) {
|
|
1054
|
+
this.$refs.treeControls.removeActive(propagate);
|
|
1055
|
+
} else {
|
|
1056
|
+
let array = names;
|
|
1057
|
+
if (!isArray) array = [array];
|
|
1058
|
+
this.$refs.treeControls.changeActiveByNames(array, region, propagate);
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
/**
|
|
1062
|
+
* Set the highlighted by name.
|
|
1063
|
+
*
|
|
1064
|
+
* @param {name} name Name of the group
|
|
1065
|
+
*/
|
|
1066
|
+
changeHighlightedByName: function (names, region, propagate) {
|
|
1067
|
+
const isArray = Array.isArray(names);
|
|
1068
|
+
if (names === undefined || (isArray && names.length === 0)) {
|
|
1069
|
+
this.$refs.treeControls.removeHover(propagate);
|
|
1070
|
+
} else {
|
|
1071
|
+
let array = names;
|
|
1072
|
+
if (!isArray) array = [array];
|
|
1073
|
+
this.$refs.treeControls.changeHoverByNames(array, region, propagate);
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
/**
|
|
1077
|
+
* Start the animation.
|
|
1078
|
+
*
|
|
1079
|
+
* @param {object} object Zinc object
|
|
1080
|
+
*/
|
|
1081
|
+
play: function (flag) {
|
|
1082
|
+
this.$module.playAnimation(flag);
|
|
1083
|
+
this.isPlaying = flag;
|
|
1084
|
+
//Hide tooltip as location may
|
|
1085
|
+
//this.hideRegionTooltip();
|
|
1086
|
+
},
|
|
1087
|
+
/**
|
|
1088
|
+
* Function to toggle on/off overlay help.
|
|
1089
|
+
*/
|
|
1090
|
+
setHelpMode: function (helpMode) {
|
|
1091
|
+
if (helpMode) {
|
|
1092
|
+
this.inHelp = true;
|
|
1093
|
+
this.hoverVisibilities.forEach((item) => {
|
|
1094
|
+
item.value = true;
|
|
1095
|
+
});
|
|
1096
|
+
} else {
|
|
1097
|
+
this.inHelp = false;
|
|
1098
|
+
this.hoverVisibilities.forEach((item) => {
|
|
1099
|
+
item.value = false;
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
},
|
|
1103
|
+
/**
|
|
1104
|
+
* Callback function used by showRegionTooltip in the case when the tooltip
|
|
1105
|
+
* is out of view.
|
|
1106
|
+
*/
|
|
1107
|
+
displayTooltipOfObjectsCallback: function (
|
|
1108
|
+
name,
|
|
1109
|
+
objects,
|
|
1110
|
+
regionPath,
|
|
1111
|
+
resetView,
|
|
1112
|
+
liveUpdates
|
|
1113
|
+
) {
|
|
1114
|
+
const instance = this;
|
|
1115
|
+
return function () {
|
|
1116
|
+
instance.$module.zincRenderer.removePostRenderCallbackFunction(
|
|
1117
|
+
instance.$_regionTooltipCallback
|
|
1118
|
+
);
|
|
1119
|
+
instance.$_regionTooltipCallback = undefined;
|
|
1120
|
+
instance.displayTooltipOfObjects(name, objects, regionPath, resetView, liveUpdates);
|
|
1121
|
+
};
|
|
1122
|
+
},
|
|
1123
|
+
liveUpdateTooltipPosition: function () {
|
|
1124
|
+
if (this.$module.selectedCenter) {
|
|
1125
|
+
this.tData.x = this.$module.selectedScreenCoordinates.x;
|
|
1126
|
+
this.tData.y = this.$module.selectedScreenCoordinates.y;
|
|
1127
|
+
}
|
|
1128
|
+
},
|
|
1129
|
+
displayTooltipOfObjects: function (name, objects, regionPath, resetView, liveUpdates) {
|
|
1130
|
+
if (objects.length > 0) {
|
|
1131
|
+
let coords = objects[0].getClosestVertexDOMElementCoords(
|
|
1132
|
+
this.$module.scene
|
|
1133
|
+
);
|
|
1134
|
+
if (coords) {
|
|
1135
|
+
//The coords is not in view, view all if resetView flag is true
|
|
1136
|
+
if (!coords.inView) {
|
|
1137
|
+
this.hideRegionTooltip();
|
|
1138
|
+
if (resetView) {
|
|
1139
|
+
this.$module.scene.viewAll();
|
|
1140
|
+
//Use the post render callback to make sure the scene has been updated
|
|
1141
|
+
//before getting the position of the tooltip.
|
|
1142
|
+
if (this.$_regionTooltipCallback) {
|
|
1143
|
+
this.$module.zincRenderer.removePostRenderCallbackFunction(
|
|
1144
|
+
this.$_regionTooltipCallback
|
|
1145
|
+
);
|
|
1146
|
+
}
|
|
1147
|
+
this.$_regionTooltipCallback =
|
|
1148
|
+
this.$module.zincRenderer.addPostRenderCallbackFunction(
|
|
1149
|
+
this.displayTooltipOfObjectsCallback(
|
|
1150
|
+
name,
|
|
1151
|
+
objects,
|
|
1152
|
+
regionPath,
|
|
1153
|
+
resetView,
|
|
1154
|
+
liveUpdates
|
|
1155
|
+
)
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1158
|
+
} else {
|
|
1159
|
+
this.tData.visible = true;
|
|
1160
|
+
this.tData.label = name;
|
|
1161
|
+
this.tData.x = coords.position.x;
|
|
1162
|
+
this.tData.y = coords.position.y;
|
|
1163
|
+
this.tData.region = regionPath;
|
|
1164
|
+
if (this.$_liveCoordinatesUpdated) {
|
|
1165
|
+
this.$module.zincRenderer.removePostRenderCallbackFunction(
|
|
1166
|
+
this.$_liveCoordinatesUpdated
|
|
1167
|
+
);
|
|
1168
|
+
}
|
|
1169
|
+
if (liveUpdates) {
|
|
1170
|
+
this.$module.setupLiveCoordinates(objects);
|
|
1171
|
+
this.$_liveCoordinatesUpdated =
|
|
1172
|
+
this.$module.zincRenderer.addPostRenderCallbackFunction(
|
|
1173
|
+
this.liveUpdateTooltipPosition
|
|
1174
|
+
);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
return true;
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
this.hideRegionTooltip();
|
|
1181
|
+
return false;
|
|
1182
|
+
},
|
|
1183
|
+
/**
|
|
1184
|
+
* Display the tooltip used for displaying search result.
|
|
1185
|
+
* When resetView is set to true, it will
|
|
1186
|
+
* reset view if the tooltip is not in view.
|
|
1187
|
+
* Setting liveUpdates to true will update the tooltip location
|
|
1188
|
+
* at every rendering loop.
|
|
1189
|
+
*/
|
|
1190
|
+
showRegionTooltipWithObjects: function (label, zincObjects, regionPath, resetView, liveUpdates) {
|
|
1191
|
+
if (label && zincObjects && zincObjects.length > 0 && this.$module.scene) {
|
|
1192
|
+
return this.displayTooltipOfObjects(
|
|
1193
|
+
label,
|
|
1194
|
+
zincObjects,
|
|
1195
|
+
regionPath,
|
|
1196
|
+
resetView,
|
|
1197
|
+
liveUpdates
|
|
1198
|
+
);
|
|
1199
|
+
}
|
|
1200
|
+
this.hideRegionTooltip();
|
|
1201
|
+
return false;
|
|
1202
|
+
},
|
|
1203
|
+
/**
|
|
1204
|
+
* Display the tooltip. When resetView is set to true, it will
|
|
1205
|
+
* reset view if the tooltip is not in view.
|
|
1206
|
+
* Setting liveUpdates to true will update the tooltip location
|
|
1207
|
+
* at every rendering loop.
|
|
1208
|
+
*/
|
|
1209
|
+
showRegionTooltip: function (name, resetView, liveUpdates) {
|
|
1210
|
+
if (name && this.$module.scene) {
|
|
1211
|
+
const rootRegion = this.$module.scene.getRootRegion();
|
|
1212
|
+
const groups = [name];
|
|
1213
|
+
const objects = findObjectsWithNames(rootRegion, groups, "", true);
|
|
1214
|
+
let regionPath = undefined;
|
|
1215
|
+
if (objects && objects.length > 0) {
|
|
1216
|
+
regionPath = objects[0].getRegion().getFullPath();
|
|
1217
|
+
}
|
|
1218
|
+
return this.showRegionTooltipWithObjects(
|
|
1219
|
+
name,
|
|
1220
|
+
objects,
|
|
1221
|
+
regionPath,
|
|
1222
|
+
resetView,
|
|
1223
|
+
liveUpdates
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
this.hideRegionTooltip();
|
|
1227
|
+
return false;
|
|
1228
|
+
},
|
|
1229
|
+
/**
|
|
1230
|
+
* Display the tooltip using the list of annotations.
|
|
1231
|
+
* When resetView is set to true, it will
|
|
1232
|
+
* reset view if the tooltip is not in view.
|
|
1233
|
+
* Setting liveUpdates to true will update the tooltip location
|
|
1234
|
+
* at every rendering loop.
|
|
1235
|
+
*/
|
|
1236
|
+
showRegionTooltipWithAnnotations: function (annotations, resetView, liveUpdates) {
|
|
1237
|
+
if (this.$module.scene) {
|
|
1238
|
+
const result = getObjectsFromAnnotations(this.$module.scene, annotations);
|
|
1239
|
+
if (result && result.objects.length > 0) {
|
|
1240
|
+
return this.showRegionTooltipWithObjects(
|
|
1241
|
+
result.label,
|
|
1242
|
+
result.objects,
|
|
1243
|
+
result.regionPath,
|
|
1244
|
+
resetView,
|
|
1245
|
+
liveUpdates
|
|
1246
|
+
);
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
this.hideRegionTooltip();
|
|
1250
|
+
return false;
|
|
1251
|
+
},
|
|
1252
|
+
hideRegionTooltip: function () {
|
|
1253
|
+
if (this.$_liveCoordinatesUpdated) {
|
|
1254
|
+
this.$module.zincRenderer.removePostRenderCallbackFunction(
|
|
1255
|
+
this.$_liveCoordinatesUpdated
|
|
1256
|
+
);
|
|
1257
|
+
//Unset the tracking
|
|
1258
|
+
this.$module.setupLiveCoordinates(undefined);
|
|
1259
|
+
}
|
|
1260
|
+
this.tData.visible = false;
|
|
1261
|
+
this.tData.region = undefined;
|
|
1262
|
+
},
|
|
1263
|
+
/**
|
|
1264
|
+
* Set the marker modes for objects with the provided name, mode can
|
|
1265
|
+
* be "on", "off" or "inherited".
|
|
1266
|
+
*/
|
|
1267
|
+
setMarkerModeForObjectsWithName: function (name, mode) {
|
|
1268
|
+
if (name && this.$module.scene) {
|
|
1269
|
+
const rootRegion = this.$module.scene.getRootRegion();
|
|
1270
|
+
const groups = [name];
|
|
1271
|
+
const objects = findObjectsWithNames(rootRegion, groups, "", true);
|
|
1272
|
+
objects.forEach(object => object.setMarkerMode(mode));
|
|
1273
|
+
}
|
|
1274
|
+
},
|
|
1275
|
+
/**
|
|
1276
|
+
* Set the marker modes for objects specified by the list of annotations
|
|
1277
|
+
*/
|
|
1278
|
+
setMarkerModeWithAnnotations: function (annotations, mode) {
|
|
1279
|
+
if (this.$module.scene) {
|
|
1280
|
+
const result = getObjectsFromAnnotations(this.$module.scene, annotations);
|
|
1281
|
+
if (result && result.objects.length > 0) {
|
|
1282
|
+
result.objects.forEach(object => object.setMarkerMode(mode));
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
/**
|
|
1287
|
+
* This is called when mouse cursor enters supported elements
|
|
1288
|
+
* with help tootltips.
|
|
1289
|
+
*/
|
|
1290
|
+
showHelpText: function (helpTextNumber) {
|
|
1291
|
+
if (!this.inHelp) {
|
|
1292
|
+
this.helpTextWait = setTimeout(() => {
|
|
1293
|
+
this.hoverVisibilities[helpTextNumber].value = true;
|
|
1294
|
+
}, 500);
|
|
1295
|
+
}
|
|
1296
|
+
},
|
|
1297
|
+
/**
|
|
1298
|
+
* This is called when mouse cursor exits supported element..
|
|
1299
|
+
*/
|
|
1300
|
+
hideHelpText: function (helpTextNumber) {
|
|
1301
|
+
if (!this.inHelp) {
|
|
1302
|
+
this.hoverVisibilities[helpTextNumber].value = false;
|
|
1303
|
+
clearTimeout(this.helpTextWait);
|
|
1304
|
+
}
|
|
1305
|
+
},
|
|
1306
|
+
search: function (text, displayLabel) {
|
|
1307
|
+
if (this.$_searchIndex) {
|
|
1308
|
+
if (text === undefined || text === "" ||
|
|
1309
|
+
((Array.isArray(text) && text.length === 0))
|
|
1310
|
+
) {
|
|
1311
|
+
this.objectSelected([], true);
|
|
1312
|
+
return false;
|
|
1313
|
+
} else {
|
|
1314
|
+
const result = this.$_searchIndex.searchAndProcessResult(text);
|
|
1315
|
+
const zincObjects = result.zincObjects;
|
|
1316
|
+
if (zincObjects.length > 0) {
|
|
1317
|
+
this.objectSelected(zincObjects, true);
|
|
1318
|
+
if (displayLabel) {
|
|
1319
|
+
for (let i = 0; i < zincObjects.length; i++) {
|
|
1320
|
+
if (zincObjects[i] && zincObjects[i].groupName) {
|
|
1321
|
+
this.showRegionTooltipWithObjects(
|
|
1322
|
+
result.label,
|
|
1323
|
+
zincObjects,
|
|
1324
|
+
result.regionPath,
|
|
1325
|
+
true,
|
|
1326
|
+
true
|
|
1327
|
+
);
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
return true;
|
|
1332
|
+
} else {
|
|
1333
|
+
this.objectSelected([], true);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
return false;
|
|
1338
|
+
},
|
|
1339
|
+
/**
|
|
1340
|
+
* Get the list of suggested terms
|
|
1341
|
+
*/
|
|
1342
|
+
fetchSuggestions: function (term) {
|
|
1343
|
+
if (this.$_searchIndex === undefined) return [];
|
|
1344
|
+
return this.$_searchIndex.auto_suggest(term);
|
|
1345
|
+
},
|
|
1346
|
+
/**
|
|
1347
|
+
* Called when minimap settings has changed. Pass the
|
|
1348
|
+
* parameters to ZincJS and marked it for update.
|
|
1349
|
+
*/
|
|
1350
|
+
updateMinimapScissor: function () {
|
|
1351
|
+
Object.keys(this.minimapSettings).forEach((key) => {
|
|
1352
|
+
this.$module.scene.minimapScissor[key] = this.minimapSettings[key];
|
|
1353
|
+
});
|
|
1354
|
+
this.$module.scene.minimapScissor.updateRequired = true;
|
|
1355
|
+
},
|
|
1356
|
+
updateSettingsfromScene: function () {
|
|
1357
|
+
this.currentSpeed = 1;
|
|
1358
|
+
this.$module.setPlayRate(this.defaultRate);
|
|
1359
|
+
this.orginalDuration =
|
|
1360
|
+
this.$module.scene.getMetadataTag("OriginalDuration");
|
|
1361
|
+
this.animateDuration = this.$module.scene.getMetadataTag("Duration");
|
|
1362
|
+
let timeStamps = this.$module.scene.getMetadataTag("TimeStamps");
|
|
1363
|
+
this.timeStamps = {};
|
|
1364
|
+
for (const key in timeStamps) {
|
|
1365
|
+
this.timeStamps[timeStamps[key]] = key;
|
|
1366
|
+
}
|
|
1367
|
+
this.timeMax = this.$module.scene.getDuration();
|
|
1368
|
+
},
|
|
1369
|
+
setURLFinishCallback: function (options) {
|
|
1370
|
+
return () => {
|
|
1371
|
+
if (options) {
|
|
1372
|
+
if (options.viewport) {
|
|
1373
|
+
this.$module.scene
|
|
1374
|
+
.getZincCameraControls()
|
|
1375
|
+
.setCurrentCameraSettings(options.viewport);
|
|
1376
|
+
} else if (options.viewURL && options.viewURL !== "") {
|
|
1377
|
+
const url = new URL(options.viewURL, this.url);
|
|
1378
|
+
this.$module.scene.loadViewURL(url);
|
|
1379
|
+
} else if (options.region && options.region !== "") {
|
|
1380
|
+
this.viewRegion(options.region);
|
|
1381
|
+
}
|
|
1382
|
+
if (options.visibility) {
|
|
1383
|
+
// Some UIs may not be ready at this time.
|
|
1384
|
+
this.$nextTick(() => {
|
|
1385
|
+
this.$refs.treeControls.setState(options.visibility);
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
this.updateSettingsfromScene();
|
|
1390
|
+
this.$module.updateTime(0.01);
|
|
1391
|
+
this.$module.updateTime(0);
|
|
1392
|
+
this.$module.unsetFinishDownloadCallback();
|
|
1393
|
+
this.addRegionsToSearchIndex();
|
|
1394
|
+
this.$emit("on-ready");
|
|
1395
|
+
this.setMarkers();
|
|
1396
|
+
this.isReady = true;
|
|
1397
|
+
};
|
|
1398
|
+
},
|
|
1399
|
+
/**
|
|
1400
|
+
* Function used for getting the current states of the scene. This exported states
|
|
1401
|
+
* can be imported using the importStates method.
|
|
1402
|
+
*
|
|
1403
|
+
* @public
|
|
1404
|
+
*/
|
|
1405
|
+
getState: function () {
|
|
1406
|
+
let state = {
|
|
1407
|
+
format: this.fileFormat,
|
|
1408
|
+
url: this._currentURL,
|
|
1409
|
+
viewport: undefined,
|
|
1410
|
+
visibility: undefined,
|
|
1411
|
+
};
|
|
1412
|
+
if (this.$refs.treeControls)
|
|
1413
|
+
state.visibility = this.$refs.treeControls.getState();
|
|
1414
|
+
if (this.$module.scene) {
|
|
1415
|
+
let zincCameraControls = this.$module.scene.getZincCameraControls();
|
|
1416
|
+
state.viewport = zincCameraControls.getCurrentViewport();
|
|
1417
|
+
}
|
|
1418
|
+
return state;
|
|
1419
|
+
},
|
|
1420
|
+
/**
|
|
1421
|
+
* Function used for importing the states of the scene. This exported states
|
|
1422
|
+
* can be imported using the read states method.
|
|
1423
|
+
*
|
|
1424
|
+
* @public
|
|
1425
|
+
*/
|
|
1426
|
+
setState: function (state) {
|
|
1427
|
+
if (state) {
|
|
1428
|
+
if (state.url && state.url !== this._currentURL) {
|
|
1429
|
+
this.setURLAndState(state.url, {
|
|
1430
|
+
fileFormat: state.fileFormat,
|
|
1431
|
+
viewport: state.viewport,
|
|
1432
|
+
visibility: state.visibility,
|
|
1433
|
+
});
|
|
1434
|
+
} else {
|
|
1435
|
+
if (state.viewport || state.visibility) {
|
|
1436
|
+
if (this.isReady && this.$module.scene) {
|
|
1437
|
+
if (state.viewport)
|
|
1438
|
+
this.$module.scene
|
|
1439
|
+
.getZincCameraControls()
|
|
1440
|
+
.setCurrentCameraSettings(state.viewport);
|
|
1441
|
+
if (state.visibility)
|
|
1442
|
+
this.$refs.treeControls.setState(state.visibility);
|
|
1443
|
+
} else {
|
|
1444
|
+
this.$module.setFinishDownloadCallback(
|
|
1445
|
+
this.setURLFinishCallback({
|
|
1446
|
+
viewport: state.viewport,
|
|
1447
|
+
visibility: state.visibility,
|
|
1448
|
+
})
|
|
1449
|
+
);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
},
|
|
1455
|
+
exportGLTF: function (binary) {
|
|
1456
|
+
return this.$module.scene.exportGLTF(binary);
|
|
1457
|
+
},
|
|
1458
|
+
/**
|
|
1459
|
+
* Function used for reading in new scaffold metadata and a custom
|
|
1460
|
+
* viewport. This function will ignore the state prop and
|
|
1461
|
+
* read in the new url.
|
|
1462
|
+
*
|
|
1463
|
+
* @public
|
|
1464
|
+
*/
|
|
1465
|
+
setURLAndState: function (newValue, state) {
|
|
1466
|
+
if (newValue != this._currentURL) {
|
|
1467
|
+
if (state && state.format) this.fileFormat = state.format;
|
|
1468
|
+
let viewport = state && state.viewport ? state.viewport : undefined;
|
|
1469
|
+
let visibility =
|
|
1470
|
+
state && state.visibility ? state.visibility : undefined;
|
|
1471
|
+
this._currentURL = newValue;
|
|
1472
|
+
if (this.$refs.treeControls) this.$refs.treeControls.clear();
|
|
1473
|
+
this.loading = true;
|
|
1474
|
+
this.isReady = false;
|
|
1475
|
+
this.$_searchIndex.removeAll();
|
|
1476
|
+
this.hideRegionTooltip();
|
|
1477
|
+
this.$module.setFinishDownloadCallback(
|
|
1478
|
+
this.setURLFinishCallback({
|
|
1479
|
+
viewport: viewport,
|
|
1480
|
+
region: this.region,
|
|
1481
|
+
viewURL: this.viewURL,
|
|
1482
|
+
visibility: visibility,
|
|
1483
|
+
})
|
|
1484
|
+
);
|
|
1485
|
+
if (this.fileFormat === "gltf") {
|
|
1486
|
+
this.$module.loadGLTFFromURL(newValue, "scene", true);
|
|
1487
|
+
} else {
|
|
1488
|
+
this.$module.loadOrgansFromURL(
|
|
1489
|
+
newValue,
|
|
1490
|
+
undefined,
|
|
1491
|
+
undefined,
|
|
1492
|
+
"scene",
|
|
1493
|
+
undefined,
|
|
1494
|
+
true
|
|
1495
|
+
);
|
|
1496
|
+
}
|
|
1497
|
+
this.$module.scene.displayMarkers = this.displayMarkers;
|
|
1498
|
+
this.$module.scene.forcePickableObjectsUpdate = true;
|
|
1499
|
+
this.$module.scene.displayMinimap = this.displayMinimap;
|
|
1500
|
+
this.updateMinimapScissor();
|
|
1501
|
+
}
|
|
1502
|
+
},
|
|
1503
|
+
/**
|
|
1504
|
+
* Function used for reading in new scaffold metadata. This function will ignore
|
|
1505
|
+
* the state prop and read in the new url.
|
|
1506
|
+
*
|
|
1507
|
+
* @public
|
|
1508
|
+
*/
|
|
1509
|
+
setURL: function (newValue) {
|
|
1510
|
+
this.setURLAndState(newValue, undefined);
|
|
1511
|
+
},
|
|
1512
|
+
/**
|
|
1513
|
+
* Callback when drawer is toggled.
|
|
1514
|
+
*/
|
|
1515
|
+
drawerToggled: function (flag) {
|
|
1516
|
+
this.drawerOpen = flag;
|
|
1517
|
+
this.adjustLayout();
|
|
1518
|
+
},
|
|
1519
|
+
/**
|
|
1520
|
+
* Callback using ResizeObserver.
|
|
1521
|
+
*/
|
|
1522
|
+
adjustLayout: function () {
|
|
1523
|
+
let width = this.$refs.scaffoldContainer.clientWidth;
|
|
1524
|
+
this.minimisedSlider = width < 812;
|
|
1525
|
+
if (this.minimisedSlider) {
|
|
1526
|
+
this.sliderPosition = this.drawerOpen ? "right" : "left";
|
|
1527
|
+
} else {
|
|
1528
|
+
this.sliderPosition = "";
|
|
1529
|
+
}
|
|
1530
|
+
},
|
|
1531
|
+
toggleRendering: function (flag) {
|
|
1532
|
+
if (this.$module.zincRenderer) {
|
|
1533
|
+
if (flag) {
|
|
1534
|
+
this.$module.zincRenderer.animate();
|
|
1535
|
+
} else {
|
|
1536
|
+
this.$module.zincRenderer.stopAnimate();
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
},
|
|
1540
|
+
forceResize: function () {
|
|
1541
|
+
if (this.$module.zincRenderer) {
|
|
1542
|
+
this.$module.zincRenderer.onWindowResize();
|
|
1543
|
+
}
|
|
1544
|
+
},
|
|
1545
|
+
syncControlCallback: function () {
|
|
1546
|
+
const payload = this.$module.NDCCameraControl.getPanZoom();
|
|
1547
|
+
if (this.tData.visible) {
|
|
1548
|
+
this.showRegionTooltip(this.tData.label, true, true);
|
|
1549
|
+
}
|
|
1550
|
+
this.$emit("scaffold-navigated", payload);
|
|
1551
|
+
},
|
|
1552
|
+
/**
|
|
1553
|
+
* Rotate mode - "none", "horizontal", "vertical", "free" but
|
|
1554
|
+
* it will be ignored if flag is set to false.
|
|
1555
|
+
*/
|
|
1556
|
+
toggleSyncControl: function (flag, rotateMode) {
|
|
1557
|
+
this.$module.toggleSyncControl(flag, rotateMode);
|
|
1558
|
+
this.$module.setSyncControlCallback(this.syncControlCallback);
|
|
1559
|
+
},
|
|
1560
|
+
|
|
1561
|
+
/**
|
|
1562
|
+
* Set the markers for the scene.
|
|
1563
|
+
*/
|
|
1564
|
+
setMarkers: function () {
|
|
1565
|
+
this.markerLabels.forEach((l)=>{
|
|
1566
|
+
this.setMarkerModeForObjectsWithName(l, "on");
|
|
1567
|
+
})
|
|
1568
|
+
},
|
|
1569
|
+
},
|
|
1570
|
+
};
|
|
1571
|
+
</script>
|
|
1572
|
+
|
|
1573
|
+
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
1574
|
+
<style scoped lang="scss">
|
|
1575
|
+
@import "~element-ui/packages/theme-chalk/src/button";
|
|
1576
|
+
@import "~element-ui/packages/theme-chalk/src/col";
|
|
1577
|
+
@import "~element-ui/packages/theme-chalk/src/loading";
|
|
1578
|
+
@import "~element-ui/packages/theme-chalk/src/option";
|
|
1579
|
+
@import "~element-ui/packages/theme-chalk/src/popover";
|
|
1580
|
+
@import "~element-ui/packages/theme-chalk/src/row";
|
|
1581
|
+
@import "~element-ui/packages/theme-chalk/src/select";
|
|
1582
|
+
@import "~element-ui/packages/theme-chalk/src/slider";
|
|
1583
|
+
@import "~element-ui/packages/theme-chalk/src/tabs";
|
|
1584
|
+
@import "~element-ui/packages/theme-chalk/src/tab-pane";
|
|
1585
|
+
|
|
1586
|
+
.message-icon {
|
|
1587
|
+
position: absolute;
|
|
1588
|
+
top: 15px;
|
|
1589
|
+
left: 37px;
|
|
1590
|
+
text-align: left;
|
|
1591
|
+
font-size: 25px;
|
|
1592
|
+
color: $warning;
|
|
1593
|
+
|
|
1594
|
+
&:hover {
|
|
1595
|
+
cursor: pointer;
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
.warning-icon {
|
|
1600
|
+
color: $warning;
|
|
1601
|
+
top: 15px;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
.latest-changesicon {
|
|
1605
|
+
color: $success;
|
|
1606
|
+
top: 45px;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
.message-text {
|
|
1610
|
+
font-size: 15px;
|
|
1611
|
+
vertical-align: 5px;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
::v-deep .message-popper {
|
|
1615
|
+
padding: 9px 10px;
|
|
1616
|
+
min-width: 150px;
|
|
1617
|
+
font-size: 12px;
|
|
1618
|
+
color: #fff;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
#organsDisplayArea {
|
|
1622
|
+
&:focus {
|
|
1623
|
+
outline: none !important;
|
|
1624
|
+
border: 0px;
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
.scaffold-container {
|
|
1629
|
+
height: 100%;
|
|
1630
|
+
width: 100%;
|
|
1631
|
+
position: relative;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
.time-slider-container {
|
|
1635
|
+
text-align: left;
|
|
1636
|
+
position: absolute;
|
|
1637
|
+
right: 155px;
|
|
1638
|
+
width: calc(100% - 530px);
|
|
1639
|
+
bottom: 16px;
|
|
1640
|
+
transition: all 1s ease;
|
|
1641
|
+
outline: none;
|
|
1642
|
+
|
|
1643
|
+
&.minimised {
|
|
1644
|
+
width: calc(40%);
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
&.left {
|
|
1648
|
+
right: 155px;
|
|
1649
|
+
width: calc(100% - 250px);
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
&.right {
|
|
1653
|
+
right: 8px;
|
|
1654
|
+
bottom: 54px;
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
.slider-display-text {
|
|
1659
|
+
height: 20px;
|
|
1660
|
+
color: rgb(48, 49, 51);
|
|
1661
|
+
font-size: 14px;
|
|
1662
|
+
font-weight: normal;
|
|
1663
|
+
line-height: 20px;
|
|
1664
|
+
padding-left: 8px;
|
|
1665
|
+
text-shadow: -1px -1px #fff, 1px -1px #fff, -1px 1px #fff, 1px -1px #fff;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
.tab-content {
|
|
1669
|
+
display: flex;
|
|
1670
|
+
height: 34px;
|
|
1671
|
+
padding-top: 8px;
|
|
1672
|
+
font-size: 14px;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
.tab-content ::v-deep .el-slider__marks-text {
|
|
1676
|
+
margin-top: 12px;
|
|
1677
|
+
margin-left: 8px;
|
|
1678
|
+
font-size: 10px;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
.tab-content ::v-deep .el-slider__stop {
|
|
1682
|
+
width: 10px;
|
|
1683
|
+
height: 10px;
|
|
1684
|
+
top: -1px;
|
|
1685
|
+
border: solid 1px $app-primary-color;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
.animation-data {
|
|
1689
|
+
margin-left: 8px;
|
|
1690
|
+
line-height: 26px;
|
|
1691
|
+
display: flex;
|
|
1692
|
+
|
|
1693
|
+
:not(:first-child) {
|
|
1694
|
+
margin-left: 8px;
|
|
1695
|
+
}
|
|
1696
|
+
.purple {
|
|
1697
|
+
padding-left: 2px;
|
|
1698
|
+
color: $app-primary-color;
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
.slider {
|
|
1702
|
+
margin-left: 30px;
|
|
1703
|
+
width: calc(100% - 88px);
|
|
1704
|
+
margin-top: -7px;
|
|
1705
|
+
|
|
1706
|
+
::v-deep .el-slider__runway {
|
|
1707
|
+
height: 10px;
|
|
1708
|
+
margin: 14px 0;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
::v-deep .el-slider__button-wrapper {
|
|
1712
|
+
top: -13px;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
.zoomOut {
|
|
1717
|
+
padding-left: 8px;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
.fitWindow {
|
|
1721
|
+
padding-left: 8px;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
::v-deep .non-selectable {
|
|
1725
|
+
user-select: none;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
::v-deep .background-popper {
|
|
1729
|
+
padding: 5px 12px;
|
|
1730
|
+
background-color: #ffffff;
|
|
1731
|
+
border: 1px solid $app-primary-color;
|
|
1732
|
+
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
|
|
1733
|
+
height: 72px;
|
|
1734
|
+
width: 128px;
|
|
1735
|
+
min-width: 128px;
|
|
1736
|
+
|
|
1737
|
+
&.el-popper[x-placement^="top"] {
|
|
1738
|
+
.popper__arrow {
|
|
1739
|
+
border-top-color: $app-primary-color !important;
|
|
1740
|
+
&:after {
|
|
1741
|
+
border-top-color: #fff !important;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
::v-deep .open-map-popper {
|
|
1748
|
+
padding-top: 5px;
|
|
1749
|
+
padding-bottom: 5px;
|
|
1750
|
+
background-color: #ffffff;
|
|
1751
|
+
border: 1px solid $app-primary-color;
|
|
1752
|
+
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
|
|
1753
|
+
width: 178px;
|
|
1754
|
+
min-width: 178px;
|
|
1755
|
+
|
|
1756
|
+
.el-row ~ .el-row {
|
|
1757
|
+
margin-top: 8px;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
.el-button {
|
|
1761
|
+
padding-top:5px;
|
|
1762
|
+
padding-bottom:5px;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
&.el-popper[x-placement^="top"] {
|
|
1766
|
+
.popper__arrow {
|
|
1767
|
+
border-top-color: $app-primary-color !important;
|
|
1768
|
+
&:after {
|
|
1769
|
+
border-top-color: #fff !important;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
.settings-group {
|
|
1776
|
+
bottom: 16px;
|
|
1777
|
+
position: absolute;
|
|
1778
|
+
transition: all 1s ease;
|
|
1779
|
+
|
|
1780
|
+
&.open {
|
|
1781
|
+
left: 322px;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
&.close {
|
|
1785
|
+
left: 24px;
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
.backgroundText {
|
|
1790
|
+
color: rgb(48, 49, 51);
|
|
1791
|
+
font-size: 14px;
|
|
1792
|
+
font-weight: normal;
|
|
1793
|
+
line-height: 20px;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
.backgroundChooser {
|
|
1797
|
+
display: flex;
|
|
1798
|
+
margin-top: 16px;
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
.backgroundChoice {
|
|
1802
|
+
width: 20px;
|
|
1803
|
+
height: 20px;
|
|
1804
|
+
border: 1px solid rgb(144, 147, 153);
|
|
1805
|
+
margin-left: 20px;
|
|
1806
|
+
|
|
1807
|
+
&.active {
|
|
1808
|
+
border: 2px solid $app-primary-color;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
&:hover {
|
|
1812
|
+
cursor: pointer;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
&.white {
|
|
1816
|
+
background-color: white;
|
|
1817
|
+
margin-left: 10px;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
&.black {
|
|
1821
|
+
background-color: black;
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
&.lightskyblue {
|
|
1825
|
+
background-color: lightskyblue;
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
.icon-button {
|
|
1830
|
+
height: 24px !important;
|
|
1831
|
+
width: 24px !important;
|
|
1832
|
+
|
|
1833
|
+
&:hover {
|
|
1834
|
+
cursor: pointer;
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
.bottom-right-control {
|
|
1839
|
+
position: absolute;
|
|
1840
|
+
right: 16px;
|
|
1841
|
+
bottom: 16px;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
.video-button {
|
|
1845
|
+
margin-left: 8px;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
.time-slider-container {
|
|
1849
|
+
::v-deep .el-tabs__header {
|
|
1850
|
+
margin: 0px;
|
|
1851
|
+
border-bottom: 1px solid rgb(144, 147, 153);
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
.el-row {
|
|
1855
|
+
margin-bottom: 5px;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
::v-deep .el-tabs__content {
|
|
1859
|
+
border-left: 1px solid rgb(144, 147, 153);
|
|
1860
|
+
border-bottom: 1px solid rgb(144, 147, 153);
|
|
1861
|
+
border-right: 1px solid rgb(144, 147, 153);
|
|
1862
|
+
border-radius: 0px 0px 4px 4px;
|
|
1863
|
+
background-color: white;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
::v-deep .el-tabs--card {
|
|
1867
|
+
> .el-tabs__header {
|
|
1868
|
+
.el-tabs__nav {
|
|
1869
|
+
border: 1px solid rgb(144, 147, 153);
|
|
1870
|
+
border-bottom: none;
|
|
1871
|
+
border-radius: 4px 4px 0px 0px;
|
|
1872
|
+
background-color: white;
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
.el-tabs__item {
|
|
1876
|
+
height: 24px;
|
|
1877
|
+
line-height: 24px;
|
|
1878
|
+
padding: 0 8px !important;
|
|
1879
|
+
border-bottom: 1px solid;
|
|
1880
|
+
border-left: 1px solid rgb(144, 147, 153);
|
|
1881
|
+
&:first-child {
|
|
1882
|
+
border-left: none;
|
|
1883
|
+
}
|
|
1884
|
+
&.is-active {
|
|
1885
|
+
border-bottom: 1px solid white;
|
|
1886
|
+
color: rgb(48, 49, 51);
|
|
1887
|
+
}
|
|
1888
|
+
&:hover {
|
|
1889
|
+
color: $app-primary-color;
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
::v-deep .scaffold-popper {
|
|
1897
|
+
padding: 6px 4px;
|
|
1898
|
+
font-size: 12px;
|
|
1899
|
+
color: rgb(48, 49, 51);
|
|
1900
|
+
background-color: #f3ecf6;
|
|
1901
|
+
border: 1px solid $app-primary-color;
|
|
1902
|
+
white-space: nowrap;
|
|
1903
|
+
min-width: unset;
|
|
1904
|
+
pointer-events: none;
|
|
1905
|
+
|
|
1906
|
+
&.left-popper {
|
|
1907
|
+
.popper__arrow {
|
|
1908
|
+
border-left-color: $app-primary-color !important;
|
|
1909
|
+
&:after {
|
|
1910
|
+
border-left-color: #f3ecf6 !important;
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
&.right-popper {
|
|
1916
|
+
.popper__arrow {
|
|
1917
|
+
border-right-color: $app-primary-color !important;
|
|
1918
|
+
&:after {
|
|
1919
|
+
border-right-color: #f3ecf6 !important;
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
&.el-popper[x-placement^="top"] {
|
|
1925
|
+
.popper__arrow {
|
|
1926
|
+
border-top-color: $app-primary-color !important;
|
|
1927
|
+
&:after {
|
|
1928
|
+
border-top-color: #f3ecf6 !important;
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
::v-deep .el-slider__button {
|
|
1935
|
+
border: 2px solid $app-primary-color;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
::v-deep .el-slider__bar {
|
|
1939
|
+
background-color: $app-primary-color;
|
|
1940
|
+
height: 10px;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
::v-deep .el-loading-spinner {
|
|
1944
|
+
i,
|
|
1945
|
+
.el-loading-text {
|
|
1946
|
+
color: $app-primary-color;
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
::v-deep .popper-zoomout {
|
|
1951
|
+
padding-right: 11px;
|
|
1952
|
+
left: -21px !important;
|
|
1953
|
+
.popper__arrow {
|
|
1954
|
+
left: 53px !important;
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
.select-box {
|
|
1959
|
+
width: 57px;
|
|
1960
|
+
border-radius: 4px;
|
|
1961
|
+
border: 1px solid rgb(144, 147, 153);
|
|
1962
|
+
background-color: var(--white);
|
|
1963
|
+
font-weight: 500;
|
|
1964
|
+
color: rgb(48, 49, 51);
|
|
1965
|
+
margin-left: 8px;
|
|
1966
|
+
|
|
1967
|
+
::v-deep .el-input__inner {
|
|
1968
|
+
color: $app-primary-color;
|
|
1969
|
+
height: 22px;
|
|
1970
|
+
padding-left: 8px;
|
|
1971
|
+
padding-right: 8px;
|
|
1972
|
+
border: none;
|
|
1973
|
+
font-family: "Asap", sans-serif;
|
|
1974
|
+
line-height: 22px;
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
::v-deep .el-input,
|
|
1978
|
+
::v-deep .el-input__icon {
|
|
1979
|
+
line-height: 22px;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
</style>
|
|
1983
|
+
|
|
1984
|
+
<style lang="scss">
|
|
1985
|
+
.time-slider-tooltip {
|
|
1986
|
+
padding: 6px 4px !important;
|
|
1987
|
+
font-family: "Asap", sans-serif;
|
|
1988
|
+
font-size: 12px !important;
|
|
1989
|
+
color: rgb(48, 49, 51) !important;
|
|
1990
|
+
background-color: #f3ecf6 !important;
|
|
1991
|
+
border: 1px solid $app-primary-color !important;
|
|
1992
|
+
white-space: nowrap !important;
|
|
1993
|
+
min-width: unset !important;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
.scaffold_viewer_dropdown .el-select-dropdown__item {
|
|
1997
|
+
white-space: nowrap;
|
|
1998
|
+
text-align: left;
|
|
1999
|
+
font-family: "Asap", sans-serif;
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
.primitive-controls-box {
|
|
2003
|
+
right: 0px;
|
|
2004
|
+
bottom: 200px;
|
|
2005
|
+
position: absolute;
|
|
2006
|
+
}
|
|
2007
|
+
</style>
|