@abi-software/scaffoldvuer 0.1.1 → 0.1.5-1.beta.0

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.
@@ -0,0 +1,4388 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["scaffoldvuer"] = factory();
8
+ else
9
+ root["scaffoldvuer"] = factory();
10
+ })((typeof self !== 'undefined' ? self : this), function() {
11
+ return /******/ (function(modules) { // webpackBootstrap
12
+ /******/ // The module cache
13
+ /******/ var installedModules = {};
14
+ /******/
15
+ /******/ // The require function
16
+ /******/ function __webpack_require__(moduleId) {
17
+ /******/
18
+ /******/ // Check if module is in cache
19
+ /******/ if(installedModules[moduleId]) {
20
+ /******/ return installedModules[moduleId].exports;
21
+ /******/ }
22
+ /******/ // Create a new module (and put it into the cache)
23
+ /******/ var module = installedModules[moduleId] = {
24
+ /******/ i: moduleId,
25
+ /******/ l: false,
26
+ /******/ exports: {}
27
+ /******/ };
28
+ /******/
29
+ /******/ // Execute the module function
30
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
+ /******/
32
+ /******/ // Flag the module as loaded
33
+ /******/ module.l = true;
34
+ /******/
35
+ /******/ // Return the exports of the module
36
+ /******/ return module.exports;
37
+ /******/ }
38
+ /******/
39
+ /******/
40
+ /******/ // expose the modules object (__webpack_modules__)
41
+ /******/ __webpack_require__.m = modules;
42
+ /******/
43
+ /******/ // expose the module cache
44
+ /******/ __webpack_require__.c = installedModules;
45
+ /******/
46
+ /******/ // define getter function for harmony exports
47
+ /******/ __webpack_require__.d = function(exports, name, getter) {
48
+ /******/ if(!__webpack_require__.o(exports, name)) {
49
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50
+ /******/ }
51
+ /******/ };
52
+ /******/
53
+ /******/ // define __esModule on exports
54
+ /******/ __webpack_require__.r = function(exports) {
55
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
+ /******/ }
58
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
+ /******/ };
60
+ /******/
61
+ /******/ // create a fake namespace object
62
+ /******/ // mode & 1: value is a module id, require it
63
+ /******/ // mode & 2: merge all properties of value into the ns
64
+ /******/ // mode & 4: return value when already ns object
65
+ /******/ // mode & 8|1: behave like require
66
+ /******/ __webpack_require__.t = function(value, mode) {
67
+ /******/ if(mode & 1) value = __webpack_require__(value);
68
+ /******/ if(mode & 8) return value;
69
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
+ /******/ var ns = Object.create(null);
71
+ /******/ __webpack_require__.r(ns);
72
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
+ /******/ return ns;
75
+ /******/ };
76
+ /******/
77
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
78
+ /******/ __webpack_require__.n = function(module) {
79
+ /******/ var getter = module && module.__esModule ?
80
+ /******/ function getDefault() { return module['default']; } :
81
+ /******/ function getModuleExports() { return module; };
82
+ /******/ __webpack_require__.d(getter, 'a', getter);
83
+ /******/ return getter;
84
+ /******/ };
85
+ /******/
86
+ /******/ // Object.prototype.hasOwnProperty.call
87
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88
+ /******/
89
+ /******/ // __webpack_public_path__
90
+ /******/ __webpack_require__.p = "";
91
+ /******/
92
+ /******/
93
+ /******/ // Load entry module and return exports
94
+ /******/ return __webpack_require__(__webpack_require__.s = "fae3");
95
+ /******/ })
96
+ /************************************************************************/
97
+ /******/ ({
98
+
99
+ /***/ "022d":
100
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
101
+
102
+ "use strict";
103
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TraditionalControls_vue_vue_type_style_index_0_id_b034523c_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("21c9");
104
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TraditionalControls_vue_vue_type_style_index_0_id_b034523c_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TraditionalControls_vue_vue_type_style_index_0_id_b034523c_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
105
+ /* unused harmony reexport * */
106
+
107
+
108
+ /***/ }),
109
+
110
+ /***/ "02ac":
111
+ /***/ (function(module, exports) {
112
+
113
+ module.exports = require("core-js/modules/es.symbol.iterator");
114
+
115
+ /***/ }),
116
+
117
+ /***/ "0607":
118
+ /***/ (function(module, exports) {
119
+
120
+ module.exports = require("element-ui/lib/checkbox-group");
121
+
122
+ /***/ }),
123
+
124
+ /***/ "0cf4":
125
+ /***/ (function(module, exports) {
126
+
127
+ module.exports = require("element-ui/lib/theme-chalk/checkbox-group.css");
128
+
129
+ /***/ }),
130
+
131
+ /***/ "0de2":
132
+ /***/ (function(module, exports) {
133
+
134
+ module.exports = require("element-ui/lib/select");
135
+
136
+ /***/ }),
137
+
138
+ /***/ "0fe2":
139
+ /***/ (function(module, exports) {
140
+
141
+ module.exports = require("element-ui/lib/theme-chalk/select.css");
142
+
143
+ /***/ }),
144
+
145
+ /***/ "10c9":
146
+ /***/ (function(module, exports) {
147
+
148
+ /**
149
+ * @author alteredq / http://alteredqualia.com/
150
+ * @author mr.doob / http://mrdoob.com/
151
+ */
152
+
153
+ exports.WEBGL = {
154
+
155
+ isWebGLAvailable: function () {
156
+
157
+ try {
158
+
159
+ var canvas = document.createElement( 'canvas' );
160
+ return !! ( window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ) );
161
+
162
+ } catch ( e ) {
163
+
164
+ return false;
165
+
166
+ }
167
+
168
+ },
169
+
170
+ isWebGL2Available: function () {
171
+
172
+ try {
173
+
174
+ var canvas = document.createElement( 'canvas' );
175
+ return !! ( window.WebGL2RenderingContext && canvas.getContext( 'webgl2' ) );
176
+
177
+ } catch ( e ) {
178
+
179
+ return false;
180
+
181
+ }
182
+
183
+ },
184
+
185
+ getWebGLErrorMessage: function () {
186
+
187
+ return this.getErrorMessage( 1 );
188
+
189
+ },
190
+
191
+ getWebGL2ErrorMessage: function () {
192
+
193
+ return this.getErrorMessage( 2 );
194
+
195
+ },
196
+
197
+ getErrorMessage: function ( version ) {
198
+
199
+ var names = {
200
+ 1: 'WebGL',
201
+ 2: 'WebGL 2'
202
+ };
203
+
204
+ var contexts = {
205
+ 1: window.WebGLRenderingContext,
206
+ 2: window.WebGL2RenderingContext
207
+ };
208
+
209
+ var message = 'This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.';
210
+
211
+ var element = document.createElement( 'div' );
212
+ element.id = 'webglmessage';
213
+ element.style.fontFamily = 'monospace';
214
+ element.style.fontSize = '20px';
215
+ element.style.fontWeight = 'normal';
216
+ element.style.textAlign = 'center';
217
+ element.style.background = '#fff';
218
+ element.style.color = '#000';
219
+ element.style.padding = '1.5em';
220
+ element.style.width = '400px';
221
+ element.style.margin = '5em auto 0';
222
+
223
+ if ( contexts[ version ] ) {
224
+
225
+ message = message.replace( '$0', 'graphics card' );
226
+
227
+ } else {
228
+
229
+ message = message.replace( '$0', 'browser' );
230
+
231
+ }
232
+
233
+ message = message.replace( '$1', names[ version ] );
234
+
235
+ element.innerHTML = message;
236
+
237
+ return element;
238
+
239
+ }
240
+
241
+ };
242
+
243
+
244
+ /***/ }),
245
+
246
+ /***/ "139f":
247
+ /***/ (function(module, exports) {
248
+
249
+ module.exports = require("core-js/modules/es.array.for-each");
250
+
251
+ /***/ }),
252
+
253
+ /***/ "1823":
254
+ /***/ (function(module, exports) {
255
+
256
+ module.exports = "precision highp float;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec3 position_1;\nattribute vec3 position_2;\nattribute vec2 uv_1;\nattribute vec2 uv_2;\n\nuniform float time;\nuniform float slide_pos;\nvarying vec2 vUv;\n\nvoid main() {\n\tvUv = uv;\n\t\n\tvec3 transformed_xi1 = position * vec3(1.0 - time) + position_1 * vec3(time);\n\t\n\tvec3 xi0_time_1 = vec3(position_1.x, position_1.y, 0.0);\n\tvec3 transformed_xi0 = position_2 * vec3(1.0 - time) + xi0_time_1 * vec3(time);\n\n\tvec3 transformed = vec3(transformed_xi0) * vec3(1.0 - slide_pos) + vec3(transformed_xi1) * vec3(slide_pos);\n\t\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\n}\n"
257
+
258
+ /***/ }),
259
+
260
+ /***/ "18d2":
261
+ /***/ (function(module, exports) {
262
+
263
+ module.exports = require("core-js/modules/es.array.concat");
264
+
265
+ /***/ }),
266
+
267
+ /***/ "1ac9":
268
+ /***/ (function(module, exports) {
269
+
270
+ module.exports = require("element-ui/lib/container");
271
+
272
+ /***/ }),
273
+
274
+ /***/ "1ce0":
275
+ /***/ (function(module, exports) {
276
+
277
+ module.exports = require("core-js/modules/web.dom-collections.iterator");
278
+
279
+ /***/ }),
280
+
281
+ /***/ "1fe8":
282
+ /***/ (function(module, exports) {
283
+
284
+ module.exports = require("element-ui/lib/main");
285
+
286
+ /***/ }),
287
+
288
+ /***/ "2175":
289
+ /***/ (function(module, exports) {
290
+
291
+ module.exports = require("core-js/modules/es.object.keys");
292
+
293
+ /***/ }),
294
+
295
+ /***/ "21a1":
296
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
297
+
298
+ "use strict";
299
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_OpacityControls_vue_vue_type_style_index_0_id_4c00a30f_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("5810");
300
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_OpacityControls_vue_vue_type_style_index_0_id_4c00a30f_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_OpacityControls_vue_vue_type_style_index_0_id_4c00a30f_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
301
+ /* unused harmony reexport * */
302
+
303
+
304
+ /***/ }),
305
+
306
+ /***/ "21c9":
307
+ /***/ (function(module, exports, __webpack_require__) {
308
+
309
+ // extracted by mini-css-extract-plugin
310
+
311
+ /***/ }),
312
+
313
+ /***/ "2a6f":
314
+ /***/ (function(module, exports) {
315
+
316
+ module.exports = require("core-js/modules/web.url");
317
+
318
+ /***/ }),
319
+
320
+ /***/ "2c1b":
321
+ /***/ (function(module, exports) {
322
+
323
+ module.exports = require("element-ui/lib/theme-chalk/loading.css");
324
+
325
+ /***/ }),
326
+
327
+ /***/ "2de2":
328
+ /***/ (function(module, exports) {
329
+
330
+ module.exports = require("element-ui/lib/header");
331
+
332
+ /***/ }),
333
+
334
+ /***/ "3170":
335
+ /***/ (function(module, exports) {
336
+
337
+ module.exports = require("element-ui/lib/theme-chalk/tabs.css");
338
+
339
+ /***/ }),
340
+
341
+ /***/ "319f":
342
+ /***/ (function(module, exports) {
343
+
344
+ module.exports = require("core-js/modules/es.number.to-fixed");
345
+
346
+ /***/ }),
347
+
348
+ /***/ "31fb":
349
+ /***/ (function(module, exports) {
350
+
351
+ module.exports = require("element-ui/lib/tab-pane");
352
+
353
+ /***/ }),
354
+
355
+ /***/ "3666":
356
+ /***/ (function(module, exports) {
357
+
358
+ module.exports = require("element-ui/lib/theme-chalk/color-picker.css");
359
+
360
+ /***/ }),
361
+
362
+ /***/ "373b":
363
+ /***/ (function(module, exports) {
364
+
365
+ module.exports = require("element-ui/lib/drawer");
366
+
367
+ /***/ }),
368
+
369
+ /***/ "3966":
370
+ /***/ (function(module, exports, __webpack_require__) {
371
+
372
+ var MODULE_CHANGE = { ALL: 0, DESTROYED: 1, NAME_CHANGED: 2, SETTINGS_CHANGED: 3 };
373
+
374
+ var BaseModule = function() {
375
+ this.typeName = "Base Module";
376
+ this.instanceName = "default";
377
+ this.onChangedCallbacks = [];
378
+ this.messageFunction = undefined;
379
+ /** Notifier handle for informing other modules of any changes **/
380
+ this.eventNotifiers = [];
381
+ this.broadcastChannels = {};
382
+ }
383
+
384
+ BaseModule.prototype.setName = function(name) {
385
+ if (name && this.instanceName !== name) {
386
+ this.instanceName = name;
387
+ var callbackArray = this.onChangedCallbacks.slice();
388
+ for (var i = 0; i < callbackArray.length; i++) {
389
+ callbackArray[i]( this, MODULE_CHANGE.NAME_CHANGED );
390
+ }
391
+ }
392
+ }
393
+
394
+ BaseModule.prototype.addBroadcastChannels = function(ChannelName) {
395
+ if (ChannelName in this.broadcastChannels)
396
+ return false;
397
+ var newChannel = new (__webpack_require__("c45a")).default(ChannelName);
398
+ this.broadcastChannels[ChannelName] = newChannel;
399
+ return true;
400
+ }
401
+
402
+ BaseModule.prototype.removeBroadcastChannels = function(ChannelName) {
403
+ if (ChannelName in this.broadcastChannels) {
404
+ this.broadcastChannels[ChannelName].close();
405
+ delete broadcastChannels[ChannelName];
406
+ }
407
+
408
+ }
409
+
410
+ BaseModule.prototype.settingsChanged = function() {
411
+ var callbackArray = this.onChangedCallbacks.slice();
412
+ for (var i = 0; i < callbackArray.length; i++) {
413
+ callbackArray[i]( this, MODULE_CHANGE.SETTINGS_CHANGED );
414
+ }
415
+ }
416
+
417
+ BaseModule.prototype.exportSettings = function() {
418
+ var settings = {};
419
+ settings.dialog = this.typeName;
420
+ settings.name = this.instanceName;
421
+ return settings;
422
+ }
423
+
424
+ BaseModule.prototype.importSettings = function(settings) {
425
+ if (settings.dialog == this.typeName) {
426
+ this.setName(settings.name);
427
+ return true;
428
+ }
429
+ return false;
430
+ }
431
+
432
+ BaseModule.prototype.publishChanges = function(annotations, eventType) {
433
+ for (var i = 0; i < this.eventNotifiers.length; i++) {
434
+ this.eventNotifiers[i].publish(this, eventType, annotations);
435
+ }
436
+ if (eventType === __webpack_require__("549c").EVENT_TYPE.SELECTED) {
437
+ if (annotations && annotations[0]) {
438
+ var annotation = annotations[0];
439
+ var data = {action: "query-data", resource: annotation.data.id, data: annotation.data, sender: this.instanceName};
440
+ for (var key in this.broadcastChannels) {
441
+ this.broadcastChannels[key].postMessage(data);
442
+ }
443
+ }
444
+ }
445
+ }
446
+
447
+ BaseModule.prototype.setMessageFunction = function(functionIn) {
448
+ this.messageFunction = functionIn;
449
+ }
450
+
451
+ BaseModule.prototype.displayMessage = function(message) {
452
+ if (this.messageFunction)
453
+ this.messageFunction(message);
454
+ }
455
+
456
+ BaseModule.prototype.getName = function() {
457
+ return this.instanceName;
458
+ }
459
+
460
+ BaseModule.prototype.destroy = function() {
461
+ //Make a temorary copy as the array may be altered during the loop
462
+ var callbackArray = this.onChangedCallbacks.slice();
463
+ for (var i = 0; i < callbackArray.length; i++) {
464
+ callbackArray[i]( this, MODULE_CHANGE.DESTROYED );
465
+ }
466
+
467
+ delete this;
468
+ }
469
+
470
+ BaseModule.prototype.addChangedCallback = function(callback) {
471
+ if (this.onChangedCallbacks.includes(callback) == false)
472
+ this.onChangedCallbacks.push(callback);
473
+ }
474
+
475
+ BaseModule.prototype.removeChangedCallback = function(callback) {
476
+ var index = this.onChangedCallbacks.indexOf(callback);
477
+ if (index > -1) {
478
+ this.onChangedCallbacks.splice(index, 1);
479
+ }
480
+ }
481
+
482
+ BaseModule.prototype.addNotifier = function(eventNotifier) {
483
+ this.eventNotifiers.push(eventNotifier);
484
+ }
485
+
486
+ exports.BaseModule = BaseModule;
487
+ exports.MODULE_CHANGE = MODULE_CHANGE;
488
+
489
+
490
+ /***/ }),
491
+
492
+ /***/ "429c":
493
+ /***/ (function(module, exports) {
494
+
495
+ module.exports = require("@abi-software/svg-sprite");
496
+
497
+ /***/ }),
498
+
499
+ /***/ "4914":
500
+ /***/ (function(module, exports) {
501
+
502
+ module.exports = require("element-ui/lib/color-picker");
503
+
504
+ /***/ }),
505
+
506
+ /***/ "4c89":
507
+ /***/ (function(module, exports) {
508
+
509
+ module.exports = require("element-ui/lib/theme-chalk/drawer.css");
510
+
511
+ /***/ }),
512
+
513
+ /***/ "4e2d":
514
+ /***/ (function(module, exports) {
515
+
516
+ module.exports = require("lodash/uniq");
517
+
518
+ /***/ }),
519
+
520
+ /***/ "4e8a":
521
+ /***/ (function(module, exports) {
522
+
523
+ module.exports = "precision highp float;\nuniform sampler2D myTex;\nvarying vec2 vUv;\n\nvoid main() {\n\tgl_FragColor = texture2D( myTex, vUv );\n\n}\n"
524
+
525
+ /***/ }),
526
+
527
+ /***/ "51c7":
528
+ /***/ (function(module, exports) {
529
+
530
+ module.exports = require("element-ui/lib/theme-chalk/header.css");
531
+
532
+ /***/ }),
533
+
534
+ /***/ "51e9":
535
+ /***/ (function(module, exports) {
536
+
537
+ module.exports = require("core-js/modules/es.symbol.description");
538
+
539
+ /***/ }),
540
+
541
+ /***/ "51f7":
542
+ /***/ (function(module, exports) {
543
+
544
+ module.exports = require("core-js/modules/es.regexp.exec");
545
+
546
+ /***/ }),
547
+
548
+ /***/ "549c":
549
+ /***/ (function(module, exports) {
550
+
551
+ var EVENT_TYPE = { ALL: 0, SELECTED: 1, HIGHLIGHTED: 2 };
552
+
553
+ var SelectionEvent = function(eventTypeIn, identifiersIn) {
554
+ this.eventType = eventTypeIn;
555
+ this.identifiers = identifiersIn;
556
+ }
557
+
558
+ var returnFullID = function(sourceId) {
559
+ //return full annotations with all different name
560
+ }
561
+
562
+ var Subscription = function(subscriberIn, callbackIn, eventType) {
563
+ this.targetedID = [];
564
+ var subscriber = subscriberIn;
565
+ if (eventType === undefined)
566
+ this.targetEventType = EVENT_TYPE.ALL;
567
+ else
568
+ this.targetEventType = eventType;
569
+ var callback = callbackIn;
570
+
571
+ var _this = this;
572
+
573
+ this.getEventType = function() {
574
+ return eventType;
575
+ }
576
+
577
+ this.notify = function(source, eventType, ids) {
578
+ if (source !== subscriber && (_this.targetEventType === EVENT_TYPE.ALL ||
579
+ _this.targetEventType === eventType)) {
580
+ //should support different type of id e.g lyph, name, fmas...
581
+ //need a function that finds all relavant ids
582
+ var event = new SelectionEvent(eventType, ids);
583
+ callback(event);
584
+ }
585
+ }
586
+ }
587
+
588
+ exports.EventNotifier = function() {
589
+ var events = [];
590
+ var subscriptions = [];
591
+ var _this = this;
592
+
593
+ this.publish = function(source, eventType, id) {
594
+ for (var i = 0; i < subscriptions.length;i++) {
595
+ subscriptions[i].notify(source, eventType, id);
596
+ }
597
+ }
598
+
599
+ this.subscribe = function(subscriber, callbackFunction, eventType) {
600
+ if (typeof callbackFunction === "function") {
601
+ var subscription = new Subscription(subscriber, callbackFunction, eventType);
602
+ subscriptions.push(subscription);
603
+ return subscription;
604
+ }
605
+ return undefined;
606
+ }
607
+
608
+ this.unsubscribe = function(subscription) {
609
+ for (var i = 0; i < subscriptions.length;i++) {
610
+ if (subscription === subscriptions[i]) {
611
+ subscriptions.splice(i, 1);
612
+ return;
613
+ }
614
+ }
615
+ }
616
+ }
617
+
618
+ exports.EVENT_TYPE = EVENT_TYPE;
619
+
620
+
621
+ /***/ }),
622
+
623
+ /***/ "55ee":
624
+ /***/ (function(module, exports) {
625
+
626
+ module.exports = require("element-ui/lib/theme-chalk/checkbox.css");
627
+
628
+ /***/ }),
629
+
630
+ /***/ "5810":
631
+ /***/ (function(module, exports, __webpack_require__) {
632
+
633
+ // extracted by mini-css-extract-plugin
634
+
635
+ /***/ }),
636
+
637
+ /***/ "5fef":
638
+ /***/ (function(module, exports) {
639
+
640
+ module.exports = require("core-js/modules/es.regexp.to-string");
641
+
642
+ /***/ }),
643
+
644
+ /***/ "6049":
645
+ /***/ (function(module, exports) {
646
+
647
+ module.exports = require("core-js/modules/es.symbol");
648
+
649
+ /***/ }),
650
+
651
+ /***/ "642d":
652
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
653
+
654
+ "use strict";
655
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ScaffoldVuer_vue_vue_type_style_index_1_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7d9b");
656
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ScaffoldVuer_vue_vue_type_style_index_1_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ScaffoldVuer_vue_vue_type_style_index_1_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
657
+ /* unused harmony reexport * */
658
+
659
+
660
+ /***/ }),
661
+
662
+ /***/ "6579":
663
+ /***/ (function(module, exports) {
664
+
665
+ module.exports = require("core-js/modules/es.array.slice");
666
+
667
+ /***/ }),
668
+
669
+ /***/ "67b6":
670
+ /***/ (function(module, exports, __webpack_require__) {
671
+
672
+ var THREE = __webpack_require__("9206").THREE;
673
+ // Current model's associate data, data fields, external link, nerve map
674
+ // informations,
675
+ // these are proived in the organsFileMap array.
676
+ var OrgansSceneData = function() {
677
+ this.currentName = "";
678
+ this.currentSystem = "";
679
+ this.currentPart = "";
680
+ this.currentSpecies = "";
681
+ this.metaURL = "";
682
+ this.viewURL = "";
683
+ this.geometries = [];
684
+ this.lines = [];
685
+ this.glyphsets = [];
686
+ this.pointsets = [];
687
+ this.currentTime = 0.0;
688
+ this.timeVarying = false;
689
+ // Current model's associate data, data fields, external link, nerve map
690
+ // informations,
691
+ this.nerveMap = undefined;
692
+ this.nerveMapIsActive = false;
693
+ }
694
+
695
+ /**
696
+ * Viewer of 3D-organs models. Users can toggle on/off different views. Data is
697
+ * displayed instead if models are not available.
698
+ *
699
+ * @class
700
+ * @param {PJP.ModelsLoader}
701
+ * ModelsLoaderIn - defined in modelsLoade.js, providing locations of
702
+ * files.
703
+ * @param {String}
704
+ * PanelName - Id of the target element to create the
705
+ * {@link PJP.OrgansViewer} on.
706
+ * @author Alan Wu
707
+ * @returns {PJP.OrgansViewer}
708
+ */
709
+ var OrgansViewer = function(ModelsLoaderIn) {
710
+ (__webpack_require__("7a89").RendererModule).call(this);
711
+ var pickerScene = undefined;
712
+ var nerveMapScene = undefined;
713
+ this.sceneData = new OrgansSceneData();
714
+ var timeChangedCallbacks = new Array();
715
+ var sceneChangedCallbacks = new Array();
716
+ var organPartAddedCallbacks = new Array();
717
+ var finishDownloadCallback = undefined;
718
+ var layoutUpdateRequiredCallbacks = new Array();
719
+ var modelsLoader = ModelsLoaderIn;
720
+ var _this = this;
721
+ _this.typeName = "Organ Viewer";
722
+
723
+ this.getSceneData = function() {
724
+ return _this.sceneData;
725
+ }
726
+
727
+ /**
728
+ * Used to update internal timer in scene when time slider has changed.
729
+ */
730
+ this.updateTime = function(value) {
731
+ let duration = 6000;
732
+ if (_this.scene)
733
+ duration = _this.scene.getDuration();
734
+ var actualTime = value / 100.0 * duration;
735
+ if (!_this.sceneData.nerveMapIsActive) {
736
+ if (pickerScene)
737
+ pickerScene.setMorphsTime(actualTime);
738
+ if (_this.scene)
739
+ _this.scene.setMorphsTime(actualTime);
740
+ } else if (nerveMapScene) {
741
+ nerveMapScene.setMorphsTime(actualTime);
742
+ if (_this.sceneData.nerveMap && _this.sceneData.nerveMap.additionalReader)
743
+ _this.sceneData.nerveMap.additionalReader.setTime(value / 100.0);
744
+ }
745
+ _this.sceneData.currentTime = value;
746
+ }
747
+
748
+ /**
749
+ * Update the time slider and other renderers/scenes when time has changed.
750
+ */
751
+ var preRenderTimeUpdate = function() {
752
+ let duration = 3000;
753
+ if (_this.scene)
754
+ duration = _this.scene.getDuration();
755
+ var currentTime = _this.zincRenderer.getCurrentTime();
756
+ for (var i = 0; i < timeChangedCallbacks.length;i++) {
757
+ timeChangedCallbacks[i](currentTime);
758
+ }
759
+ if (!_this.sceneData.nerveMapIsActive && pickerScene)
760
+ pickerScene.setMorphsTime(currentTime);
761
+ if (_this.sceneData.nerveMap && _this.sceneData.nerveMap.additionalReader)
762
+ _this.sceneData.nerveMap.additionalReader.setTime(currentTime /
763
+ duration);
764
+ _this.sceneData.currentTime = currentTime / duration * 100.0;
765
+ }
766
+
767
+ var postRenderSelectedCoordinatesUpdate = function() {
768
+ if (_this.selectedCenter) {
769
+ const vector = new THREE.Vector3();
770
+ vector.copy(_this.selectedCenter);
771
+ var coord = _this.scene.vectorToScreenXY(vector);
772
+ _this.selectedScreenCoordinates.x = coord.x;
773
+ _this.selectedScreenCoordinates.y = coord.y;
774
+ }
775
+ }
776
+
777
+ var preRenderUpdateCallback = function() {
778
+ return function() {
779
+ preRenderTimeUpdate();
780
+ }
781
+ }
782
+
783
+ var postRenderUpdateCallback = function() {
784
+ return function() {
785
+ postRenderSelectedCoordinatesUpdate();
786
+ }
787
+ }
788
+
789
+ /**
790
+ * Add a callback which will be called when time has changed
791
+ */
792
+ this.addTimeChangedCallback = function(callback) {
793
+ if (typeof(callback === "function"))
794
+ timeChangedCallbacks.push(callback);
795
+ }
796
+
797
+ this.setTexturePos = function(value) {
798
+ if (_this.sceneData.nerveMap && _this.sceneData.nerveMap.additionalReader)
799
+ _this.sceneData.nerveMap.additionalReader.setSliderPos(value);
800
+ }
801
+
802
+ this.addLayoutUpdateRequiredCallback = function(callback) {
803
+ if (typeof(callback === "function")) {
804
+ layoutUpdateRequiredCallbacks.push(callback);
805
+ }
806
+ }
807
+
808
+ this.addSceneChangedCallback = function(callback) {
809
+ if (typeof(callback === "function")) {
810
+ sceneChangedCallbacks.push(callback);
811
+ }
812
+ }
813
+
814
+ this.addOrganPartAddedCallback = function(callback) {
815
+ if (typeof(callback === "function"))
816
+ organPartAddedCallbacks.push(callback);
817
+ }
818
+
819
+ this.setFinishDownloadCallback = function(callback) {
820
+ if (typeof(callback === "function"))
821
+ finishDownloadCallback = callback;
822
+ }
823
+
824
+ this.unsetFinishDownloadCallback = function() {
825
+ finishDownloadCallback = undefined;
826
+ }
827
+
828
+ this.getNamedObjectsToScreenCoordinates = function(name, camera) {
829
+ var vector = new THREE.Vector3();
830
+ vector.setFromMatrixPosition( obj.matrixWorld );
831
+ var widthHalf = (width/2);
832
+ var heightHalf = (height/2);
833
+ vector.project(camera);
834
+ vector.x = ( vector.x * widthHalf ) + widthHalf;
835
+ vector.y = - ( vector.y * heightHalf ) + heightHalf;
836
+ return vector;
837
+ }
838
+
839
+ var getIdObjectFromIntersect = function(intersected) {
840
+ var id = undefined;
841
+ var intersectedObject = undefined;
842
+ if (intersected !== undefined) {
843
+ if (intersected.object.userData &&
844
+ intersected.object.userData.isMarker) {
845
+ intersectedObject = intersected.object.userData.parent.morph;
846
+ } else {
847
+ intersectedObject = intersected.object;
848
+ }
849
+ if (intersectedObject) {
850
+ if (intersectedObject.name) {
851
+ id = intersectedObject.name;
852
+ } else {
853
+ var annotations = _this.getAnnotationsFromObjects(
854
+ [intersectedObject]);
855
+ if (annotations && annotations[0]) {
856
+ id = annotations[0].data.group;
857
+ }
858
+ }
859
+ }
860
+ }
861
+ return {"id":id, "object":intersectedObject};
862
+ }
863
+
864
+ /**
865
+ * Callback function when a pickable object has been picked. It will then
866
+ * call functions in tissueViewer and cellPanel to show corresponding
867
+ * informations.
868
+ *
869
+ * @callback
870
+ */
871
+ var _pickingCallback = function() {
872
+ return function(intersects, window_x, window_y) {
873
+ var intersected = _this.getIntersectedObject(intersects);
874
+ var idObject = getIdObjectFromIntersect(intersected);
875
+ if (idObject.id) {
876
+ if (_this.toolTip !== undefined) {
877
+ _this.toolTip.setText(idObject.id);
878
+ _this.toolTip.show(window_x, window_y);
879
+ }
880
+ _this.displayMessage(idObject.object.name + " selected.");
881
+
882
+ if (idObject.object.userData.isGlyph) {
883
+ if (idObject.object.name)
884
+ _this.setSelectedByObjects([idObject.object], true);
885
+ else
886
+ _this.setSelectedByZincObject(idObject.object.userData.getGlyphset(), true);
887
+ } else {
888
+ _this.setSelectedByObjects([idObject.object], true);
889
+ }
890
+ return;
891
+ } else {
892
+ if (_this.toolTip !== undefined) {
893
+ _this.toolTip.hide();
894
+ }
895
+ _this.setSelectedByObjects([], true);
896
+ }
897
+ }
898
+ };
899
+
900
+ /**
901
+ * Callback function when a pickable object has been hovered over. It will
902
+ * show objecty id/name as _this.toolTip text.
903
+ *
904
+ * @callback
905
+ */
906
+ var _hoverCallback = function() {
907
+ return function(intersects, window_x, window_y) {
908
+ var intersected = _this.getIntersectedObject(intersects);
909
+ var idObject = getIdObjectFromIntersect(intersected);
910
+ if (idObject.id) {
911
+ _this.displayArea.style.cursor = "pointer";
912
+ if (_this.toolTip !== undefined) {
913
+ _this.toolTip.setText(idObject.id);
914
+ _this.toolTip.show(window_x, window_y);
915
+ }
916
+ _this.setHighlightedByObjects([idObject.object], true);
917
+ return;
918
+ }
919
+ else {
920
+ if (_this.toolTip !== undefined) {
921
+ _this.toolTip.hide();
922
+ }
923
+ _this.displayArea.style.cursor = "auto";
924
+ _this.setHighlightedByObjects([], true);
925
+ }
926
+ }
927
+ };
928
+
929
+ var changeOrganPartsVisibilityForScene = function(scene, name, value, type) {
930
+ if (type == "all" || type == "geometries") {
931
+ var geometries = scene.findGeometriesWithGroupName(name);
932
+ for (var i = 0; i < geometries.length; i ++ ) {
933
+ geometries[i].setVisibility(value);
934
+ }
935
+ }
936
+ if (type == "all" || type == "glyphsets") {
937
+ var glyphsets = scene.findGlyphsetsWithGroupName(name);
938
+ for (var i = 0; i < glyphsets.length; i ++ ) {
939
+ glyphsets[i].setVisibility(value);
940
+ }
941
+ }
942
+ if (type == "all" || type == "pointsets") {
943
+ var pointsets = scene.findPointsetsWithGroupName(name);
944
+ for (var i = 0; i < pointsets.length; i ++ ) {
945
+ pointsets[i].setVisibility(value);
946
+ }
947
+ }
948
+ if (type == "all" || type == "lines") {
949
+ var lines = scene.findLinesWithGroupName(name);
950
+ for (var i = 0; i < lines.length; i ++ ) {
951
+ lines[i].setVisibility(value);
952
+ }
953
+ }
954
+ }
955
+
956
+ /**
957
+ * Change visibility for parts of the current scene.
958
+ */
959
+ this.changeGeometriesVisibility = function(name, value) {
960
+ changeOrganPartsVisibilityForScene(_this.scene, name, value, 'geometries');
961
+ if (pickerScene)
962
+ changeOrganPartsVisibilityForScene(pickerScene, name, value, 'geometries');
963
+ }
964
+
965
+ /**
966
+ * Change visibility for parts of the current scene.
967
+ */
968
+ this.changeGlyphsetsVisibility = function(name, value) {
969
+ changeOrganPartsVisibilityForScene(_this.scene, name, value, 'glyphsets');
970
+ if (pickerScene)
971
+ changeOrganPartsVisibilityForScene(pickerScene, name, value, 'glyphsets');
972
+ }
973
+
974
+ /**
975
+ * Change visibility for parts of the current scene.
976
+ */
977
+ this.changeLinesVisibility = function(name, value) {
978
+ changeOrganPartsVisibilityForScene(_this.scene, name, value, 'lines');
979
+ if (pickerScene)
980
+ changeOrganPartsVisibilityForScene(pickerScene, name, value, 'lines');
981
+ }
982
+
983
+ /**
984
+ * Change visibility for parts of the current scene.
985
+ */
986
+ this.changePointsetsVisibility = function(name, value) {
987
+ changeOrganPartsVisibilityForScene(_this.scene, name, value, 'pointsets');
988
+ if (pickerScene)
989
+ changeOrganPartsVisibilityForScene(pickerScene, name, value, 'pointsets');
990
+ }
991
+
992
+ /**
993
+ * Change visibility for parts of the current scene.
994
+ */
995
+ this.changeOrganPartsVisibility = function(name, value, typeIn) {
996
+ var type = "all";
997
+ if (typeIn !== undefined)
998
+ type = typeIn;
999
+ changeOrganPartsVisibilityForScene(_this.scene, name, value, type);
1000
+ if (pickerScene)
1001
+ changeOrganPartsVisibilityForScene(pickerScene, name, value, type);
1002
+ }
1003
+
1004
+ this.changeOrganPartsVisibilityCallback = function(name) {
1005
+ return function(value) {
1006
+ _this.changeOrganPartsVisibility(name, value);
1007
+ }
1008
+ }
1009
+
1010
+ /**
1011
+ * Change some of the ZincGeometry property for never map geometry
1012
+ *
1013
+ * @callback
1014
+ */
1015
+ var _addNerveMapGeometryCallback = function(GroupName) {
1016
+ return function(geometry) {
1017
+ geometry.groupName = GroupName;
1018
+ if (imageCombiner && geometry.morph && geometry.morph.material.map) {
1019
+ geometry.morph.material.map = new THREE.Texture(imageCombiner.getCombinedImage());
1020
+ geometry.morph.material.map.needsUpdate = true;
1021
+ geometry.morph.material.needsUpdate = true;
1022
+ }
1023
+ }
1024
+ }
1025
+
1026
+ /**
1027
+ * Read in the nerve map models onto the primary renderer when nerve map has
1028
+ * been toggled on.
1029
+ */
1030
+ var setupNerveMapPrimaryRenderer = function() {
1031
+ var sceneName = _this.sceneData.currentName + "_nervemap";
1032
+ nerveMapScene = _this.zincRenderer.getSceneByName(sceneName);
1033
+ if (nerveMapScene == undefined) {
1034
+ var downloadPath = modelsLoader.getOrgansDirectoryPrefix() + "/" + _this.sceneData.nerveMap.threed.meta;
1035
+ nerveMapScene = _this.zincRenderer.createScene(sceneName);
1036
+ nerveMapScene.loadMetadataURL(downloadPath, _addNerveMapGeometryCallback("threed"));
1037
+ if (_this.sceneData.nerveMap.threed.view !== undefined)
1038
+ nerveMapScene.loadViewURL(modelsLoader.getOrgansDirectoryPrefix() + "/" + _this.sceneData.nerveMap.threed.view);
1039
+ else {
1040
+ nerveMapScene.loadViewURL(modelsLoader.getBodyDirectoryPrefix() + "/body_view.json");
1041
+ }
1042
+ nerveMapScene.ambient.intensity = 8.0;
1043
+ nerveMapScene.directionalLight.intensity = 0;
1044
+ var zincCameraControl = nerveMapScene.getZincCameraControls();
1045
+ zincCameraControl.setMouseButtonAction("AUXILIARY", "ZOOM");
1046
+ zincCameraControl.setMouseButtonAction("SECONDARY", "PAN");
1047
+ _this.sceneData.nerveMap.additionalReader = new (__webpack_require__("6fd2").VaryingTexCoordsReader)(nerveMapScene);
1048
+ var urlsArray = [ modelsLoader.getOrgansDirectoryPrefix() + "/digestive/stomach/nerve_map/3d/xi1_time_0.json",
1049
+ modelsLoader.getOrgansDirectoryPrefix() + "/digestive/stomach/nerve_map/3d/xi1_time_1.json",
1050
+ modelsLoader.getOrgansDirectoryPrefix() + "/digestive/stomach/nerve_map/3d/xi0_time_0.json"];
1051
+ _this.sceneData.nerveMap.additionalReader.loadURLsIntoBufferGeometry(urlsArray);
1052
+ }
1053
+ _this.zincRenderer.setCurrentScene(nerveMapScene);
1054
+ _this.graphicsHighlight.reset();
1055
+ }
1056
+
1057
+ var activateAdditionalNerveMapRenderer = function() {
1058
+ for (var i = 0; i < layoutUpdateRequiredCallbacks.length;i++) {
1059
+ layoutUpdateRequiredCallbacks[i](false, true);
1060
+ }
1061
+ }
1062
+
1063
+ /**
1064
+ * Nerve map has been toggled on/off, change organs renderer layput.
1065
+ */
1066
+ this.changeNerveMapVisibility = function() {
1067
+ _this.sceneData.nerveMapIsActive = !_this.sceneData.nerveMapIsActive;
1068
+ if (_this.sceneData.nerveMapIsActive)
1069
+ setupNerveMapPrimaryRenderer();
1070
+ else {
1071
+ _this.zincRenderer.setCurrentScene(_this.scene);
1072
+ _this.graphicsHighlight.reset();
1073
+ }
1074
+ activateAdditionalNerveMapRenderer();
1075
+ }
1076
+
1077
+ this.changeBackgroundColour = function(backgroundColourString) {
1078
+ var colour = new THREE.Color(backgroundColourString);
1079
+ if (_this.zincRenderer) {
1080
+ var internalRenderer = _this.zincRenderer.getThreeJSRenderer();
1081
+ internalRenderer.setClearColor( colour, 1 );
1082
+ }
1083
+ }
1084
+
1085
+ var addOrganPartToSceneData = function(zincObject) {
1086
+ if (zincObject.groupName) {
1087
+ if (zincObject.isGeometry) {
1088
+ if (!_this.sceneData.geometries.includes(zincObject.groupName)) {
1089
+ _this.sceneData.geometries.push(zincObject.groupName);
1090
+ }
1091
+ } else if (zincObject.isGlyphset) {
1092
+ if (!_this.sceneData.glyphsets.includes(zincObject.groupName)) {
1093
+ _this.sceneData.glyphsets.push(zincObject.groupName);
1094
+ }
1095
+ } else if (zincObject.isLines) {
1096
+ if (!_this.sceneData.lines.includes(zincObject.groupName)) {
1097
+ _this.sceneData.lines.push(zincObject.groupName);
1098
+ }
1099
+ } else if (zincObject.isPointset) {
1100
+ if (!_this.sceneData.pointsets.includes(zincObject.groupName)) {
1101
+ _this.sceneData.pointsets.push(zincObject.groupName);
1102
+ }
1103
+ }
1104
+ }
1105
+ }
1106
+
1107
+ var addOrganPart = function(systemName, partName, useDefautColour, zincObject) {
1108
+ for (var i = 0; i < organPartAddedCallbacks.length;i++) {
1109
+ organPartAddedCallbacks[i](zincObject.groupName, _this.scene.isTimeVarying(), zincObject);
1110
+ }
1111
+ if (useDefautColour)
1112
+ modelsLoader.setGeometryColour(zincObject, systemName, partName);
1113
+ addOrganPartToSceneData(zincObject);
1114
+ if (zincObject.groupName) {
1115
+ _this.displayMessage(zincObject.groupName + " loaded.");
1116
+ } else {
1117
+ _this.displayMessage("Resource loaded.");
1118
+ }
1119
+ var annotation = new (__webpack_require__("a0d7").annotation)();
1120
+ annotation.data = {species:_this.sceneData.currentSpecies, system:systemName, part:partName, group:zincObject.groupName};
1121
+ zincObject.userData = [annotation];
1122
+ }
1123
+
1124
+ /**
1125
+ * New organs geometry has been added to the scene, add UIs and make
1126
+ * sure the viewport is correct.
1127
+ */
1128
+ var _addOrganPartCallback = function(systemName, partName, useDefautColour) {
1129
+ return function(zincObject) {
1130
+ addOrganPart(systemName, partName, useDefautColour, zincObject);
1131
+ }
1132
+ }
1133
+
1134
+ var downloadCompletedCallback = function() {
1135
+ return function() {
1136
+ _this.settingsChanged();
1137
+ _this.sceneData.timeVarying = _this.scene.isTimeVarying();
1138
+ _this.displayMessage("All resources loaded.");
1139
+ if (finishDownloadCallback)
1140
+ finishDownloadCallback();
1141
+ }
1142
+ }
1143
+
1144
+ var singleItemDownloadCompletedCallback = function(systemName, partName, useDefautColour) {
1145
+ return function(geometry) {
1146
+ addOrganPart(systemName, partName, useDefautColour, geometry);
1147
+ _this.settingsChanged();
1148
+ }
1149
+ }
1150
+
1151
+ /**
1152
+ * Toggle data field displays. Data fields displays flow/pressure and <button @click="play">Play</button>
1153
+ * other activities of the organs.
1154
+ */
1155
+ this.updateFieldvisibility = function(dataFields, value) {
1156
+ for ( var i = 0; i < dataFields.length; i ++ ) {
1157
+ if (value != i) {
1158
+ var geometryName = dataFields[i].PartName;
1159
+ _this.changeOrganPartsVisibility(geometryName, false);
1160
+ }
1161
+ }
1162
+ if (value > -1) {
1163
+ var partName = dataFields[value].PartName;
1164
+ if ((_this.scene.findGeometriesWithGroupName(partName).length > 0) ||
1165
+ (_this.scene.findGlyphsetsWithGroupName(partName).length > 0)) {
1166
+ _this.changeOrganPartsVisibility(partName, true);
1167
+ } else {
1168
+ var partDetails = getOrganDetails(dataFields[value].SystemName, partName);
1169
+ if (partDetails != undefined) {
1170
+ _this.scene.loadMetadataURL(modelsLoader.getOrgansDirectoryPrefix() + "/" + partDetails.meta);
1171
+ }
1172
+ }
1173
+ }
1174
+ }
1175
+
1176
+ /**
1177
+ * Return an array containing name(s) of species that also contains the
1178
+ * currently displayed organs.
1179
+ *
1180
+ * @returns {Array} containing species name
1181
+ */
1182
+ this.getAvailableSpecies = function(currentSpecies, currentSystem, currentPart) {
1183
+ var availableSpecies = new Array();
1184
+ availableSpecies.push("none");
1185
+ var keysArray = Object.keys(organsFileMap);
1186
+ for (index in keysArray) {
1187
+ var species = keysArray[index];
1188
+ if (species != currentSpecies) {
1189
+ if (organsFileMap[species].hasOwnProperty(currentSystem) &&
1190
+ organsFileMap[species][currentSystem].hasOwnProperty(currentPart)) {
1191
+ availableSpecies.push(species);
1192
+ }
1193
+ }
1194
+ }
1195
+ return availableSpecies;
1196
+ }
1197
+
1198
+ var setSceneData = function(speciesName, systemName, partName, organsDetails) {
1199
+ _this.sceneData.nerveMapIsActive = false;
1200
+ _this.sceneData.nerveMap = undefined;
1201
+ _this.sceneData.metaURL = "";
1202
+ _this.sceneData.viewURL = "";
1203
+ _this.sceneData.currentSpecies = speciesName;
1204
+ _this.sceneData.currentSystem = systemName;
1205
+ _this.sceneData.currentPart = partName;
1206
+ _this.sceneData.currentTime = 0.0;
1207
+ _this.sceneData.geometries.splice(0);
1208
+ _this.sceneData.lines.splice(0);
1209
+ _this.sceneData.glyphsets.splice(0);
1210
+ _this.sceneData.pointsets.splice(0);
1211
+ _this.sceneData.timeVarying = false;
1212
+ // This is used as title
1213
+ var name = "";
1214
+ if (speciesName)
1215
+ name = speciesName + "/";
1216
+ if (systemName)
1217
+ name = systemName + "/";
1218
+ if (partName)
1219
+ name = partName;
1220
+ _this.sceneData.currentName = name;
1221
+ }
1222
+
1223
+ this.loadOrgansFromURL = function(url, speciesName, systemName, partName, viewURL) {
1224
+ if (_this.zincRenderer) {
1225
+ if (partName && (_this.sceneData.metaURL !== url)) {
1226
+ setSceneData(speciesName, systemName, partName, undefined);
1227
+ var name = _this.sceneData.currentName;
1228
+ var organScene = _this.zincRenderer.getSceneByName(name);
1229
+ if (organScene) {
1230
+ organScene.clearAll();
1231
+ } else {
1232
+ organScene = _this.zincRenderer.createScene(name);
1233
+ }
1234
+ for (var i = 0; i < sceneChangedCallbacks.length;i++) {
1235
+ sceneChangedCallbacks[i](_this.sceneData);
1236
+ }
1237
+ if (viewURL && viewURL != "") {
1238
+ _this.sceneData.viewURL = viewURL;
1239
+ organScene.loadViewURL(_this.sceneData.viewURL);
1240
+ } else
1241
+ _this.sceneData.viewURL = undefined;
1242
+ _this.sceneData.metaURL = url;
1243
+ _this.displayMessage("Downloading...");
1244
+ organScene.loadMetadataURL(url, _addOrganPartCallback(systemName, partName, false),
1245
+ downloadCompletedCallback());
1246
+ _this.scene = organScene;
1247
+ _this.zincRenderer.setCurrentScene(organScene);
1248
+ _this.graphicsHighlight.reset();
1249
+ var zincCameraControl = organScene.getZincCameraControls();
1250
+ zincCameraControl.enableRaycaster(organScene, _pickingCallback(), _hoverCallback());
1251
+ zincCameraControl.setMouseButtonAction("AUXILIARY", "ZOOM");
1252
+ zincCameraControl.setMouseButtonAction("SECONDARY", "PAN");
1253
+ }
1254
+ }
1255
+ }
1256
+
1257
+ this.alignCameraWithSelectedObject = function(transitionTime) {
1258
+ var objects = _this.graphicsHighlight.getSelected();
1259
+ if (objects && objects[0] && objects[0].userData) {
1260
+ _this.scene.alignObjectToCameraView(objects[0].userData, transitionTime);
1261
+ }
1262
+ }
1263
+
1264
+ this.exportSettings = function() {
1265
+ var settings = {};
1266
+ settings.name = _this.instanceName;
1267
+ if (_this.sceneData.currentSystem)
1268
+ settings.system = _this.sceneData.currentSystem;
1269
+ if (_this.sceneData.currentSpecies)
1270
+ settings.species = _this.sceneData.currentSpecies;
1271
+ if (_this.sceneData.currentPart)
1272
+ settings.part = _this.sceneData.currentPart;
1273
+ settings.metaURL = _this.sceneData.metaURL;
1274
+ if (_this.sceneData.viewURL)
1275
+ settings.viewURL = _this.sceneData.viewURL;
1276
+ settings.dialog = "Organ Viewer";
1277
+ return settings;
1278
+ }
1279
+
1280
+ this.importSettings = function(settings) {
1281
+ if (settings && (settings.dialog == this.typeName)) {
1282
+ _this.setName(settings.name);
1283
+ if (settings.metaURL !== undefined && settings.metaURL != "") {
1284
+ _this.loadOrgansFromURL(settings.metaURL, settings.species,
1285
+ settings.system, settings.part, settings.viewURL);
1286
+ } else {
1287
+ _this.loadOrgans(settings.species, settings.system, settings.part);
1288
+ }
1289
+ return true;
1290
+ }
1291
+ return false;
1292
+ }
1293
+
1294
+ /**
1295
+ * initialise loading of the html layout for the organs panel, this is
1296
+ * called when the {@link PJP.OrgansViewer} is created.
1297
+ *
1298
+ * @async
1299
+ */
1300
+ var initialise = function() {
1301
+ _this.initialiseRenderer(undefined);
1302
+ if (_this.zincRenderer) {
1303
+ _this.zincRenderer.addPreRenderCallbackFunction(preRenderUpdateCallback());
1304
+ _this.zincRenderer.addPostRenderCallbackFunction(postRenderUpdateCallback());
1305
+ }
1306
+ }
1307
+
1308
+ initialise();
1309
+
1310
+ }
1311
+
1312
+ OrgansViewer.prototype = Object.create((__webpack_require__("7a89").RendererModule).prototype);
1313
+ exports.OrgansViewer = OrgansViewer;
1314
+
1315
+
1316
+ /***/ }),
1317
+
1318
+ /***/ "6814":
1319
+ /***/ (function(module, exports) {
1320
+
1321
+ module.exports = require("lodash/orderBy");
1322
+
1323
+ /***/ }),
1324
+
1325
+ /***/ "6bb1":
1326
+ /***/ (function(module, exports) {
1327
+
1328
+ module.exports = require("core-js/modules/es.array.index-of");
1329
+
1330
+ /***/ }),
1331
+
1332
+ /***/ "6bfd":
1333
+ /***/ (function(module, exports) {
1334
+
1335
+ module.exports = require("element-ui/lib/locale/lang/en");
1336
+
1337
+ /***/ }),
1338
+
1339
+ /***/ "6ea3":
1340
+ /***/ (function(module, exports) {
1341
+
1342
+ module.exports = require("element-ui/lib/row");
1343
+
1344
+ /***/ }),
1345
+
1346
+ /***/ "6fd2":
1347
+ /***/ (function(module, exports, __webpack_require__) {
1348
+
1349
+ var THREE = __webpack_require__("9206").THREE;
1350
+
1351
+ exports.VaryingTexCoordsReader = function(sceneIn) {
1352
+
1353
+ var _this = this;
1354
+ var finishCallbackFunction = undefined;
1355
+ var bufferGeometry = undefined;
1356
+ var zincGeometry = undefined;
1357
+ var numberOfInputs = 0;
1358
+ var completedInputs = 0;
1359
+ var scene = sceneIn;
1360
+ var currentMap = undefined;
1361
+ var textureLoader = new THREE.TextureLoader();
1362
+ var texture = new textureLoader.load( 'models/organsViewerModels/digestive/stomach/nerve_map/texture/ratstomach_innervation_square.png' );
1363
+ texture.wrapS = THREE.RepeatWrapping;
1364
+ texture.wrapT = THREE.RepeatWrapping;
1365
+ texture.format = THREE.RGBFormat;
1366
+
1367
+ var shadersUniforms = THREE.UniformsUtils.merge( [
1368
+ {
1369
+ ambient : { type: "c", value: new THREE.Color( 0x000000 ) },
1370
+ diffuse : { type: "c", value: new THREE.Color( 0xffffff ) },
1371
+ emissive : { type: "c", value: new THREE.Color( 0xbbbbbb ) },
1372
+ specular : { type: "c", value: new THREE.Color( 0x111111 ) },
1373
+ shininess: { type: "f", value: 100 },
1374
+ opacity: { type: "f", value: 1.0 },
1375
+ ambientLightColor: { type: "c", value: new THREE.Color( 0xF0F0F0 ) },
1376
+ directionalLightColor: { type: "c", value: new THREE.Color( 0x555555) },
1377
+ directionalLightDirection: { type: "v3", value: new THREE.Vector3() },
1378
+ offsetRepeat: { value: new THREE.Vector4( 0, 0, 1, 1 ) },
1379
+ time: { type: "f", value: 0.0 },
1380
+ slide_pos: { type: "f", value: 1.0 },
1381
+ myTex: {type: 't', value: null}
1382
+ } ] );
1383
+
1384
+ var addGeometryIntoBufferGeometry = function(order, geometry)
1385
+ {
1386
+ var arrayLength = geometry.faces.length * 3 * 3;
1387
+ var positions = new Float32Array( arrayLength );
1388
+ var colors = new Float32Array( arrayLength );
1389
+ var normals = new Float32Array( arrayLength );
1390
+ var texCoords = new Float32Array( geometry.faces.length * 3 * 2 );
1391
+ if (bufferGeometry === undefined)
1392
+ bufferGeometry = new THREE.BufferGeometry();
1393
+
1394
+ geometry.faces.forEach( function ( face, index ) {
1395
+ positions[ index * 9 + 0 ] = geometry.vertices[ face.a ].x;
1396
+ positions[ index * 9 + 1 ] = geometry.vertices[ face.a ].y;
1397
+ positions[ index * 9 + 2 ] = geometry.vertices[ face.a ].z;
1398
+ positions[ index * 9 + 3 ] = geometry.vertices[ face.b ].x;
1399
+ positions[ index * 9 + 4 ] = geometry.vertices[ face.b ].y;
1400
+ positions[ index * 9 + 5 ] = geometry.vertices[ face.b ].z;
1401
+ positions[ index * 9 + 6 ] = geometry.vertices[ face.c ].x;
1402
+ positions[ index * 9 + 7 ] = geometry.vertices[ face.c ].y;
1403
+ positions[ index * 9 + 8 ] = geometry.vertices[ face.c ].z;
1404
+
1405
+ normals[ index * 9 + 0 ] = face.vertexNormals[0].x;
1406
+ normals[ index * 9 + 1 ] = face.vertexNormals[0].y;
1407
+ normals[ index * 9 + 2 ] = face.vertexNormals[0].z;
1408
+ normals[ index * 9 + 3 ] = face.vertexNormals[1].x;
1409
+ normals[ index * 9 + 4 ] = face.vertexNormals[1].y;
1410
+ normals[ index * 9 + 5 ] = face.vertexNormals[1].z;
1411
+ normals[ index * 9 + 6 ] = face.vertexNormals[2].x;
1412
+ normals[ index * 9 + 7 ] = face.vertexNormals[2].y;
1413
+ normals[ index * 9 + 8 ] = face.vertexNormals[2].z;
1414
+
1415
+ texCoords[ index * 6 + 0] = geometry.faceVertexUvs[ 0 ][index][0].x;
1416
+ texCoords[ index * 6 + 1] = geometry.faceVertexUvs[ 0 ][index][0].y;
1417
+ texCoords[ index * 6 + 2] = geometry.faceVertexUvs[ 0 ][index][1].x;
1418
+ texCoords[ index * 6 + 3] = geometry.faceVertexUvs[ 0 ][index][1].y;
1419
+ texCoords[ index * 6 + 4] = geometry.faceVertexUvs[ 0 ][index][2].x;
1420
+ texCoords[ index * 6 + 5] = geometry.faceVertexUvs[ 0 ][index][2].y;
1421
+ } );
1422
+
1423
+
1424
+ if (order == 0) {
1425
+ bufferGeometry.addAttribute( "position", new THREE.BufferAttribute( positions, 3) );
1426
+ bufferGeometry.addAttribute( "normal", new THREE.BufferAttribute( normals, 3 ) );
1427
+ bufferGeometry.addAttribute( "uv", new THREE.BufferAttribute( texCoords, 2 ) );
1428
+ } else {
1429
+ var positionStr = "position_" + order;
1430
+ var normalStr = "normal_" + order;
1431
+ var uvsStr = "uv_" + order;
1432
+ bufferGeometry.addAttribute( positionStr, new THREE.BufferAttribute( positions, 3) );
1433
+ bufferGeometry.addAttribute( normalStr, new THREE.BufferAttribute( normals, 3 ) );
1434
+ bufferGeometry.addAttribute( uvsStr, new THREE.BufferAttribute( texCoords, 2 ) );
1435
+ }
1436
+
1437
+ }
1438
+
1439
+ var meshReady = function(bufferGeometryIn, shaderText, material){
1440
+ var shaderMaterial = new THREE.RawShaderMaterial( {
1441
+ vertexShader: shaderText[0],
1442
+ fragmentShader: shaderText[1],
1443
+ uniforms: shadersUniforms
1444
+ } );
1445
+ shaderMaterial.uniforms.myTex.value = texture;
1446
+ shaderMaterial.side = THREE.DoubleSide;
1447
+ shaderMaterial.depthTest = true;
1448
+ shaderMaterial.needsUpdate = true;
1449
+ shaderMaterial.map = texture;
1450
+ shaderMaterial.uniforms.myTex.value.needsUpdate = true;
1451
+ shaderMaterial.opacity = 1.0;
1452
+ zincGeometry = scene.addZincGeometry(bufferGeometryIn, 30001, undefined, undefined, false, false, true, undefined, shaderMaterial);
1453
+ zincGeometry.groupName = "varyingTexture";
1454
+ }
1455
+
1456
+ var myLoader = function(order, shaderText) {
1457
+ return function(geometry, materials){
1458
+ var material = 0;
1459
+ addGeometryIntoBufferGeometry(order, geometry);
1460
+ completedInputs++;
1461
+ if (completedInputs == numberOfInputs) {
1462
+ meshReady(bufferGeometry, shaderText, material);
1463
+ if (finishCallbackFunction != undefined && (typeof finishCallbackFunction == 'function'))
1464
+ finishCallbackFunction(bufferGeometry);
1465
+ }
1466
+ }
1467
+ }
1468
+
1469
+ this.setSliderPos = function(pos) {
1470
+ if (zincGeometry)
1471
+ zincGeometry.morph.material.uniforms.slide_pos.value = pos;
1472
+ }
1473
+
1474
+ this.setTime = function(time) {
1475
+ if (zincGeometry) {
1476
+ zincGeometry.morph.material.uniforms.time.value = time;
1477
+ }
1478
+ }
1479
+
1480
+ this.setTexture = function(textureIn) {
1481
+ if (zincGeometry) {
1482
+ zincGeometry.morph.material.uniforms.myTex.value = textureIn;
1483
+ zincGeometry.morph.material.uniforms.myTex.value.needsUpdate = true;
1484
+ }
1485
+ }
1486
+
1487
+ this.loadURLsIntoBufferGeometry = function(urls, finishCallback, progressCallback, errorCallback) {
1488
+ var loader = new THREE.JSONLoader( true );
1489
+ numberOfInputs = urls.length;
1490
+ finishCallbackFunction = finishCallback;
1491
+ var shaderText = [
1492
+ __webpack_require__("1823"),
1493
+ __webpack_require__("4e8a")
1494
+ ];
1495
+ for (var i = 0; i < numberOfInputs; i++)
1496
+ loader.load( urls[i], myLoader(i, shaderText), progressCallback, errorCallback);
1497
+ }
1498
+ }
1499
+
1500
+
1501
+ /***/ }),
1502
+
1503
+ /***/ "703d":
1504
+ /***/ (function(module, exports) {
1505
+
1506
+ module.exports = require("element-ui/lib/theme-chalk/col.css");
1507
+
1508
+ /***/ }),
1509
+
1510
+ /***/ "73ef":
1511
+ /***/ (function(module, exports) {
1512
+
1513
+ module.exports = require("element-ui/lib/theme-chalk/main.css");
1514
+
1515
+ /***/ }),
1516
+
1517
+ /***/ "76bf":
1518
+ /***/ (function(module, exports, __webpack_require__) {
1519
+
1520
+ __webpack_require__("b723");
1521
+
1522
+ exports.ToolTip = function(container) {
1523
+ var tooltipcontainerElement = undefined;
1524
+ var tipElement = undefined;
1525
+ var tiptextElement = undefined;
1526
+ var template = '<div class="mptooltip" id="tip"><span class="mptooltiptext" id="tiptext"> Tooltip text</span></div>';
1527
+ var _this = this;
1528
+
1529
+ /**
1530
+ * Show tool tip on the specified windows coordinates.
1531
+ * @param {Number} x - Style sheet with the same title.
1532
+ * @param {Number} y - selector string to match.
1533
+ */
1534
+ this.show = function(x, y) {
1535
+ tooltipcontainerElement.style.left = x +"px";
1536
+ tooltipcontainerElement.style.top = (y - 20) + "px";
1537
+ tipElement.style.visibility = "visible";
1538
+ tipElement.style.opacity = 1;
1539
+ tiptextElement.style.visibility = "visible";
1540
+ tiptextElement.style.opacity = 1;
1541
+ }
1542
+
1543
+ this.hide = function() {
1544
+ tipElement.style.visibility = "hidden";
1545
+ tipElement.style.opacity = 0;
1546
+ tiptextElement.style.visibility = "hidden";
1547
+ tiptextElement.style.opacity = 0;
1548
+ }
1549
+
1550
+ /**
1551
+ * Change the tooltip text.
1552
+ * @param {String} text - Text to update the tooltip to.
1553
+ */
1554
+ this.setText = function(text) {
1555
+ tiptextElement.innerHTML = text;
1556
+ }
1557
+
1558
+ var setupToolTipContainer = function() {
1559
+ tooltipcontainerElement = document.createElement("div");
1560
+ tooltipcontainerElement.id = "tooltipcontainer";
1561
+ tooltipcontainerElement.innerHTML = template;
1562
+ /*
1563
+ for (i = 0; i < childNodes.length; i++) {
1564
+ parent[0].appendChild(childNodes[i]);
1565
+ }
1566
+ */
1567
+ tipElement = tooltipcontainerElement.querySelector("#tip");
1568
+ tiptextElement = tooltipcontainerElement.querySelector("#tiptext");
1569
+ container.appendChild(tooltipcontainerElement);
1570
+
1571
+ }
1572
+
1573
+ setupToolTipContainer();
1574
+ }
1575
+
1576
+
1577
+
1578
+ /***/ }),
1579
+
1580
+ /***/ "7a89":
1581
+ /***/ (function(module, exports, __webpack_require__) {
1582
+
1583
+ var THREE = __webpack_require__("9206").THREE;
1584
+
1585
+ /**
1586
+ * Create a {@link Zinc.Renderer} on the dom element with corresponding elementID.
1587
+ * @param {String} elementID - id of the target dom element.
1588
+ * @returns {Zinc.Renderer}
1589
+ */
1590
+ var createRenderer = function () {
1591
+ var WEBGL = __webpack_require__("10c9").WEBGL;
1592
+ var localContainer = document.createElement( 'div' );
1593
+ var localRenderer = undefined;;
1594
+ localContainer.style.height = "100%";
1595
+ if (WEBGL.isWebGLAvailable()) {
1596
+ var Zinc = __webpack_require__("9206");
1597
+ var localRenderer = new Zinc.Renderer(localContainer, window);
1598
+ Zinc.defaultMaterialColor = 0xFFFF9C;
1599
+ localRenderer.initialiseVisualisation();
1600
+ localRenderer.playAnimation = false;
1601
+ } else {
1602
+ var warning = WEBGL.getWebGLErrorMessage();
1603
+ localContainer.appendChild(warning);
1604
+ }
1605
+ return {"renderer":localRenderer, "container":localContainer};
1606
+ }
1607
+
1608
+ var RendererModule = function() {
1609
+ (__webpack_require__("3966").BaseModule).call(this);
1610
+ this.scene = undefined;
1611
+ this.toolTip = undefined;
1612
+ this.rendererContainer = undefined;
1613
+ this.displayArea = undefined;
1614
+ this.graphicsHighlight = new (__webpack_require__("8cec").GraphicsHighlight)();
1615
+ this.zincRenderer = null;
1616
+ this.selectedScreenCoordinates = new THREE.Vector3();
1617
+ this.selectedCenter = undefined;
1618
+ }
1619
+
1620
+ RendererModule.prototype = Object.create((__webpack_require__("3966").BaseModule).prototype);
1621
+
1622
+ /**
1623
+ * This function will get the the first intersected object with name or
1624
+ * the first glyph object with name.
1625
+ */
1626
+ RendererModule.prototype.getIntersectedObject = function(intersects) {
1627
+ if (intersects) {
1628
+ for (var i = 0; i < intersects.length; i++) {
1629
+ if (intersects[i] !== undefined) {
1630
+ if (intersects[i].object &&
1631
+ intersects[i].object.userData &&
1632
+ intersects[i].object.userData.isZincObject &&
1633
+ (intersects[i].object.name ||
1634
+ intersects[i].object.userData.isMarker))
1635
+ return intersects[i];
1636
+ }
1637
+ }
1638
+ }
1639
+ return undefined;
1640
+ }
1641
+
1642
+ RendererModule.prototype.getAnnotationsFromObjects = function(objects) {
1643
+ var annotations = [];
1644
+ for (var i = 0; i < objects.length; i++) {
1645
+ var zincObject = objects[i].userData;
1646
+ var annotation = undefined;
1647
+ if (zincObject) {
1648
+ if (zincObject.isGlyph || zincObject.isGlyphset) {
1649
+ var glyphset = zincObject;
1650
+ if (zincObject.isGlyph)
1651
+ glyphset = zincObject.getGlyphset();
1652
+ annotation = glyphset.userData ? glyphset.userData[0] : undefined;
1653
+ if (annotation && annotation.data) {
1654
+ if (objects[i].name && objects[i].name != "")
1655
+ annotation.data.id = objects[i].name;
1656
+ else
1657
+ annotation.data.id = glyphset.groupName;
1658
+ }
1659
+ } else {
1660
+ annotation = zincObject.userData ? zincObject.userData[0] : undefined;
1661
+ if (annotation && annotation.data){
1662
+ annotation.data.id = objects[i].name;
1663
+ }
1664
+ }
1665
+ }
1666
+ annotations[i] = annotation;
1667
+ }
1668
+ return annotations;
1669
+ }
1670
+
1671
+ RendererModule.prototype.setHighlightedByObjects = function(objects, propagateChanges) {
1672
+ var changed = this.graphicsHighlight.setHighlighted(objects);
1673
+ if (changed && propagateChanges) {
1674
+ var eventType = __webpack_require__("549c").EVENT_TYPE.HIGHLIGHTED;
1675
+ var annotations = this.getAnnotationsFromObjects(objects);
1676
+ this.publishChanges(annotations, eventType);
1677
+ }
1678
+ return changed;
1679
+ }
1680
+
1681
+
1682
+ RendererModule.prototype.setHighlightedByZincObject = function(
1683
+ zincObject, propagateChanges) {
1684
+ return this.setHighlightedByObjects([zincObject ? zincObject.morph : undefined], propagateChanges);
1685
+ }
1686
+
1687
+ RendererModule.prototype.setupLiveCoordinates = function(zincObjects) {
1688
+ if (zincObjects && (zincObjects.length > 0)) {
1689
+ var boundingBox = this.scene.getBoundingBoxOfZincObjects(zincObjects);
1690
+ let newSelectedCenter = new THREE.Vector3();
1691
+ boundingBox.getCenter(newSelectedCenter);
1692
+ if (this.selectedCenter == undefined)
1693
+ this.selectedCenter = newSelectedCenter;
1694
+ else {
1695
+ this.selectedCenter.x = newSelectedCenter.x;
1696
+ this.selectedCenter.y = newSelectedCenter.y;
1697
+ }
1698
+ } else {
1699
+ this.selectedCenter = undefined;
1700
+ }
1701
+ }
1702
+
1703
+ RendererModule.prototype.objectsToZincObjects = function(objects) {
1704
+ var zincObjects = [];
1705
+ for (var i = 0; i < objects.length; i++) {
1706
+ var zincObject = objects[i].userData;
1707
+ if (zincObject) {
1708
+ if (zincObject.isGlyph || zincObject.isGlyphset) {
1709
+ var glyphset = zincObject;
1710
+ if (zincObject.isGlyph)
1711
+ glyphset = zincObject.getGlyphset();
1712
+ zincObjects. push(glyphset);
1713
+ } else {
1714
+ zincObjects. push(zincObject);
1715
+ }
1716
+ }
1717
+ }
1718
+ return zincObjects;
1719
+ }
1720
+
1721
+
1722
+ RendererModule.prototype.setSelectedByObjects = function(
1723
+ objects, propagateChanges) {
1724
+ var changed = this.graphicsHighlight.setSelected(objects);
1725
+ if (changed) {
1726
+ var zincObjects = this.objectsToZincObjects(objects);
1727
+ this.setupLiveCoordinates(zincObjects);
1728
+ if (propagateChanges) {
1729
+ var eventType = __webpack_require__("549c").EVENT_TYPE.SELECTED;
1730
+ var annotations = this.getAnnotationsFromObjects(objects);
1731
+ this.publishChanges(annotations, eventType);
1732
+ }
1733
+ }
1734
+ return changed;
1735
+ }
1736
+
1737
+ RendererModule.prototype.setSelectedByZincObject = function(
1738
+ zincObject, propagateChanges) {
1739
+ return this.setSelectedByObjects([zincObject ? zincObject.morph : undefined], propagateChanges);
1740
+ }
1741
+
1742
+ var addGlyphToArray = function(objects) {
1743
+ return function(glyph) {
1744
+ objects.push(glyph.getMesh());
1745
+ }
1746
+ }
1747
+
1748
+ RendererModule.prototype.findObjectsByGroupName = function(groupName) {
1749
+ var geometries = this.scene.findGeometriesWithGroupName(groupName);
1750
+ var objects = [];
1751
+ for (var i = 0; i < geometries.length; i ++ ) {
1752
+ objects.push(geometries[i].morph);
1753
+ }
1754
+ var glyphsets = this.scene.findGlyphsetsWithGroupName(groupName);
1755
+ for (var i = 0; i < glyphsets.length; i ++ ) {
1756
+ glyphsets[i].forEachGlyph(addGlyphToArray(objects));
1757
+ }
1758
+
1759
+ return objects;
1760
+ }
1761
+
1762
+ RendererModule.prototype.setHighlightedByGroupName = function(groupName, propagateChanges) {
1763
+ var objects = this.findObjectsByGroupName(groupName);
1764
+ return this.setHighlightedByObjects(objects, propagateChanges);
1765
+ }
1766
+
1767
+ RendererModule.prototype.setSelectedByGroupName = function(groupName, propagateChanges) {
1768
+ var objects = this.findObjectsByGroupName(groupName);
1769
+ return this.setSelectedByObjects(objects, propagateChanges);
1770
+ }
1771
+
1772
+ RendererModule.prototype.changeBackgroundColour = function(backgroundColourString) {
1773
+ var colour = new THREE.Color(backgroundColourString);
1774
+ if (this.zincRenderer) {
1775
+ var internalRenderer = this.zincRenderer.getThreeJSRenderer();
1776
+ internalRenderer.setClearColor( colour, 1 );
1777
+ }
1778
+ }
1779
+
1780
+ RendererModule.prototype.resetView = function() {
1781
+ if (this.zincRenderer)
1782
+ this.zincRenderer.resetView();
1783
+ }
1784
+
1785
+ RendererModule.prototype.viewAll = function() {
1786
+ if (this.zincRenderer)
1787
+ this.zincRenderer.viewAll();
1788
+ }
1789
+
1790
+ /**
1791
+ * Start the animation and let the renderer to processs with
1792
+ * time progression
1793
+ */
1794
+ RendererModule.prototype.playAnimation = function(flag) {
1795
+ if (this.zincRenderer)
1796
+ this.zincRenderer.playAnimation = flag;
1797
+ }
1798
+
1799
+ /**
1800
+ * Set the speed of playback
1801
+ */
1802
+ RendererModule.prototype.setPlayRate = function(value) {
1803
+ if (this.zincRenderer)
1804
+ this.zincRenderer.setPlayRate(value);
1805
+ }
1806
+
1807
+ /**
1808
+ * Get the speed of playback
1809
+ */
1810
+ RendererModule.prototype.getPlayRate = function(value) {
1811
+ if (this.zincRenderer)
1812
+ return this.zincRenderer.getPlayRate();
1813
+ else
1814
+ return 0.0;
1815
+ }
1816
+
1817
+ /** Initialise everything in the renderer, including the 3D renderer,
1818
+ * and picker for the 3D renderer.
1819
+ *
1820
+ */
1821
+ RendererModule.prototype.initialiseRenderer = function(displayAreaIn) {
1822
+ if (this.zincRenderer === undefined || this.rendererContainer === undefined) {
1823
+ var returnedValue = createRenderer();
1824
+ this.zincRenderer = returnedValue["renderer"];
1825
+ this.rendererContainer = returnedValue["container"];
1826
+ }
1827
+ if (displayAreaIn) {
1828
+ this.displayArea = displayAreaIn;
1829
+ this.displayArea.appendChild( this.rendererContainer );
1830
+ if (this.zincRenderer) {
1831
+ this.zincRenderer.animate();
1832
+ if (this.toolTip === undefined)
1833
+ this.toolTip = new (__webpack_require__("76bf").ToolTip)(this.displayArea);
1834
+ }
1835
+ }
1836
+ }
1837
+
1838
+ RendererModule.prototype.destroy = function() {
1839
+ if (this.zincRenderer) {
1840
+ this.zincRenderer.dispose();
1841
+ this.zincRenderer.getThreeJSRenderer().dispose();
1842
+ this.zincRenderer = undefined;
1843
+ }
1844
+ (__webpack_require__("3966").BaseModule).prototype.destroy.call( this );
1845
+ }
1846
+
1847
+ exports.RendererModule = RendererModule;
1848
+
1849
+
1850
+ /***/ }),
1851
+
1852
+ /***/ "7c81":
1853
+ /***/ (function(module, exports) {
1854
+
1855
+ module.exports = require("core-js/modules/es.array.splice");
1856
+
1857
+ /***/ }),
1858
+
1859
+ /***/ "7d9b":
1860
+ /***/ (function(module, exports, __webpack_require__) {
1861
+
1862
+ // extracted by mini-css-extract-plugin
1863
+
1864
+ /***/ }),
1865
+
1866
+ /***/ "7f9f":
1867
+ /***/ (function(module, exports) {
1868
+
1869
+ module.exports = require("element-ui/lib/locale");
1870
+
1871
+ /***/ }),
1872
+
1873
+ /***/ "80c4":
1874
+ /***/ (function(module, exports) {
1875
+
1876
+ module.exports = require("element-ui/lib/theme-chalk/option.css");
1877
+
1878
+ /***/ }),
1879
+
1880
+ /***/ "850c":
1881
+ /***/ (function(module, exports) {
1882
+
1883
+ module.exports = require("core-js/modules/es.object.to-string");
1884
+
1885
+ /***/ }),
1886
+
1887
+ /***/ "8bbf":
1888
+ /***/ (function(module, exports) {
1889
+
1890
+ module.exports = require("vue");
1891
+
1892
+ /***/ }),
1893
+
1894
+ /***/ "8c29":
1895
+ /***/ (function(module, exports) {
1896
+
1897
+ module.exports = require("element-ui/lib/tabs");
1898
+
1899
+ /***/ }),
1900
+
1901
+ /***/ "8c84":
1902
+ /***/ (function(module, exports) {
1903
+
1904
+ module.exports = require("core-js/modules/es.array.iterator");
1905
+
1906
+ /***/ }),
1907
+
1908
+ /***/ "8cec":
1909
+ /***/ (function(module, exports, __webpack_require__) {
1910
+
1911
+ var THREE = __webpack_require__("9206").THREE;
1912
+
1913
+ /**
1914
+ * This module manages highlighted and selected objects in 3D modules.
1915
+ *
1916
+ * @class
1917
+ * @returns {exports.GraphicsHighlight}
1918
+ */
1919
+ exports.GraphicsHighlight = function() {
1920
+ var currentHighlightedObjects = [];
1921
+ var currentSelectedObjects = [];
1922
+ this.highlightColour = 0x0000FF;
1923
+ this.selectColour = 0x00FF00;
1924
+ this.originalColour = 0x000000;
1925
+ var _this = this;
1926
+
1927
+ var isDifferent = function(array1, array2) {
1928
+ if ((array1.length == 0) && (array2.length == 0))
1929
+ return false;
1930
+
1931
+ for (var i = 0; i < array1.length; i++) {
1932
+ var matched = false;
1933
+ for (var j = 0; j < array2.length; j++) {
1934
+ if (array1[i] === array2[j]) {
1935
+ matched = true;
1936
+ }
1937
+ }
1938
+ if (!matched)
1939
+ return true;
1940
+ }
1941
+ for (var i = 0; i < array2.length; i++) {
1942
+ var matched = false;
1943
+ for (var j = 0; j < array1.length; j++) {
1944
+ if (array2[i] === array1[j]) {
1945
+ matched = true;
1946
+ }
1947
+ }
1948
+ if (!matched)
1949
+ return true;
1950
+ }
1951
+ return false;
1952
+ }
1953
+
1954
+ var getUnmatchingObjects = function(objectsArray1, objectsArray2) {
1955
+ var unmatchingObjects = [];
1956
+ if (objectsArray2.length == 0)
1957
+ return objectsArray1;
1958
+ for (var i = 0; i < objectsArray1.length; i++) {
1959
+ var matched = false;
1960
+ for (var j = 0; j < objectsArray2.length; j++) {
1961
+ if (objectsArray1[i] === objectsArray2[j]) {
1962
+ matched = true;
1963
+ }
1964
+ }
1965
+ if (!matched)
1966
+ unmatchingObjects.push(objectsArray1[i]);
1967
+ }
1968
+ return unmatchingObjects;
1969
+ }
1970
+
1971
+ this.setHighlighted = function(objects) {
1972
+ var previousHighlightedObjects = currentHighlightedObjects;
1973
+ _this.resetHighlighted();
1974
+ // Selected object cannot be highlighted
1975
+ var array = getUnmatchingObjects(objects, currentSelectedObjects);
1976
+ var fullList = getFullListOfObjects(array);
1977
+ for (var i = 0; i < fullList.length; i++) {
1978
+ if (fullList[i] && fullList[i].material && fullList[i].material.emissive)
1979
+ fullList[i].material.emissive.setHex(_this.highlightColour);
1980
+ }
1981
+ currentHighlightedObjects = array;
1982
+ return isDifferent(currentHighlightedObjects, previousHighlightedObjects);
1983
+ }
1984
+
1985
+ this.setSelected = function(objects) {
1986
+ // first find highlighted object that are not selected
1987
+ var previousHSelectedObjects = currentSelectedObjects;
1988
+ var array = getUnmatchingObjects(currentHighlightedObjects, objects);
1989
+ currentHighlightedObjects = array;
1990
+ _this.resetSelected();
1991
+ var fullList = getFullListOfObjects(objects);
1992
+ for (var i = 0; i < fullList.length; i++) {
1993
+ if (fullList[i] && fullList[i].material && fullList[i].material.emissive)
1994
+ fullList[i].material.emissive.setHex(_this.selectColour);
1995
+ }
1996
+ currentSelectedObjects = objects;
1997
+ return isDifferent(currentSelectedObjects, previousHSelectedObjects);
1998
+ }
1999
+
2000
+ var getFullListOfObjects = function(objects) {
2001
+ let fullList = [];
2002
+ for (var i = 0; i < objects.length; i++) {
2003
+ if (objects[i].material)
2004
+ fullList.push(objects[i]);
2005
+ }
2006
+ return fullList;
2007
+ }
2008
+
2009
+ this.resetHighlighted = function() {
2010
+ let fullList = getFullListOfObjects(currentHighlightedObjects);
2011
+ for (var i = 0; i < fullList.length; i++) {
2012
+ if (fullList[i] && fullList[i].material) {
2013
+ if (fullList[i].material.emissive)
2014
+ fullList[i].material.emissive.setHex(_this.originalColour);
2015
+ if (fullList[i].material.depthFunc)
2016
+ fullList[i].material.depthFunc = THREE.LessEqualDepth;
2017
+ }
2018
+ }
2019
+ currentHighlightedObjects = [];
2020
+ }
2021
+
2022
+ this.resetSelected = function() {
2023
+ let fullList = getFullListOfObjects(currentSelectedObjects);
2024
+ for (var i = 0; i < fullList.length; i++) {
2025
+ if (fullList[i] && fullList[i].material) {
2026
+ if (fullList[i].material.emissive)
2027
+ fullList[i].material.emissive.setHex(_this.originalColour);
2028
+ if (fullList[i].material.depthFunc)
2029
+ fullList[i].material.depthFunc = THREE.LessEqualDepth;
2030
+ }
2031
+ }
2032
+ currentSelectedObjects = [];
2033
+ }
2034
+
2035
+ this.getSelected = function() {
2036
+ return currentSelectedObjects;
2037
+ }
2038
+
2039
+ this.reset = function() {
2040
+ _this.resetSelected();
2041
+ _this.resetHighlighted();
2042
+ }
2043
+ }
2044
+
2045
+
2046
+ /***/ }),
2047
+
2048
+ /***/ "8f11":
2049
+ /***/ (function(module, exports) {
2050
+
2051
+ module.exports = require("element-ui/lib/theme-chalk/icon.css");
2052
+
2053
+ /***/ }),
2054
+
2055
+ /***/ "907b":
2056
+ /***/ (function(module, exports) {
2057
+
2058
+ module.exports = require("core-js/modules/es.string.iterator");
2059
+
2060
+ /***/ }),
2061
+
2062
+ /***/ "9206":
2063
+ /***/ (function(module, exports) {
2064
+
2065
+ module.exports = require("zincjs");
2066
+
2067
+ /***/ }),
2068
+
2069
+ /***/ "93e6":
2070
+ /***/ (function(module, exports) {
2071
+
2072
+ module.exports = require("element-ui/lib/popover");
2073
+
2074
+ /***/ }),
2075
+
2076
+ /***/ "9776":
2077
+ /***/ (function(module, exports) {
2078
+
2079
+ module.exports = require("element-ui/lib/theme-chalk/slider.css");
2080
+
2081
+ /***/ }),
2082
+
2083
+ /***/ "9985":
2084
+ /***/ (function(module, exports) {
2085
+
2086
+ module.exports = require("element-ui/lib/theme-chalk/tab-pane.css");
2087
+
2088
+ /***/ }),
2089
+
2090
+ /***/ "9a25":
2091
+ /***/ (function(module, exports) {
2092
+
2093
+ module.exports = require("element-ui/lib/theme-chalk/base.css");
2094
+
2095
+ /***/ }),
2096
+
2097
+ /***/ "9bb0":
2098
+ /***/ (function(module, exports) {
2099
+
2100
+ module.exports = require("@soda/get-current-script");
2101
+
2102
+ /***/ }),
2103
+
2104
+ /***/ "a0d7":
2105
+ /***/ (function(module, exports) {
2106
+
2107
+ exports.annotation = function() {
2108
+ this.type = "anatomical";
2109
+ this.data = undefined;
2110
+ this.isAnnotation = true;
2111
+ }
2112
+
2113
+
2114
+ /***/ }),
2115
+
2116
+ /***/ "a497":
2117
+ /***/ (function(module, exports) {
2118
+
2119
+ module.exports = require("element-ui/lib/col");
2120
+
2121
+ /***/ }),
2122
+
2123
+ /***/ "a525":
2124
+ /***/ (function(module, exports) {
2125
+
2126
+ module.exports = require("element-ui/lib/theme-chalk/popover.css");
2127
+
2128
+ /***/ }),
2129
+
2130
+ /***/ "a7bf":
2131
+ /***/ (function(module, exports) {
2132
+
2133
+ module.exports = require("element-ui/lib/slider");
2134
+
2135
+ /***/ }),
2136
+
2137
+ /***/ "ab7e":
2138
+ /***/ (function(module, exports) {
2139
+
2140
+ module.exports = require("core-js/modules/es.array.includes");
2141
+
2142
+ /***/ }),
2143
+
2144
+ /***/ "ab87":
2145
+ /***/ (function(module, exports) {
2146
+
2147
+ module.exports = require("element-ui/lib/loading");
2148
+
2149
+ /***/ }),
2150
+
2151
+ /***/ "add8":
2152
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2153
+
2154
+ "use strict";
2155
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TraditionalControls_vue_vue_type_style_index_1_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("e8d1");
2156
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TraditionalControls_vue_vue_type_style_index_1_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TraditionalControls_vue_vue_type_style_index_1_lang_css___WEBPACK_IMPORTED_MODULE_0__);
2157
+ /* unused harmony reexport * */
2158
+
2159
+
2160
+ /***/ }),
2161
+
2162
+ /***/ "b0e3":
2163
+ /***/ (function(module, exports) {
2164
+
2165
+ module.exports = require("element-ui/lib/theme-chalk/container.css");
2166
+
2167
+ /***/ }),
2168
+
2169
+ /***/ "b2f4":
2170
+ /***/ (function(module, exports) {
2171
+
2172
+ module.exports = require("element-ui/lib/icon");
2173
+
2174
+ /***/ }),
2175
+
2176
+ /***/ "b723":
2177
+ /***/ (function(module, exports, __webpack_require__) {
2178
+
2179
+ // extracted by mini-css-extract-plugin
2180
+
2181
+ /***/ }),
2182
+
2183
+ /***/ "b777":
2184
+ /***/ (function(module, exports) {
2185
+
2186
+ module.exports = require("element-ui/lib/checkbox");
2187
+
2188
+ /***/ }),
2189
+
2190
+ /***/ "bcd8":
2191
+ /***/ (function(module, exports) {
2192
+
2193
+ module.exports = require("core-js/modules/es.function.name");
2194
+
2195
+ /***/ }),
2196
+
2197
+ /***/ "bcda":
2198
+ /***/ (function(module, exports) {
2199
+
2200
+ module.exports = require("core-js/modules/web.dom-collections.for-each");
2201
+
2202
+ /***/ }),
2203
+
2204
+ /***/ "bfab":
2205
+ /***/ (function(module, exports) {
2206
+
2207
+ module.exports = require("core-js/modules/es.string.replace");
2208
+
2209
+ /***/ }),
2210
+
2211
+ /***/ "c11a":
2212
+ /***/ (function(module, exports) {
2213
+
2214
+ module.exports = require("element-ui/lib/option");
2215
+
2216
+ /***/ }),
2217
+
2218
+ /***/ "c45a":
2219
+ /***/ (function(module, exports) {
2220
+
2221
+ module.exports = require("broadcast-channel");
2222
+
2223
+ /***/ }),
2224
+
2225
+ /***/ "d7e1":
2226
+ /***/ (function(module, exports, __webpack_require__) {
2227
+
2228
+ // extracted by mini-css-extract-plugin
2229
+
2230
+ /***/ }),
2231
+
2232
+ /***/ "e42b":
2233
+ /***/ (function(module, exports) {
2234
+
2235
+ module.exports = require("core-js/modules/es.array.from");
2236
+
2237
+ /***/ }),
2238
+
2239
+ /***/ "e8d1":
2240
+ /***/ (function(module, exports, __webpack_require__) {
2241
+
2242
+ // extracted by mini-css-extract-plugin
2243
+
2244
+ /***/ }),
2245
+
2246
+ /***/ "fae3":
2247
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2248
+
2249
+ "use strict";
2250
+ // ESM COMPAT FLAG
2251
+ __webpack_require__.r(__webpack_exports__);
2252
+
2253
+ // EXPORTS
2254
+ __webpack_require__.d(__webpack_exports__, "ScaffoldVuer", function() { return /* reexport */ ScaffoldVuer; });
2255
+
2256
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
2257
+ // This file is imported into lib/wc client bundles.
2258
+
2259
+ if (typeof window !== 'undefined') {
2260
+ var currentScript = window.document.currentScript
2261
+ if (true) {
2262
+ var getCurrentScript = __webpack_require__("9bb0")
2263
+ currentScript = getCurrentScript()
2264
+
2265
+ // for backward compatibility, because previously we directly included the polyfill
2266
+ if (!('currentScript' in document)) {
2267
+ Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
2268
+ }
2269
+ }
2270
+
2271
+ var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
2272
+ if (src) {
2273
+ __webpack_require__.p = src[1] // eslint-disable-line
2274
+ }
2275
+ }
2276
+
2277
+ // Indicate to webpack that this file can be concatenated
2278
+ /* harmony default export */ var setPublicPath = (null);
2279
+
2280
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1ffffadc-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ScaffoldVuer.vue?vue&type=template&id=1b66f0b7&scoped=true&
2281
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.loading),expression:"loading"}],ref:"scaffoldContainer",staticClass:"scaffold-container",attrs:{"element-loading-text":"Loading...","element-loading-spinner":"el-icon-loading","element-loading-background":"rgba(0, 0, 0, 0.3)"}},[_c('SvgSpriteColor'),_c('div',{ref:"display",staticStyle:{"height":"100%","width":"100%"},attrs:{"id":"organsDisplayArea","tabindex":"-1"},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==66){ return null; }return _vm.backgroundChangeCallback($event)}}}),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayUI && !_vm.isTransitioning),expression:"displayUI && !isTransitioning"}]},[(_vm.displayWarning)?_c('el-popover',{ref:"warningPopover",attrs:{"content":_vm.warningMessage,"placement":"right","append-to-body":false,"trigger":"manual","popper-class":"warning-popper right-popper non-selectable"},model:{value:(_vm.hoverVisabilities[6].value),callback:function ($$v) {_vm.$set(_vm.hoverVisabilities[6], "value", $$v)},expression:"hoverVisabilities[6].value"}}):_vm._e(),(_vm.displayWarning)?_c('i',{directives:[{name:"popover",rawName:"v-popover:warningPopover",arg:"warningPopover"}],staticClass:"el-icon-warning warning-icon",on:{"mouseover":function($event){return _vm.showToolitip(6)},"mouseout":function($event){return _vm.hideToolitip(6)}}},[_c('span',{staticClass:"warning-text"},[_vm._v("Beta")])]):_vm._e(),_c('el-popover',{ref:"checkBoxPopover",attrs:{"content":"Change region visibility","placement":"right","append-to-body":false,"trigger":"manual","popper-class":"scaffold-popper right-popper non-selectable"},model:{value:(_vm.hoverVisabilities[5].value),callback:function ($$v) {_vm.$set(_vm.hoverVisabilities[5], "value", $$v)},expression:"hoverVisabilities[5].value"}}),_c('TraditionalControls',{directives:[{name:"popover",rawName:"v-popover:checkBoxPopover",arg:"checkBoxPopover"}],ref:"traditionalControl",attrs:{"help-mode":_vm.helpMode,"module":_vm.$module,"show-colour-picker":_vm.showColourPicker},on:{"object-selected":_vm.objectSelected,"object-hovered":_vm.objectHovered,"drawer-toggled":_vm.drawerToggled}}),_c('div',{staticClass:"opacity-box"},[_c('OpacityControls',{ref:"opacityControl"})],1),(_vm.sceneData.timeVarying)?_c('el-popover',{ref:"sliderPopover",attrs:{"content":"Move the slider to animate the region","placement":"top","append-to-body":false,"trigger":"manual","popper-class":"scaffold-popper top-popper non-selectable"},model:{value:(_vm.hoverVisabilities[4].value),callback:function ($$v) {_vm.$set(_vm.hoverVisabilities[4], "value", $$v)},expression:"hoverVisabilities[4].value"}}):_vm._e(),(_vm.sceneData.timeVarying)?_c('div',{directives:[{name:"popover",rawName:"v-popover:sliderPopover",arg:"sliderPopover"}],staticClass:"time-slider-container",class:[ _vm.minimisedSlider ? 'minimised' : '', _vm.sliderPosition]},[_c('el-tabs',{attrs:{"type":"card"}},[_c('el-tab-pane',{attrs:{"label":"Animate scaffold"}},[_c('el-row',{staticClass:"tab-content"},[(_vm.isPlaying)?_c('SvgIcon',{staticClass:"icon-button video-button",attrs:{"icon":"pause"},nativeOn:{"click":function($event){return _vm.play(false)}}}):_c('SvgIcon',{staticClass:"video-button icon-button",attrs:{"icon":"play"},nativeOn:{"click":function($event){return _vm.play(true)}}}),_c('el-slider',{staticClass:"slider",attrs:{"min":0,"max":_vm.timeMax,"value":_vm.sceneData.currentTime / 100 * _vm.timeMax,"step":0.1,"tooltip-class":"time-slider-tooltip","format-tooltip":_vm.formatTooltip,"marks":_vm.timeStamps},on:{"input":function($event){return _vm.timeChange($event)}}})],1)],1),_c('el-tab-pane',{attrs:{"label":"Animation data"}},[_c('el-row',{staticClass:"tab-content"},[_c('div',{staticClass:"animation-data"},[_vm._v(" Original duration: "),_c('div',{staticClass:"purple"},[_vm._v(" "+_vm._s(_vm.orginalDuration)+" ")])]),_c('div',{staticClass:"animation-data"},[_vm._v(" Animation duration: "),_c('div',{staticClass:"purple"},[_vm._v(" "+_vm._s(_vm.animateDuration)+" ")])]),_c('div',{staticClass:"animation-data"},[_vm._v(" Playback speed "),_c('el-select',{staticClass:"select-box",attrs:{"popper-append-to-body":true,"value":_vm.currentSpeed,"placeholder":"Select","popper-class":"scaffold_viewer_dropdown"},on:{"change":function($event){return _vm.speedChanged($event)}}},_vm._l((_vm.playSpeed),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1)],1)])],1)],1)],1):_vm._e(),_c('div',{staticClass:"bottom-right-control"},[_c('el-popover',{attrs:{"content":"Zoom in","placement":"left","append-to-body":false,"trigger":"manual","popper-class":"scaffold-popper left-popper non-selectable"},model:{value:(_vm.hoverVisabilities[0].value),callback:function ($$v) {_vm.$set(_vm.hoverVisabilities[0], "value", $$v)},expression:"hoverVisabilities[0].value"}},[_c('SvgIcon',{staticClass:"icon-button zoomIn",attrs:{"slot":"reference","icon":"zoomIn"},nativeOn:{"click":function($event){return _vm.zoomIn()},"mouseover":function($event){return _vm.showToolitip(0)},"mouseout":function($event){return _vm.hideToolitip(0)}},slot:"reference"})],1),_c('el-popover',{attrs:{"content":"Zoom out","placement":"top-end","append-to-body":false,"trigger":"manual","popper-class":"scaffold-popper popper-zoomout non-selectable"},model:{value:(_vm.hoverVisabilities[1].value),callback:function ($$v) {_vm.$set(_vm.hoverVisabilities[1], "value", $$v)},expression:"hoverVisabilities[1].value"}},[_c('SvgIcon',{staticClass:"icon-button zoomOut",attrs:{"slot":"reference","icon":"zoomOut"},nativeOn:{"click":function($event){return _vm.zoomOut()},"mouseover":function($event){return _vm.showToolitip(1)},"mouseout":function($event){return _vm.hideToolitip(1)}},slot:"reference"})],1),_c('el-popover',{attrs:{"placement":"top","append-to-body":false,"trigger":"manual","popper-class":"scaffold-popper non-selectable"},model:{value:(_vm.hoverVisabilities[2].value),callback:function ($$v) {_vm.$set(_vm.hoverVisabilities[2], "value", $$v)},expression:"hoverVisabilities[2].value"}},[_c('div',[_vm._v(" Fit to "),_c('br'),_vm._v(" window ")]),_c('SvgIcon',{staticClass:"icon-button fitWindow",attrs:{"slot":"reference","icon":"fitWindow"},nativeOn:{"click":function($event){return _vm.fitWindow()},"mouseover":function($event){return _vm.showToolitip(2)},"mouseout":function($event){return _vm.hideToolitip(2)}},slot:"reference"})],1)],1),_c('el-popover',{ref:"backgroundPopover",attrs:{"placement":"top-start","width":"128","append-to-body":false,"trigger":"click","popper-class":"background-popper non-selectable"}},[_c('el-row',{staticClass:"backgroundText"},[_vm._v(" Change background ")]),_c('el-row',{staticClass:"backgroundChooser"},_vm._l((_vm.availableBackground),function(item){return _c('div',{key:item,class:['backgroundChoice', item, item == _vm.currentBackground ? 'active' :''],on:{"click":function($event){return _vm.backgroundChangeCallback(item)}}})}),0)],1),_c('el-popover',{attrs:{"content":"Change background color","placement":"right","append-to-body":false,"trigger":"manual","popper-class":"scaffold-popper right-popper non-selectable"},model:{value:(_vm.hoverVisabilities[3].value),callback:function ($$v) {_vm.$set(_vm.hoverVisabilities[3], "value", $$v)},expression:"hoverVisabilities[3].value"}},[_c('SvgIcon',{directives:[{name:"popover",rawName:"v-popover:backgroundPopover",arg:"backgroundPopover"}],staticClass:"icon-button background-colour",class:{ open: _vm.drawerOpen, close: !_vm.drawerOpen },attrs:{"slot":"reference","icon":"changeBckgd"},nativeOn:{"mouseover":function($event){return _vm.showToolitip(3)},"mouseout":function($event){return _vm.hideToolitip(3)}},slot:"reference"})],1)],1)],1)}
2282
+ var staticRenderFns = []
2283
+
2284
+
2285
+ // CONCATENATED MODULE: ./src/components/ScaffoldVuer.vue?vue&type=template&id=1b66f0b7&scoped=true&
2286
+
2287
+ // EXTERNAL MODULE: external "core-js/modules/es.array.for-each"
2288
+ var es_array_for_each_ = __webpack_require__("139f");
2289
+
2290
+ // EXTERNAL MODULE: external "core-js/modules/es.array.iterator"
2291
+ var es_array_iterator_ = __webpack_require__("8c84");
2292
+
2293
+ // EXTERNAL MODULE: external "core-js/modules/es.number.to-fixed"
2294
+ var es_number_to_fixed_ = __webpack_require__("319f");
2295
+
2296
+ // EXTERNAL MODULE: external "core-js/modules/es.object.keys"
2297
+ var es_object_keys_ = __webpack_require__("2175");
2298
+
2299
+ // EXTERNAL MODULE: external "core-js/modules/es.object.to-string"
2300
+ var es_object_to_string_ = __webpack_require__("850c");
2301
+
2302
+ // EXTERNAL MODULE: external "core-js/modules/es.string.iterator"
2303
+ var es_string_iterator_ = __webpack_require__("907b");
2304
+
2305
+ // EXTERNAL MODULE: external "core-js/modules/web.dom-collections.for-each"
2306
+ var web_dom_collections_for_each_ = __webpack_require__("bcda");
2307
+
2308
+ // EXTERNAL MODULE: external "core-js/modules/web.dom-collections.iterator"
2309
+ var web_dom_collections_iterator_ = __webpack_require__("1ce0");
2310
+
2311
+ // EXTERNAL MODULE: external "core-js/modules/web.url"
2312
+ var web_url_ = __webpack_require__("2a6f");
2313
+
2314
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/tabs.css"
2315
+ var tabs_css_ = __webpack_require__("3170");
2316
+
2317
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/base.css"
2318
+ var base_css_ = __webpack_require__("9a25");
2319
+
2320
+ // EXTERNAL MODULE: external "element-ui/lib/tabs"
2321
+ var tabs_ = __webpack_require__("8c29");
2322
+ var tabs_default = /*#__PURE__*/__webpack_require__.n(tabs_);
2323
+
2324
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/tab-pane.css"
2325
+ var tab_pane_css_ = __webpack_require__("9985");
2326
+
2327
+ // EXTERNAL MODULE: external "element-ui/lib/tab-pane"
2328
+ var tab_pane_ = __webpack_require__("31fb");
2329
+ var tab_pane_default = /*#__PURE__*/__webpack_require__.n(tab_pane_);
2330
+
2331
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/slider.css"
2332
+ var slider_css_ = __webpack_require__("9776");
2333
+
2334
+ // EXTERNAL MODULE: external "element-ui/lib/slider"
2335
+ var slider_ = __webpack_require__("a7bf");
2336
+ var slider_default = /*#__PURE__*/__webpack_require__.n(slider_);
2337
+
2338
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/select.css"
2339
+ var select_css_ = __webpack_require__("0fe2");
2340
+
2341
+ // EXTERNAL MODULE: external "element-ui/lib/select"
2342
+ var select_ = __webpack_require__("0de2");
2343
+ var select_default = /*#__PURE__*/__webpack_require__.n(select_);
2344
+
2345
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/row.css"
2346
+ var row_css_ = __webpack_require__("fd9c");
2347
+
2348
+ // EXTERNAL MODULE: external "element-ui/lib/row"
2349
+ var row_ = __webpack_require__("6ea3");
2350
+ var row_default = /*#__PURE__*/__webpack_require__.n(row_);
2351
+
2352
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/popover.css"
2353
+ var popover_css_ = __webpack_require__("a525");
2354
+
2355
+ // EXTERNAL MODULE: external "element-ui/lib/popover"
2356
+ var popover_ = __webpack_require__("93e6");
2357
+ var popover_default = /*#__PURE__*/__webpack_require__.n(popover_);
2358
+
2359
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/option.css"
2360
+ var option_css_ = __webpack_require__("80c4");
2361
+
2362
+ // EXTERNAL MODULE: external "element-ui/lib/option"
2363
+ var option_ = __webpack_require__("c11a");
2364
+ var option_default = /*#__PURE__*/__webpack_require__.n(option_);
2365
+
2366
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/loading.css"
2367
+ var loading_css_ = __webpack_require__("2c1b");
2368
+
2369
+ // EXTERNAL MODULE: external "element-ui/lib/loading"
2370
+ var loading_ = __webpack_require__("ab87");
2371
+ var loading_default = /*#__PURE__*/__webpack_require__.n(loading_);
2372
+
2373
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/col.css"
2374
+ var col_css_ = __webpack_require__("703d");
2375
+
2376
+ // EXTERNAL MODULE: external "element-ui/lib/col"
2377
+ var col_ = __webpack_require__("a497");
2378
+ var col_default = /*#__PURE__*/__webpack_require__.n(col_);
2379
+
2380
+ // EXTERNAL MODULE: external "vue"
2381
+ var external_vue_ = __webpack_require__("8bbf");
2382
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
2383
+
2384
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1ffffadc-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/OpacityControls.vue?vue&type=template&id=4c00a30f&scoped=true&
2385
+ var OpacityControlsvue_type_template_id_4c00a30f_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.material!=undefined)?_c('div',{ref:"control",staticClass:"opacity-control"},[_c('el-drawer',{staticClass:"drawer-content",attrs:{"custom-class":"my-drawer","visible":_vm.drawerOpen,"append-to-body":false,"modal-append-to-body":false,"size":"300","with-header":false,"wrapper-closable":false,"modal":false},on:{"update:visible":function($event){_vm.drawerOpen=$event}}},[(_vm.drawerOpen)?_c('div',{staticClass:"tab-button close",on:{"click":_vm.toggleDrawer}},[_c('i',{staticClass:"el-icon-arrow-right"})]):_vm._e(),_c('el-container',{staticClass:"opacity-container"},[_c('el-header',{staticClass:"header",attrs:{"height":"37px"}},[_c('div',[_vm._v("Opacity")])]),_c('el-main',{staticClass:"main"},[_c('div',{staticClass:"block"},[_c('span',{staticClass:"display"},[_vm._v(_vm._s(_vm.displayString))]),_c('el-slider',{staticClass:"my-slider",attrs:{"step":0.01,"min":0,"max":1,"format-tooltip":_vm.formatTooltip,"show-tooltip":false},model:{value:(_vm.material.opacity),callback:function ($$v) {_vm.$set(_vm.material, "opacity", $$v)},expression:"material.opacity"}})],1)])],1)],1),(!_vm.drawerOpen)?_c('div',{staticClass:"tab-button open",on:{"click":_vm.toggleDrawer}},[_c('i',{staticClass:"el-icon-arrow-left"})]):_vm._e()],1):_vm._e()}
2386
+ var OpacityControlsvue_type_template_id_4c00a30f_scoped_true_staticRenderFns = []
2387
+
2388
+
2389
+ // CONCATENATED MODULE: ./src/components/OpacityControls.vue?vue&type=template&id=4c00a30f&scoped=true&
2390
+
2391
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/main.css"
2392
+ var main_css_ = __webpack_require__("73ef");
2393
+
2394
+ // EXTERNAL MODULE: external "element-ui/lib/main"
2395
+ var main_ = __webpack_require__("1fe8");
2396
+ var main_default = /*#__PURE__*/__webpack_require__.n(main_);
2397
+
2398
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/icon.css"
2399
+ var icon_css_ = __webpack_require__("8f11");
2400
+
2401
+ // EXTERNAL MODULE: external "element-ui/lib/icon"
2402
+ var icon_ = __webpack_require__("b2f4");
2403
+ var icon_default = /*#__PURE__*/__webpack_require__.n(icon_);
2404
+
2405
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/header.css"
2406
+ var header_css_ = __webpack_require__("51c7");
2407
+
2408
+ // EXTERNAL MODULE: external "element-ui/lib/header"
2409
+ var header_ = __webpack_require__("2de2");
2410
+ var header_default = /*#__PURE__*/__webpack_require__.n(header_);
2411
+
2412
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/drawer.css"
2413
+ var drawer_css_ = __webpack_require__("4c89");
2414
+
2415
+ // EXTERNAL MODULE: external "element-ui/lib/drawer"
2416
+ var drawer_ = __webpack_require__("373b");
2417
+ var drawer_default = /*#__PURE__*/__webpack_require__.n(drawer_);
2418
+
2419
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/container.css"
2420
+ var container_css_ = __webpack_require__("b0e3");
2421
+
2422
+ // EXTERNAL MODULE: external "element-ui/lib/container"
2423
+ var container_ = __webpack_require__("1ac9");
2424
+ var container_default = /*#__PURE__*/__webpack_require__.n(container_);
2425
+
2426
+ // EXTERNAL MODULE: external "element-ui/lib/locale/lang/en"
2427
+ var en_ = __webpack_require__("6bfd");
2428
+ var en_default = /*#__PURE__*/__webpack_require__.n(en_);
2429
+
2430
+ // EXTERNAL MODULE: external "element-ui/lib/locale"
2431
+ var locale_ = __webpack_require__("7f9f");
2432
+ var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
2433
+
2434
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/OpacityControls.vue?vue&type=script&lang=js&
2435
+
2436
+
2437
+
2438
+
2439
+
2440
+
2441
+
2442
+
2443
+
2444
+
2445
+
2446
+
2447
+
2448
+
2449
+
2450
+
2451
+
2452
+
2453
+ //
2454
+ //
2455
+ //
2456
+ //
2457
+ //
2458
+ //
2459
+ //
2460
+ //
2461
+ //
2462
+ //
2463
+ //
2464
+ //
2465
+ //
2466
+ //
2467
+ //
2468
+ //
2469
+ //
2470
+ //
2471
+ //
2472
+ //
2473
+ //
2474
+ //
2475
+ //
2476
+ //
2477
+ //
2478
+ //
2479
+ //
2480
+ //
2481
+ //
2482
+ //
2483
+ //
2484
+ //
2485
+ //
2486
+ //
2487
+ //
2488
+ //
2489
+ //
2490
+ //
2491
+ //
2492
+ //
2493
+ //
2494
+ //
2495
+ //
2496
+ //
2497
+ //
2498
+ //
2499
+ //
2500
+ //
2501
+ //
2502
+ //
2503
+ //
2504
+ //
2505
+ //
2506
+ //
2507
+ //
2508
+ //
2509
+ //
2510
+
2511
+ /* eslint-disable no-alert, no-console */
2512
+
2513
+
2514
+
2515
+ locale_default.a.use(en_default.a);
2516
+ external_vue_default.a.use(container_default.a);
2517
+ external_vue_default.a.use(drawer_default.a);
2518
+ external_vue_default.a.use(header_default.a);
2519
+ external_vue_default.a.use(icon_default.a);
2520
+ external_vue_default.a.use(main_default.a);
2521
+ external_vue_default.a.use(slider_default.a);
2522
+ /**
2523
+ * A component to control the opacity of the target object.
2524
+ */
2525
+
2526
+ /* harmony default export */ var OpacityControlsvue_type_script_lang_js_ = ({
2527
+ name: "OpacityControls",
2528
+ data: function data() {
2529
+ return {
2530
+ displayString: "100%",
2531
+ material: undefined,
2532
+ drawerOpen: true
2533
+ };
2534
+ },
2535
+ watch: {
2536
+ "material.opacity": function materialOpacity() {
2537
+ if (this.material) {
2538
+ this._zincobject.setAlpha(this.material.opacity);
2539
+ }
2540
+ }
2541
+ },
2542
+ mounted: function mounted() {
2543
+ this._zincobject = undefined;
2544
+ },
2545
+ methods: {
2546
+ formatTooltip: function formatTooltip(val) {
2547
+ this.displayString = Math.floor(100 * val + 0.5) + "%";
2548
+ return this.displayString;
2549
+ },
2550
+ toggleDrawer: function toggleDrawer() {
2551
+ this.drawerOpen = !this.drawerOpen;
2552
+ },
2553
+ setObject: function setObject(object) {
2554
+ if (object) this.material = object.morph.material;else this.material = undefined;
2555
+ this._zincobject = object;
2556
+ }
2557
+ }
2558
+ });
2559
+ // CONCATENATED MODULE: ./src/components/OpacityControls.vue?vue&type=script&lang=js&
2560
+ /* harmony default export */ var components_OpacityControlsvue_type_script_lang_js_ = (OpacityControlsvue_type_script_lang_js_);
2561
+ // EXTERNAL MODULE: ./src/components/OpacityControls.vue?vue&type=style&index=0&id=4c00a30f&scoped=true&lang=scss&
2562
+ var OpacityControlsvue_type_style_index_0_id_4c00a30f_scoped_true_lang_scss_ = __webpack_require__("21a1");
2563
+
2564
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
2565
+ /* globals __VUE_SSR_CONTEXT__ */
2566
+
2567
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
2568
+ // This module is a runtime utility for cleaner component module output and will
2569
+ // be included in the final webpack user bundle.
2570
+
2571
+ function normalizeComponent (
2572
+ scriptExports,
2573
+ render,
2574
+ staticRenderFns,
2575
+ functionalTemplate,
2576
+ injectStyles,
2577
+ scopeId,
2578
+ moduleIdentifier, /* server only */
2579
+ shadowMode /* vue-cli only */
2580
+ ) {
2581
+ // Vue.extend constructor export interop
2582
+ var options = typeof scriptExports === 'function'
2583
+ ? scriptExports.options
2584
+ : scriptExports
2585
+
2586
+ // render functions
2587
+ if (render) {
2588
+ options.render = render
2589
+ options.staticRenderFns = staticRenderFns
2590
+ options._compiled = true
2591
+ }
2592
+
2593
+ // functional template
2594
+ if (functionalTemplate) {
2595
+ options.functional = true
2596
+ }
2597
+
2598
+ // scopedId
2599
+ if (scopeId) {
2600
+ options._scopeId = 'data-v-' + scopeId
2601
+ }
2602
+
2603
+ var hook
2604
+ if (moduleIdentifier) { // server build
2605
+ hook = function (context) {
2606
+ // 2.3 injection
2607
+ context =
2608
+ context || // cached call
2609
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
2610
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
2611
+ // 2.2 with runInNewContext: true
2612
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
2613
+ context = __VUE_SSR_CONTEXT__
2614
+ }
2615
+ // inject component styles
2616
+ if (injectStyles) {
2617
+ injectStyles.call(this, context)
2618
+ }
2619
+ // register component module identifier for async chunk inferrence
2620
+ if (context && context._registeredComponents) {
2621
+ context._registeredComponents.add(moduleIdentifier)
2622
+ }
2623
+ }
2624
+ // used by ssr in case component is cached and beforeCreate
2625
+ // never gets called
2626
+ options._ssrRegister = hook
2627
+ } else if (injectStyles) {
2628
+ hook = shadowMode
2629
+ ? function () {
2630
+ injectStyles.call(
2631
+ this,
2632
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
2633
+ )
2634
+ }
2635
+ : injectStyles
2636
+ }
2637
+
2638
+ if (hook) {
2639
+ if (options.functional) {
2640
+ // for template-only hot-reload because in that case the render fn doesn't
2641
+ // go through the normalizer
2642
+ options._injectStyles = hook
2643
+ // register for functional component in vue file
2644
+ var originalRender = options.render
2645
+ options.render = function renderWithStyleInjection (h, context) {
2646
+ hook.call(context)
2647
+ return originalRender(h, context)
2648
+ }
2649
+ } else {
2650
+ // inject component registration as beforeCreate hook
2651
+ var existing = options.beforeCreate
2652
+ options.beforeCreate = existing
2653
+ ? [].concat(existing, hook)
2654
+ : [hook]
2655
+ }
2656
+ }
2657
+
2658
+ return {
2659
+ exports: scriptExports,
2660
+ options: options
2661
+ }
2662
+ }
2663
+
2664
+ // CONCATENATED MODULE: ./src/components/OpacityControls.vue
2665
+
2666
+
2667
+
2668
+
2669
+
2670
+
2671
+ /* normalize component */
2672
+
2673
+ var component = normalizeComponent(
2674
+ components_OpacityControlsvue_type_script_lang_js_,
2675
+ OpacityControlsvue_type_template_id_4c00a30f_scoped_true_render,
2676
+ OpacityControlsvue_type_template_id_4c00a30f_scoped_true_staticRenderFns,
2677
+ false,
2678
+ null,
2679
+ "4c00a30f",
2680
+ null
2681
+
2682
+ )
2683
+
2684
+ /* harmony default export */ var OpacityControls = (component.exports);
2685
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1ffffadc-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TraditionalControls.vue?vue&type=template&id=b034523c&scoped=true&
2686
+ var TraditionalControlsvue_type_template_id_b034523c_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"traditional-location",class:{ open: _vm.drawerOpen, close: !_vm.drawerOpen }},[_c('div',{staticClass:"traditional-container"},[_c('el-row',[_c('el-col',{attrs:{"span":12}},[_c('div',{staticClass:"regions-display-text"},[_vm._v(" Regions ")])]),_c('el-col',{attrs:{"span":12}},[_c('el-checkbox',{staticClass:"all-checkbox",attrs:{"indeterminate":_vm.isIndeterminate},on:{"change":_vm.handleCheckAllChange},model:{value:(_vm.checkAll),callback:function ($$v) {_vm.checkAll=$$v},expression:"checkAll"}},[_vm._v(" Display all ")])],1)],1),_c('el-checkbox-group',{staticClass:"checkbox-group",attrs:{"size":"small"},on:{"change":_vm.handleCheckedItemsChange},model:{value:(_vm.checkedItems),callback:function ($$v) {_vm.checkedItems=$$v},expression:"checkedItems"}},[_c('div',{staticClass:"checkbox-group-inner"},_vm._l((_vm.sortedPrimitiveGroups),function(item){return _c('el-row',{key:item,attrs:{"label":item}},[_c('div',{staticClass:"checkbox-container"},[_c('el-checkbox',{staticClass:"my-checkbox",class:{ activeItem: _vm.activeRegion === item,
2687
+ hoverItem: _vm.hoverRegion === item },attrs:{"label":item,"checked":true},on:{"change":function($event){return _vm.visibilityToggle(item, $event)}},nativeOn:{"click":function($event){return _vm.itemClicked(item, $event)},"mouseover":function($event){return _vm.checkboxHover(item)}}},[_c('el-color-picker',{class:{ 'show-picker' : _vm.showColourPicker },attrs:{"value":_vm.getColour(item),"size":"small","popper-class":_vm.myPopperClass},on:{"change":function($event){return _vm.setColour(item, $event)}}}),_vm._v(" "+_vm._s(item)+" ")],1)],1)])}),1)])],1),_c('div',{staticClass:"drawer-button",class:{ open: _vm.drawerOpen, close: !_vm.drawerOpen },on:{"click":_vm.toggleDrawer}},[_c('i',{staticClass:"el-icon-arrow-left"})])])}
2688
+ var TraditionalControlsvue_type_template_id_b034523c_scoped_true_staticRenderFns = []
2689
+
2690
+
2691
+ // CONCATENATED MODULE: ./src/components/TraditionalControls.vue?vue&type=template&id=b034523c&scoped=true&
2692
+
2693
+ // EXTERNAL MODULE: external "core-js/modules/es.array.concat"
2694
+ var es_array_concat_ = __webpack_require__("18d2");
2695
+
2696
+ // EXTERNAL MODULE: external "core-js/modules/es.array.includes"
2697
+ var es_array_includes_ = __webpack_require__("ab7e");
2698
+
2699
+ // EXTERNAL MODULE: external "core-js/modules/es.array.index-of"
2700
+ var es_array_index_of_ = __webpack_require__("6bb1");
2701
+
2702
+ // EXTERNAL MODULE: external "core-js/modules/es.array.splice"
2703
+ var es_array_splice_ = __webpack_require__("7c81");
2704
+
2705
+ // EXTERNAL MODULE: external "core-js/modules/es.regexp.exec"
2706
+ var es_regexp_exec_ = __webpack_require__("51f7");
2707
+
2708
+ // EXTERNAL MODULE: external "core-js/modules/es.string.includes"
2709
+ var es_string_includes_ = __webpack_require__("fd48");
2710
+
2711
+ // EXTERNAL MODULE: external "core-js/modules/es.string.replace"
2712
+ var es_string_replace_ = __webpack_require__("bfab");
2713
+
2714
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
2715
+ function _arrayLikeToArray(arr, len) {
2716
+ if (len == null || len > arr.length) len = arr.length;
2717
+
2718
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
2719
+ arr2[i] = arr[i];
2720
+ }
2721
+
2722
+ return arr2;
2723
+ }
2724
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
2725
+
2726
+ function _arrayWithoutHoles(arr) {
2727
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
2728
+ }
2729
+ // EXTERNAL MODULE: external "core-js/modules/es.symbol"
2730
+ var es_symbol_ = __webpack_require__("6049");
2731
+
2732
+ // EXTERNAL MODULE: external "core-js/modules/es.symbol.description"
2733
+ var es_symbol_description_ = __webpack_require__("51e9");
2734
+
2735
+ // EXTERNAL MODULE: external "core-js/modules/es.symbol.iterator"
2736
+ var es_symbol_iterator_ = __webpack_require__("02ac");
2737
+
2738
+ // EXTERNAL MODULE: external "core-js/modules/es.array.from"
2739
+ var es_array_from_ = __webpack_require__("e42b");
2740
+
2741
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
2742
+
2743
+
2744
+
2745
+
2746
+
2747
+
2748
+
2749
+
2750
+ function _iterableToArray(iter) {
2751
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
2752
+ }
2753
+ // EXTERNAL MODULE: external "core-js/modules/es.array.slice"
2754
+ var es_array_slice_ = __webpack_require__("6579");
2755
+
2756
+ // EXTERNAL MODULE: external "core-js/modules/es.function.name"
2757
+ var es_function_name_ = __webpack_require__("bcd8");
2758
+
2759
+ // EXTERNAL MODULE: external "core-js/modules/es.regexp.to-string"
2760
+ var es_regexp_to_string_ = __webpack_require__("5fef");
2761
+
2762
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
2763
+
2764
+
2765
+
2766
+
2767
+
2768
+
2769
+
2770
+ function _unsupportedIterableToArray(o, minLen) {
2771
+ if (!o) return;
2772
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
2773
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2774
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2775
+ if (n === "Map" || n === "Set") return Array.from(n);
2776
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
2777
+ }
2778
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
2779
+ function _nonIterableSpread() {
2780
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2781
+ }
2782
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
2783
+
2784
+
2785
+
2786
+
2787
+ function _toConsumableArray(arr) {
2788
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
2789
+ }
2790
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/color-picker.css"
2791
+ var color_picker_css_ = __webpack_require__("3666");
2792
+
2793
+ // EXTERNAL MODULE: external "element-ui/lib/color-picker"
2794
+ var color_picker_ = __webpack_require__("4914");
2795
+ var color_picker_default = /*#__PURE__*/__webpack_require__.n(color_picker_);
2796
+
2797
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/checkbox-group.css"
2798
+ var checkbox_group_css_ = __webpack_require__("0cf4");
2799
+
2800
+ // EXTERNAL MODULE: external "element-ui/lib/checkbox-group"
2801
+ var checkbox_group_ = __webpack_require__("0607");
2802
+ var checkbox_group_default = /*#__PURE__*/__webpack_require__.n(checkbox_group_);
2803
+
2804
+ // EXTERNAL MODULE: external "element-ui/lib/theme-chalk/checkbox.css"
2805
+ var checkbox_css_ = __webpack_require__("55ee");
2806
+
2807
+ // EXTERNAL MODULE: external "element-ui/lib/checkbox"
2808
+ var checkbox_ = __webpack_require__("b777");
2809
+ var checkbox_default = /*#__PURE__*/__webpack_require__.n(checkbox_);
2810
+
2811
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TraditionalControls.vue?vue&type=script&lang=js&
2812
+
2813
+
2814
+
2815
+
2816
+
2817
+
2818
+
2819
+
2820
+
2821
+
2822
+
2823
+
2824
+
2825
+
2826
+
2827
+
2828
+
2829
+
2830
+
2831
+
2832
+ //
2833
+ //
2834
+ //
2835
+ //
2836
+ //
2837
+ //
2838
+ //
2839
+ //
2840
+ //
2841
+ //
2842
+ //
2843
+ //
2844
+ //
2845
+ //
2846
+ //
2847
+ //
2848
+ //
2849
+ //
2850
+ //
2851
+ //
2852
+ //
2853
+ //
2854
+ //
2855
+ //
2856
+ //
2857
+ //
2858
+ //
2859
+ //
2860
+ //
2861
+ //
2862
+ //
2863
+ //
2864
+ //
2865
+ //
2866
+ //
2867
+ //
2868
+ //
2869
+ //
2870
+ //
2871
+ //
2872
+ //
2873
+ //
2874
+ //
2875
+ //
2876
+ //
2877
+ //
2878
+ //
2879
+ //
2880
+ //
2881
+ //
2882
+ //
2883
+ //
2884
+ //
2885
+ //
2886
+ //
2887
+ //
2888
+ //
2889
+ //
2890
+ //
2891
+ //
2892
+ //
2893
+ //
2894
+ //
2895
+ //
2896
+ //
2897
+ //
2898
+ //
2899
+ //
2900
+ //
2901
+ //
2902
+
2903
+ /* eslint-disable no-alert, no-console */
2904
+
2905
+
2906
+
2907
+
2908
+ var orderBy = __webpack_require__("6814");
2909
+
2910
+ var uniq = __webpack_require__("4e2d");
2911
+
2912
+ locale_default.a.use(en_default.a);
2913
+ external_vue_default.a.use(checkbox_default.a);
2914
+ external_vue_default.a.use(checkbox_group_default.a);
2915
+ external_vue_default.a.use(color_picker_default.a);
2916
+ external_vue_default.a.use(row_default.a);
2917
+ /**
2918
+ * A vue component for toggling visibility of various regions.
2919
+ */
2920
+
2921
+ /* harmony default export */ var TraditionalControlsvue_type_script_lang_js_ = ({
2922
+ name: "TraditionalControls",
2923
+ props: {
2924
+ /**
2925
+ * @ignore
2926
+ */
2927
+ module: {
2928
+ type: Object,
2929
+ default: undefined
2930
+ },
2931
+
2932
+ /**
2933
+ * Enable/disable colour picker
2934
+ */
2935
+ showColourPicker: Boolean
2936
+ },
2937
+ data: function data() {
2938
+ return {
2939
+ checkAll: true,
2940
+ isIndeterminate: false,
2941
+ checkedItems: [],
2942
+ sortedPrimitiveGroups: [],
2943
+ activeRegion: "",
2944
+ hoverRegion: "",
2945
+ myPopperClass: "hide-scaffold-colour-popup",
2946
+ drawerOpen: true
2947
+ };
2948
+ },
2949
+ watch: {
2950
+ showColourPicker: {
2951
+ immediate: true,
2952
+ handler: function handler() {
2953
+ if (this.showColourPicker) this.myPopperClass = "showPicker";else this.myPopperClass = "hide-scaffold-colour-popup";
2954
+ }
2955
+ }
2956
+ },
2957
+ created: function created() {
2958
+ var tmpArray = this.module.sceneData.geometries.concat(this.module.sceneData.lines);
2959
+ tmpArray = tmpArray.concat(this.module.sceneData.glyphsets);
2960
+ tmpArray = uniq(tmpArray.concat(this.module.sceneData.pointset));
2961
+ this.sortedPrimitiveGroups = orderBy(tmpArray);
2962
+ this.module.addOrganPartAddedCallback(this.organsAdded);
2963
+ this.module.graphicsHighlight.selectColour = 0x444444;
2964
+ },
2965
+ destroyed: function destroyed() {
2966
+ this.sortedPrimitiveGroups = undefined;
2967
+ },
2968
+ methods: {
2969
+ /**
2970
+ * This is called when a new organ is read into the scene.
2971
+ */
2972
+ organsAdded: function organsAdded(name) {
2973
+ if (name && name != "") {
2974
+ var tmpArray = uniq(this.sortedPrimitiveGroups.concat([name]));
2975
+ tmpArray = orderBy(tmpArray);
2976
+ var index = tmpArray.indexOf(undefined);
2977
+
2978
+ if (index > -1) {
2979
+ tmpArray.splice(index, 1);
2980
+ }
2981
+
2982
+ this.sortedPrimitiveGroups = tmpArray;
2983
+ }
2984
+ },
2985
+
2986
+ /**
2987
+ * Select a region by its name.
2988
+ */
2989
+ changeActiveByName: function changeActiveByName(name) {
2990
+ var targetObject = this.getFirstZincObjectWithGroupName(name);
2991
+
2992
+ if (targetObject && targetObject.getVisibility()) {
2993
+ this.activeRegion = name;
2994
+ /**
2995
+ * Triggers when an item has been selected.
2996
+ *
2997
+ * @property {object} target selected object.
2998
+ */
2999
+
3000
+ this.$emit("object-selected", targetObject);
3001
+ } else {
3002
+ this.removeActive();
3003
+ }
3004
+
3005
+ this.removeHover();
3006
+ },
3007
+
3008
+ /**
3009
+ * Hover a region by its name.
3010
+ */
3011
+ changeHoverByName: function changeHoverByName(name) {
3012
+ var targetObject = this.getFirstZincObjectWithGroupName(name);
3013
+
3014
+ if (targetObject) {
3015
+ this.hoverRegion = name;
3016
+ /**
3017
+ * Triggers when an item has been hovered over.
3018
+ *
3019
+ * @property {object} target hovered object.
3020
+ */
3021
+
3022
+ this.$emit("object-hovered", targetObject);
3023
+ } else {
3024
+ this.removeHover();
3025
+ }
3026
+ },
3027
+
3028
+ /**
3029
+ * Unselect the current selected region.
3030
+ */
3031
+ removeActive: function removeActive() {
3032
+ this.activeRegion = "";
3033
+ this.$emit("object-selected", undefined);
3034
+ },
3035
+
3036
+ /**
3037
+ * Unselect the current hover region.
3038
+ */
3039
+ removeHover: function removeHover() {
3040
+ this.hoverRegion = "";
3041
+ this.$emit("object-hovered", undefined);
3042
+ },
3043
+
3044
+ /**
3045
+ * Reset the controls.
3046
+ */
3047
+ clear: function clear() {
3048
+ this.sortedPrimitiveGroups = [];
3049
+ this.checkedItems = [];
3050
+ this.checkAll = true;
3051
+ this.isIndeterminate = false;
3052
+ this.activeRegion = "";
3053
+ this.hoverRegion = "";
3054
+ this.$emit("object-selected", undefined);
3055
+ },
3056
+ getFirstZincObjectWithGroupName: function getFirstZincObjectWithGroupName(name) {
3057
+ if (this.module && this.module.scene) {
3058
+ var array = this.module.scene.findGeometriesWithGroupName(name);
3059
+ if (array.length > 0) return array[0];
3060
+ array = this.module.scene.findGlyphsetsWithGroupName(name);
3061
+ if (array.length > 0) return array[0];
3062
+ array = this.module.scene.findLinesWithGroupName(name);
3063
+ if (array.length > 0) return array[0];
3064
+ array = this.module.scene.findPointsetsWithGroupName(name);
3065
+ if (array.length > 0) return array[0];
3066
+ }
3067
+
3068
+ return undefined;
3069
+ },
3070
+ getColour: function getColour(name) {
3071
+ var graphic = this.getFirstZincObjectWithGroupName(name);
3072
+
3073
+ if (graphic) {
3074
+ var hex = graphic.getColourHex();
3075
+ if (hex) return "#" + hex;
3076
+ }
3077
+
3078
+ return "#FFFFFF";
3079
+ },
3080
+ setColour: function setColour(name, value) {
3081
+ var graphic = this.getFirstZincObjectWithGroupName(name);
3082
+
3083
+ if (graphic) {
3084
+ var hexString = value.replace("#", "0x");
3085
+ graphic.setColourHex(hexString);
3086
+ }
3087
+ },
3088
+ checkboxHover: function checkboxHover(name) {
3089
+ this.changeHoverByName(name);
3090
+ },
3091
+ itemClicked: function itemClicked(name, event) {
3092
+ if (!(event.target.classList.contains("el-checkbox__inner") || event.target.classList.contains("el-checkbox__original"))) {
3093
+ this.changeActiveByName(name);
3094
+ event.preventDefault();
3095
+ }
3096
+ },
3097
+ handleCheckedItemsChange: function handleCheckedItemsChange() {
3098
+ var unnamed = this.checkedItems.includes(undefined) ? true : false;
3099
+ var checkedCount = this.checkedItems.length;
3100
+ if (unnamed) checkedCount--;
3101
+ this.checkAll = checkedCount === this.sortedPrimitiveGroups.length;
3102
+ this.isIndeterminate = checkedCount > 0 && checkedCount < this.sortedPrimitiveGroups.length;
3103
+ },
3104
+ handleCheckAllChange: function handleCheckAllChange(val) {
3105
+ this.checkedItems = val ? _toConsumableArray(this.sortedPrimitiveGroups) : [];
3106
+ this.isIndeterminate = false;
3107
+
3108
+ for (var i = 0; i < this.sortedPrimitiveGroups.length; i++) {
3109
+ this.visibilityToggle(this.sortedPrimitiveGroups[i], this.checkAll);
3110
+ }
3111
+ },
3112
+ viewAll: function viewAll() {
3113
+ this.module.viewAll();
3114
+ },
3115
+ visibilityToggle: function visibilityToggle(item, event) {
3116
+ this.module.changeOrganPartsVisibility(item, event);
3117
+
3118
+ if (event == false) {
3119
+ if (this.activeRegion === item) {
3120
+ this.removeActive();
3121
+ }
3122
+
3123
+ if (this.hoverRegion === item) {
3124
+ this.removeHover();
3125
+ }
3126
+ }
3127
+ },
3128
+ toggleDrawer: function toggleDrawer() {
3129
+ this.drawerOpen = !this.drawerOpen;
3130
+ this.$emit("drawer-toggled", this.drawerOpen);
3131
+ },
3132
+ getState: function getState() {
3133
+ if (this.checkAll) {
3134
+ return {
3135
+ checkAll: true
3136
+ };
3137
+ }
3138
+
3139
+ var checkedItems = _toConsumableArray(this.checkedItems);
3140
+
3141
+ var index = checkedItems.indexOf(undefined);
3142
+
3143
+ if (index > -1) {
3144
+ checkedItems.splice(index, 1);
3145
+ }
3146
+
3147
+ return {
3148
+ checkedItems: checkedItems
3149
+ };
3150
+ },
3151
+ setState: function setState(state) {
3152
+ if (state) {
3153
+ if (state.checkAll) {
3154
+ this.checkedItems = _toConsumableArray(this.sortedPrimitiveGroups);
3155
+
3156
+ for (var i = 0; i < this.sortedPrimitiveGroups.length; i++) {
3157
+ this.module.changeOrganPartsVisibility(this.sortedPrimitiveGroups[i], true);
3158
+ }
3159
+ } else if (state.checkedItems) {
3160
+ this.checkedItems = _toConsumableArray(state.checkedItems);
3161
+
3162
+ for (var _i = 0; _i < this.sortedPrimitiveGroups.length; _i++) {
3163
+ var visible = this.checkedItems.includes(this.sortedPrimitiveGroups[_i]);
3164
+ this.module.changeOrganPartsVisibility(this.sortedPrimitiveGroups[_i], visible);
3165
+ }
3166
+ }
3167
+ }
3168
+
3169
+ this.handleCheckedItemsChange();
3170
+ }
3171
+ }
3172
+ });
3173
+ // CONCATENATED MODULE: ./src/components/TraditionalControls.vue?vue&type=script&lang=js&
3174
+ /* harmony default export */ var components_TraditionalControlsvue_type_script_lang_js_ = (TraditionalControlsvue_type_script_lang_js_);
3175
+ // EXTERNAL MODULE: ./src/components/TraditionalControls.vue?vue&type=style&index=0&id=b034523c&scoped=true&lang=scss&
3176
+ var TraditionalControlsvue_type_style_index_0_id_b034523c_scoped_true_lang_scss_ = __webpack_require__("022d");
3177
+
3178
+ // EXTERNAL MODULE: ./src/components/TraditionalControls.vue?vue&type=style&index=1&lang=css&
3179
+ var TraditionalControlsvue_type_style_index_1_lang_css_ = __webpack_require__("add8");
3180
+
3181
+ // CONCATENATED MODULE: ./src/components/TraditionalControls.vue
3182
+
3183
+
3184
+
3185
+
3186
+
3187
+
3188
+
3189
+ /* normalize component */
3190
+
3191
+ var TraditionalControls_component = normalizeComponent(
3192
+ components_TraditionalControlsvue_type_script_lang_js_,
3193
+ TraditionalControlsvue_type_template_id_b034523c_scoped_true_render,
3194
+ TraditionalControlsvue_type_template_id_b034523c_scoped_true_staticRenderFns,
3195
+ false,
3196
+ null,
3197
+ "b034523c",
3198
+ null
3199
+
3200
+ )
3201
+
3202
+ /* harmony default export */ var TraditionalControls = (TraditionalControls_component.exports);
3203
+ // EXTERNAL MODULE: external "@abi-software/svg-sprite"
3204
+ var svg_sprite_ = __webpack_require__("429c");
3205
+
3206
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ScaffoldVuer.vue?vue&type=script&lang=js&
3207
+
3208
+
3209
+
3210
+
3211
+
3212
+
3213
+
3214
+
3215
+
3216
+
3217
+
3218
+
3219
+
3220
+
3221
+
3222
+
3223
+
3224
+
3225
+
3226
+
3227
+
3228
+
3229
+
3230
+
3231
+
3232
+
3233
+
3234
+
3235
+
3236
+
3237
+
3238
+
3239
+
3240
+
3241
+
3242
+
3243
+ //
3244
+ //
3245
+ //
3246
+ //
3247
+ //
3248
+ //
3249
+ //
3250
+ //
3251
+ //
3252
+ //
3253
+ //
3254
+ //
3255
+ //
3256
+ //
3257
+ //
3258
+ //
3259
+ //
3260
+ //
3261
+ //
3262
+ //
3263
+ //
3264
+ //
3265
+ //
3266
+ //
3267
+ //
3268
+ //
3269
+ //
3270
+ //
3271
+ //
3272
+ //
3273
+ //
3274
+ //
3275
+ //
3276
+ //
3277
+ //
3278
+ //
3279
+ //
3280
+ //
3281
+ //
3282
+ //
3283
+ //
3284
+ //
3285
+ //
3286
+ //
3287
+ //
3288
+ //
3289
+ //
3290
+ //
3291
+ //
3292
+ //
3293
+ //
3294
+ //
3295
+ //
3296
+ //
3297
+ //
3298
+ //
3299
+ //
3300
+ //
3301
+ //
3302
+ //
3303
+ //
3304
+ //
3305
+ //
3306
+ //
3307
+ //
3308
+ //
3309
+ //
3310
+ //
3311
+ //
3312
+ //
3313
+ //
3314
+ //
3315
+ //
3316
+ //
3317
+ //
3318
+ //
3319
+ //
3320
+ //
3321
+ //
3322
+ //
3323
+ //
3324
+ //
3325
+ //
3326
+ //
3327
+ //
3328
+ //
3329
+ //
3330
+ //
3331
+ //
3332
+ //
3333
+ //
3334
+ //
3335
+ //
3336
+ //
3337
+ //
3338
+ //
3339
+ //
3340
+ //
3341
+ //
3342
+ //
3343
+ //
3344
+ //
3345
+ //
3346
+ //
3347
+ //
3348
+ //
3349
+ //
3350
+ //
3351
+ //
3352
+ //
3353
+ //
3354
+ //
3355
+ //
3356
+ //
3357
+ //
3358
+ //
3359
+ //
3360
+ //
3361
+ //
3362
+ //
3363
+ //
3364
+ //
3365
+ //
3366
+ //
3367
+ //
3368
+ //
3369
+ //
3370
+ //
3371
+ //
3372
+ //
3373
+ //
3374
+ //
3375
+ //
3376
+ //
3377
+ //
3378
+ //
3379
+ //
3380
+ //
3381
+ //
3382
+ //
3383
+ //
3384
+ //
3385
+ //
3386
+ //
3387
+ //
3388
+ //
3389
+ //
3390
+ //
3391
+ //
3392
+ //
3393
+ //
3394
+ //
3395
+ //
3396
+ //
3397
+ //
3398
+ //
3399
+ //
3400
+ //
3401
+ //
3402
+ //
3403
+ //
3404
+ //
3405
+ //
3406
+ //
3407
+ //
3408
+ //
3409
+ //
3410
+ //
3411
+ //
3412
+ //
3413
+ //
3414
+ //
3415
+ //
3416
+ //
3417
+ //
3418
+ //
3419
+ //
3420
+ //
3421
+ //
3422
+ //
3423
+ //
3424
+ //
3425
+ //
3426
+ //
3427
+ //
3428
+ //
3429
+ //
3430
+ //
3431
+ //
3432
+ //
3433
+ //
3434
+ //
3435
+ //
3436
+ //
3437
+ //
3438
+ //
3439
+ //
3440
+ //
3441
+ //
3442
+ //
3443
+ //
3444
+ //
3445
+ //
3446
+ //
3447
+ //
3448
+ //
3449
+ //
3450
+ //
3451
+ //
3452
+ //
3453
+ //
3454
+ //
3455
+ //
3456
+ //
3457
+ //
3458
+ //
3459
+ //
3460
+ //
3461
+ //
3462
+ //
3463
+ //
3464
+ //
3465
+ //
3466
+ //
3467
+ //
3468
+ //
3469
+ //
3470
+ //
3471
+ //
3472
+ //
3473
+ //
3474
+ //
3475
+ //
3476
+ //
3477
+ //
3478
+ //
3479
+ //
3480
+ //
3481
+
3482
+ /* eslint-disable no-alert, no-console */
3483
+
3484
+
3485
+
3486
+
3487
+
3488
+
3489
+ locale_default.a.use(en_default.a);
3490
+ external_vue_default.a.use(col_default.a);
3491
+ external_vue_default.a.use(loading_default.a.directive);
3492
+ external_vue_default.a.use(option_default.a);
3493
+ external_vue_default.a.use(popover_default.a);
3494
+ external_vue_default.a.use(row_default.a);
3495
+ external_vue_default.a.use(select_default.a);
3496
+ external_vue_default.a.use(slider_default.a);
3497
+ external_vue_default.a.use(tab_pane_default.a);
3498
+ external_vue_default.a.use(tabs_default.a);
3499
+
3500
+ var OrgansViewer = __webpack_require__("67b6").OrgansViewer;
3501
+
3502
+ var EventNotifier = __webpack_require__("549c").EventNotifier;
3503
+ /**
3504
+ * A vue component of the scaffold viewer.
3505
+ *
3506
+ * @requires ./OpacityControls.vue
3507
+ * @requires ./TraditionalControls.vue
3508
+ */
3509
+
3510
+
3511
+ /* harmony default export */ var ScaffoldVuervue_type_script_lang_js_ = ({
3512
+ name: "ScaffoldVuer",
3513
+ components: {
3514
+ OpacityControls: OpacityControls,
3515
+ SvgIcon: svg_sprite_["SvgIcon"],
3516
+ SvgSpriteColor: svg_sprite_["SvgSpriteColor"],
3517
+ TraditionalControls: TraditionalControls
3518
+ },
3519
+ props: {
3520
+ /**
3521
+ * URL of the zincjs metadata. This value will be ignored if a valid
3522
+ * state prop is also provided.
3523
+ * If the url needs to be updated with state present, please use
3524
+ * the setURL method.
3525
+ */
3526
+ url: {
3527
+ type: String,
3528
+ default: ""
3529
+ },
3530
+
3531
+ /**
3532
+ * Show the colour control of set to true.
3533
+ */
3534
+ showColourPicker: {
3535
+ type: Boolean,
3536
+ default: false
3537
+ },
3538
+
3539
+ /**
3540
+ * Flag to show/hide the UI.
3541
+ */
3542
+ displayUI: {
3543
+ type: Boolean,
3544
+ default: true
3545
+ },
3546
+
3547
+ /**
3548
+ * Display all graphics at start.
3549
+ *
3550
+ * This setting only works when traditional is set to false.
3551
+ */
3552
+ displayAtStartUp: {
3553
+ type: Boolean,
3554
+ default: true
3555
+ },
3556
+
3557
+ /**
3558
+ * Use for toggling the help tooltips.
3559
+ */
3560
+ helpMode: {
3561
+ type: Boolean,
3562
+ default: false
3563
+ },
3564
+
3565
+ /**
3566
+ * Use for show/display beta warning icon.
3567
+ */
3568
+ displayWarning: {
3569
+ type: Boolean,
3570
+ default: true
3571
+ },
3572
+
3573
+ /**
3574
+ * Warning message for the hovered over text
3575
+ * on the warning icon.
3576
+ */
3577
+ warningMessage: {
3578
+ type: String,
3579
+ default: "Beta feature - under active development"
3580
+ },
3581
+
3582
+ /**
3583
+ * Show/hide pickable markers for regions.
3584
+ */
3585
+ displayMarkers: {
3586
+ type: Boolean,
3587
+ default: true
3588
+ },
3589
+
3590
+ /**
3591
+ * Show/hide minimap.
3592
+ */
3593
+ displayMinimap: {
3594
+ type: Boolean,
3595
+ default: false
3596
+ },
3597
+
3598
+ /**
3599
+ * Settings for minimap position, size and alignment.
3600
+ */
3601
+ minimapSettings: {
3602
+ type: Object,
3603
+ default: function _default() {
3604
+ return {
3605
+ x_offset: 16,
3606
+ y_offset: 16,
3607
+ width: 128,
3608
+ height: 128,
3609
+ align: "top-right"
3610
+ };
3611
+ }
3612
+ },
3613
+
3614
+ /**
3615
+ * State containing state of the scaffold.
3616
+ */
3617
+ state: {
3618
+ type: Object,
3619
+ default: undefined
3620
+ },
3621
+
3622
+ /**
3623
+ * Optional prop for the name of the region to focus on,
3624
+ * this option is ignored if state or viewURL is also provided.
3625
+ */
3626
+ region: {
3627
+ type: String,
3628
+ default: ""
3629
+ },
3630
+
3631
+ /**
3632
+ * Optional prop for an URL of containing information of a viewport.
3633
+ * This option is ignored if state is also provided.
3634
+ * It will use the provided URL as base if a relative parth is provided.
3635
+ */
3636
+ viewURL: {
3637
+ type: String,
3638
+ default: ""
3639
+ },
3640
+
3641
+ /**
3642
+ * Settings for turning on/off rendering
3643
+ */
3644
+ render: {
3645
+ type: Boolean,
3646
+ default: true
3647
+ }
3648
+ },
3649
+ data: function data() {
3650
+ return {
3651
+ sceneData: this.$module.sceneData,
3652
+ isPlaying: false,
3653
+
3654
+ /**
3655
+ * This is set when scene is transitioning.
3656
+ */
3657
+ isTransitioning: false,
3658
+ tooltipAppendToBody: false,
3659
+ hoverVisabilities: [{
3660
+ value: false
3661
+ }, {
3662
+ value: false
3663
+ }, {
3664
+ value: false
3665
+ }, {
3666
+ value: false
3667
+ }, {
3668
+ value: false
3669
+ }, {
3670
+ value: false
3671
+ }, {
3672
+ value: false
3673
+ }],
3674
+ inHelp: false,
3675
+ loading: false,
3676
+ duration: 3000,
3677
+ drawerOpen: true,
3678
+ currentBackground: "white",
3679
+ availableBackground: ["white", "lightskyblue", "black"],
3680
+ minimisedSlider: false,
3681
+ sliderPosition: "",
3682
+ timeMax: 100,
3683
+ orginalDuration: "",
3684
+ animateDuration: "6secs",
3685
+ playSpeed: [{
3686
+ value: 0.1,
3687
+ label: "0.1x"
3688
+ }, {
3689
+ value: 0.5,
3690
+ label: "0.5x"
3691
+ }, {
3692
+ value: 1,
3693
+ label: "1x"
3694
+ }, {
3695
+ value: 2,
3696
+ label: "2x"
3697
+ }, {
3698
+ value: 5,
3699
+ label: "5x"
3700
+ }, {
3701
+ value: 10,
3702
+ label: "10x"
3703
+ }],
3704
+ currentSpeed: 1,
3705
+ timeStamps: {}
3706
+ };
3707
+ },
3708
+ watch: {
3709
+ url: {
3710
+ handler: function handler(newValue) {
3711
+ if (this.state === undefined || this.state.url === undefined) this.setURL(newValue);
3712
+ },
3713
+ immediate: true
3714
+ },
3715
+ region: {
3716
+ handler: function handler(region) {
3717
+ if (!(this.state || this.viewURL)) this.setFocusedRegion(region);
3718
+ },
3719
+ immediate: true
3720
+ },
3721
+ state: {
3722
+ handler: function handler(state) {
3723
+ this.setState(state);
3724
+ },
3725
+ immediate: true,
3726
+ deep: true
3727
+ },
3728
+ viewURL: {
3729
+ handler: function handler(viewURL) {
3730
+ this.updateViewURL(viewURL);
3731
+ },
3732
+ immediate: true
3733
+ },
3734
+ helpMode: function helpMode(val) {
3735
+ this.setHelpMode(val);
3736
+ },
3737
+ displayMarkers: function displayMarkers(val) {
3738
+ this.$module.scene.displayMarkers = val;
3739
+ },
3740
+ displayMinimap: function displayMinimap(val) {
3741
+ this.$module.scene.displayMinimap = val;
3742
+ },
3743
+ "sceneData.currentTime": function sceneDataCurrentTime() {
3744
+ /**
3745
+ * Triggers when scene time changes.
3746
+ *
3747
+ * @property {number} time Current build-in time of scene.
3748
+ * of selected object.
3749
+ */
3750
+ this.$emit("timeChanged", this.sceneData.currentTime);
3751
+ },
3752
+ duration: function duration() {
3753
+ this.$module.scene.setDuration(this.duration);
3754
+ },
3755
+ minimapSettings: {
3756
+ deep: true,
3757
+ handler: "updateMinimapScissor"
3758
+ },
3759
+ render: function render(val) {
3760
+ this.toggleRendering(val);
3761
+ }
3762
+ },
3763
+ beforeCreate: function beforeCreate() {
3764
+ this.$module = new OrgansViewer();
3765
+ this.isReady = false;
3766
+ this.selectedObject = undefined;
3767
+ this.hoveredObject = undefined;
3768
+ this.currentBackground = "white";
3769
+ this._currentURL = undefined;
3770
+ this.availableBackground = ["white", "black", "lightskyblue"];
3771
+ },
3772
+ mounted: function mounted() {
3773
+ var eventNotifier = new EventNotifier();
3774
+ eventNotifier.subscribe(this, this.eventNotifierCallback);
3775
+ this.$module.addNotifier(eventNotifier);
3776
+ this.$module.addOrganPartAddedCallback(this.organsAdded);
3777
+ this.$module.initialiseRenderer(this.$refs.display);
3778
+ this.toggleRendering(this.render);
3779
+ this.$module.toolTip = undefined;
3780
+ this.ro = new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer);
3781
+ this.defaultRate = this.$module.getPlayRate();
3782
+ },
3783
+ beforeDestroy: function beforeDestroy() {
3784
+ if (this.ro) this.ro.disconnect();
3785
+ this.$module.destroy();
3786
+ this.$module = undefined;
3787
+ },
3788
+ methods: {
3789
+ /**
3790
+ * This is called when a new organ is read into the scene.
3791
+ */
3792
+ organsAdded: function organsAdded() {
3793
+ this.loading = false;
3794
+ },
3795
+
3796
+ /**
3797
+ * This is called when Change backgspeedround colour button
3798
+ * is pressed an causes the backgrouColornd colour to be changed
3799
+ * to one of the three preset colour: white, black and
3800
+ * lightskyblue.
3801
+ */
3802
+ backgroundChangeCallback: function backgroundChangeCallback(colour) {
3803
+ this.currentBackground = colour;
3804
+ this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground, 1);
3805
+ },
3806
+
3807
+ /**
3808
+ * This is called by captueeScreenshot and after the last render
3809
+ * loop, it download a screenshot of the current scene with no UI.
3810
+ */
3811
+ captureScreenshotCallback: function captureScreenshotCallback() {
3812
+ //Remove the callback, only needs to happen once
3813
+ this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);
3814
+ var screenshot = this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png");
3815
+ var hrefElement = document.createElement("a");
3816
+ document.body.append(hrefElement);
3817
+ if (!this.captureFilename) hrefElement.download = "screenshot.png";else hrefElement.download = this.captureFilename;
3818
+ hrefElement.href = screenshot;
3819
+ hrefElement.click();
3820
+ hrefElement.remove();
3821
+ },
3822
+
3823
+ /**
3824
+ * Function for capturing a screenshot of the current rendering.
3825
+ *
3826
+ * @param {String} filename filename given to the screenshot.
3827
+ *
3828
+ * @public
3829
+ */
3830
+ captureScreenshot: function captureScreenshot(filename) {
3831
+ this.captureFilename = filename;
3832
+ this.captureID = this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback);
3833
+ },
3834
+ formatTooltip: function formatTooltip(val) {
3835
+ if (this.timeMax >= 1000) {
3836
+ if (val) {
3837
+ var sec = (val % 60000 / 1000).toFixed(2) + "s";
3838
+ var min = val > 60000 ? (val / 60000).toFixed(0) + "m " : "";
3839
+ return min + sec;
3840
+ }
3841
+ }
3842
+
3843
+ return val ? val.toFixed(2) + " ms" : "0 ms";
3844
+ },
3845
+
3846
+ /**
3847
+ * Function to reset the view to default.
3848
+ * Also called when the associated button is pressed.
3849
+ *
3850
+ * @public
3851
+ */
3852
+ fitWindow: function fitWindow() {
3853
+ if (this.$module.scene) {
3854
+ this.$module.scene.viewAll();
3855
+ }
3856
+ },
3857
+
3858
+ /**
3859
+ * Function to zoom in.
3860
+ * Also called when the associated button is pressed.
3861
+ *
3862
+ * @public
3863
+ */
3864
+ zoomIn: function zoomIn() {
3865
+ if (this.$module.scene) {
3866
+ this.$module.scene.changeZoomByScrollRateUnit(-1);
3867
+ }
3868
+ },
3869
+
3870
+ /**
3871
+ * Function to zoom out.
3872
+ * Also called when the associated button is pressed.
3873
+ *
3874
+ * @public
3875
+ */
3876
+ zoomOut: function zoomOut() {
3877
+ if (this.$module.scene) {
3878
+ this.$module.scene.changeZoomByScrollRateUnit(1);
3879
+ }
3880
+ },
3881
+
3882
+ /**
3883
+ * Function to change the current play speed.
3884
+ *
3885
+ * @public
3886
+ */
3887
+ speedChanged: function speedChanged(speed) {
3888
+ this.currentSpeed = speed;
3889
+ this.$module.setPlayRate(this.defaultRate * this.currentSpeed);
3890
+ },
3891
+
3892
+ /**
3893
+ * Function used to stop the free spin
3894
+ *
3895
+ * @public
3896
+ */
3897
+ stopFreeSpin: function stopFreeSpin() {
3898
+ var cameracontrol = this.$module.scene.getZincCameraControls();
3899
+ cameracontrol.stopAutoTumble();
3900
+ this.isTransitioning = false;
3901
+ },
3902
+
3903
+ /**
3904
+ * Focus on named region
3905
+ */
3906
+ viewRegion: function viewRegion(name) {
3907
+ if (name && name != "" && this.$module.scene) {
3908
+ var objects = this.$module.scene.findObjectsWithGroupName(name);
3909
+ var box = this.$module.scene.getBoundingBoxOfZincObjects(objects);
3910
+
3911
+ if (box) {
3912
+ this.$module.scene.viewAllWithBoundingBox(box);
3913
+ }
3914
+ }
3915
+ },
3916
+ setFocusedRegion: function setFocusedRegion(name) {
3917
+ if (name) {
3918
+ if (this.isReady) {
3919
+ this.viewRegion(name);
3920
+ } else {
3921
+ this.$module.setFinishDownloadCallback(this.setURLFinishCallback({
3922
+ region: name
3923
+ }));
3924
+ }
3925
+ }
3926
+ },
3927
+ updateViewURL: function updateViewURL(viewURL) {
3928
+ if (viewURL) {
3929
+ if (this.isReady) {
3930
+ var url = new URL(viewURL, this.url);
3931
+ this.$module.scene.loadViewURL(url);
3932
+ } else {
3933
+ this.$module.setFinishDownloadCallback(this.setURLFinishCallback({
3934
+ viewURL: viewURL
3935
+ }));
3936
+ }
3937
+ }
3938
+ },
3939
+
3940
+ /**
3941
+ * Function used to rotate the scene.
3942
+ * Also called when the associated button is pressed.
3943
+ *
3944
+ * @public
3945
+ */
3946
+ freeSpin: function freeSpin() {
3947
+ if (this.$module.scene) {
3948
+ var cameracontrol = this.$module.scene.getZincCameraControls();
3949
+ this.isTransitioning = true;
3950
+ cameracontrol.enableAutoTumble();
3951
+ cameracontrol.autoTumble([1.0, 0.0], Math.PI, true);
3952
+ setTimeout(this.stopFreeSpin, 4000);
3953
+ }
3954
+ },
3955
+
3956
+ /**
3957
+ * Callback when a region is selected/highlighted.
3958
+ * It will also update other controls.
3959
+ */
3960
+ eventNotifierCallback: function eventNotifierCallback(event) {
3961
+ if (event.eventType == 1) {
3962
+ if (this.$refs.traditionalControl) {
3963
+ if (event.identifiers[0]) {
3964
+ var id = event.identifiers[0].data.id ? event.identifiers[0].data.id : event.identifiers[0].data.group;
3965
+ this.$refs.traditionalControl.changeActiveByName(id);
3966
+ } else {
3967
+ this.$refs.traditionalControl.removeActive();
3968
+ }
3969
+ }
3970
+ /**
3971
+ * Triggers when an object has been selected
3972
+ *
3973
+ * @property {array} identifiers array of identifiers
3974
+ * of selected object.
3975
+ */
3976
+
3977
+
3978
+ this.$emit("scaffold-selected", event.identifiers);
3979
+ } else if (event.eventType == 2) {
3980
+ if (this.$refs.traditionalControl) {
3981
+ if (event.identifiers[0]) {
3982
+ var _id = event.identifiers[0].data.id ? event.identifiers[0].data.id : event.identifiers[0].data.group;
3983
+
3984
+ this.$refs.traditionalControl.changeHoverByName(_id);
3985
+ } else this.$refs.traditionalControl.removeHover();
3986
+ }
3987
+ /**
3988
+ * Triggers when an object has been highlighted
3989
+ *
3990
+ * @property {array} identifiers array of identifiers
3991
+ * of highlighted object.
3992
+ */
3993
+
3994
+
3995
+ this.$emit("scaffold-highlighted", event.identifiers);
3996
+ }
3997
+ },
3998
+
3999
+ /**
4000
+ * Get the coordinates of the current selected region.
4001
+ *
4002
+ * @public
4003
+ */
4004
+ getCoordinatesOfSelected: function getCoordinatesOfSelected() {
4005
+ if (this.selectedObject) {
4006
+ return this.$module.scene.getObjectsScreenXY([this.selectedObject]);
4007
+ }
4008
+
4009
+ return undefined;
4010
+ },
4011
+
4012
+ /**
4013
+ * Return an object containing the window coordinates of the
4014
+ * current selected region which will be updated after each render
4015
+ * loop.
4016
+ *
4017
+ * @public
4018
+ */
4019
+ getDynamicSelectedCoordinates: function getDynamicSelectedCoordinates() {
4020
+ return this.$module.selectedScreenCoordinates;
4021
+ },
4022
+
4023
+ /**
4024
+ * Callback when time is changed through the UI.
4025
+ */
4026
+ timeChange: function timeChange(event) {
4027
+ var normalizedTime = event / this.timeMax * 100;
4028
+ if (normalizedTime != this.sceneData.currentTime) this.$module.updateTime(normalizedTime);
4029
+ },
4030
+
4031
+ /**
4032
+ * A callback used by children components. Set the selected zinc object
4033
+ *
4034
+ * @param {object} object Zinc object
4035
+ */
4036
+ objectSelected: function objectSelected(object) {
4037
+ if (object !== this.selectedObject) {
4038
+ this.selectedObject = object;
4039
+ this.$refs.opacityControl.setObject(this.selectedObject);
4040
+ if (object) this.$module.setSelectedByZincObject(object, true);else this.$module.setSelectedByObjects([], true);
4041
+ }
4042
+ },
4043
+
4044
+ /**
4045
+ * A callback used by children components. Set the highlighted zinc object
4046
+ *
4047
+ * @param {object} object Zinc object
4048
+ */
4049
+ objectHovered: function objectHovered(object) {
4050
+ if (object !== this.hoveredObject) {
4051
+ this.hoveredObject = object;
4052
+ if (object) this.$module.setHighlightedByZincObject(object, true);else this.$module.setHighlightedByObjects([], true);
4053
+ }
4054
+ },
4055
+
4056
+ /**
4057
+ * Set the selected by name.
4058
+ *
4059
+ * @param {name} name Name of the region
4060
+ */
4061
+ changeActiveByName: function changeActiveByName(name) {
4062
+ this.$refs.traditionalControl.changeActiveByName(name);
4063
+ if (name === undefined) this.$refs.traditionalControl.removeActive();
4064
+ },
4065
+
4066
+ /**
4067
+ * Set the highlighted by name.
4068
+ *
4069
+ * @param {name} name Name of the region
4070
+ */
4071
+ changeHighlightedByName: function changeHighlightedByName(name) {
4072
+ this.$refs.traditionalControl.changeHoverByName(name);
4073
+ if (name === undefined) this.$refs.traditionalControl.removeHover();
4074
+ },
4075
+
4076
+ /**
4077
+ * Start the animation.
4078
+ *
4079
+ * @param {object} object Zinc object
4080
+ */
4081
+ play: function play(flag) {
4082
+ this.$module.playAnimation(flag);
4083
+ this.isPlaying = flag;
4084
+ },
4085
+
4086
+ /**
4087
+ * Function to toggle on/off overlay help.
4088
+ */
4089
+ setHelpMode: function setHelpMode(helpMode) {
4090
+ if (helpMode) {
4091
+ this.inHelp = true;
4092
+ this.hoverVisabilities.forEach(function (item) {
4093
+ item.value = true;
4094
+ });
4095
+ } else {
4096
+ this.inHelp = false;
4097
+ this.hoverVisabilities.forEach(function (item) {
4098
+ item.value = false;
4099
+ });
4100
+ }
4101
+ },
4102
+
4103
+ /**
4104
+ * This is called when mouse cursor enters supported elements
4105
+ * with help tootltips.
4106
+ */
4107
+ showToolitip: function showToolitip(tooltipNumber) {
4108
+ var _this = this;
4109
+
4110
+ if (!this.inHelp) {
4111
+ this.tooltipWait = setTimeout(function () {
4112
+ _this.hoverVisabilities[tooltipNumber].value = true;
4113
+ }, 500);
4114
+ }
4115
+ },
4116
+
4117
+ /**
4118
+ * This is called when mouse cursor exits supported element..
4119
+ */
4120
+ hideToolitip: function hideToolitip(tooltipNumber) {
4121
+ if (!this.inHelp) {
4122
+ this.hoverVisabilities[tooltipNumber].value = false;
4123
+ clearTimeout(this.tooltipWait);
4124
+ }
4125
+ },
4126
+
4127
+ /**
4128
+ * Called when minimap settings has changed. Pass the
4129
+ * parameters to ZincJS and marked it for update.
4130
+ */
4131
+ updateMinimapScissor: function updateMinimapScissor() {
4132
+ var _this2 = this;
4133
+
4134
+ Object.keys(this.minimapSettings).forEach(function (key) {
4135
+ _this2.$module.scene.minimapScissor[key] = _this2.minimapSettings[key];
4136
+ });
4137
+ this.$module.scene.minimapScissor.updateRequired = true;
4138
+ },
4139
+ updateSettingsfromScene: function updateSettingsfromScene() {
4140
+ this.currentSpeed = 1;
4141
+ this.$module.setPlayRate(this.defaultRate);
4142
+ this.orginalDuration = this.$module.scene.getMetadataTag("OriginalDuration");
4143
+ this.animateDuration = this.$module.scene.getMetadataTag("Duration");
4144
+ var timeStamps = this.$module.scene.getMetadataTag("TimeStamps");
4145
+ this.timeStamps = {};
4146
+
4147
+ for (var key in timeStamps) {
4148
+ this.timeStamps[timeStamps[key]] = key;
4149
+ }
4150
+
4151
+ this.timeMax = this.$module.scene.getDuration();
4152
+ },
4153
+ setURLFinishCallback: function setURLFinishCallback(options) {
4154
+ var _this3 = this;
4155
+
4156
+ return function () {
4157
+ if (options) {
4158
+ if (options.viewport) {
4159
+ _this3.$module.scene.getZincCameraControls().setCurrentCameraSettings(options.viewport);
4160
+ } else if (options.viewURL && options.viewURL !== "") {
4161
+ var url = new URL(options.viewURL, _this3.url);
4162
+
4163
+ _this3.$module.scene.loadViewURL(url);
4164
+ } else if (options.region && options.region !== "") {
4165
+ _this3.viewRegion(options.region);
4166
+ }
4167
+
4168
+ if (options.visibility) {
4169
+ // Some UIs may not be ready at this time.
4170
+ _this3.$nextTick(function () {
4171
+ _this3.$refs.traditionalControl.setState(options.visibility);
4172
+ });
4173
+ }
4174
+ }
4175
+
4176
+ _this3.updateSettingsfromScene();
4177
+
4178
+ _this3.$module.updateTime(0.01);
4179
+
4180
+ _this3.$module.updateTime(0);
4181
+
4182
+ _this3.$module.unsetFinishDownloadCallback();
4183
+
4184
+ _this3.isReady = true;
4185
+ };
4186
+ },
4187
+
4188
+ /**
4189
+ * Function used for getting the current states of the scene. This exported states
4190
+ * can be imported using the importStates method.
4191
+ *
4192
+ * @public
4193
+ */
4194
+ getState: function getState() {
4195
+ var state = {
4196
+ url: this._currentURL,
4197
+ viewport: undefined,
4198
+ visibility: undefined
4199
+ };
4200
+ if (this.$refs.traditionalControl) state.visibility = this.$refs.traditionalControl.getState();
4201
+
4202
+ if (this.$module.scene) {
4203
+ var zincCameraControls = this.$module.scene.getZincCameraControls();
4204
+ state.viewport = zincCameraControls.getCurrentViewport();
4205
+ }
4206
+
4207
+ return state;
4208
+ },
4209
+
4210
+ /**
4211
+ * Function used for importing the states of the scene. This exported states
4212
+ * can be imported using the read states method.
4213
+ *
4214
+ * @public
4215
+ */
4216
+ setState: function setState(state) {
4217
+ if (state) {
4218
+ if (state.url && state.url !== this._currentURL) {
4219
+ this.setURLAndState(state.url, {
4220
+ viewport: state.viewport,
4221
+ visibility: state.visibility
4222
+ });
4223
+ } else {
4224
+ if (state.viewport || state.visibility) {
4225
+ if (this.isReady && this.$module.scene) {
4226
+ if (state.viewport) this.$module.scene.getZincCameraControls().setCurrentCameraSettings(state.viewport);
4227
+ if (state.visibility) this.$refs.traditionalControl.setState(state.visibility);
4228
+ } else {
4229
+ this.$module.setFinishDownloadCallback(this.setURLFinishCallback({
4230
+ viewport: state.viewport,
4231
+ visibility: state.visibility
4232
+ }));
4233
+ }
4234
+ }
4235
+ }
4236
+ }
4237
+ },
4238
+ exportGLTF: function exportGLTF(binary) {
4239
+ return this.$module.scene.exportGLTF(binary);
4240
+ },
4241
+
4242
+ /**
4243
+ * Function used for reading in new scaffold metadata and a custom
4244
+ * viewport. This function will ignore the state prop and
4245
+ * read in the new url.
4246
+ *
4247
+ * @public
4248
+ */
4249
+ setURLAndState: function setURLAndState(newValue, state) {
4250
+ if (newValue != this._currentURL) {
4251
+ var viewport = state && state.viewport ? state.viewport : undefined;
4252
+ var visibility = state && state.visibility ? state.visibility : undefined;
4253
+ this._currentURL = newValue;
4254
+ if (this.$refs.traditionalControl) this.$refs.traditionalControl.clear();
4255
+ this.loading = true;
4256
+ this.isReady = false;
4257
+ this.$module.setFinishDownloadCallback(this.setURLFinishCallback({
4258
+ viewport: viewport,
4259
+ region: this.region,
4260
+ viewURL: this.viewURL,
4261
+ visibility: visibility
4262
+ }));
4263
+ this.$module.loadOrgansFromURL(newValue, undefined, undefined, "scene", undefined);
4264
+ this.$module.scene.displayMarkers = this.displayMarkers;
4265
+ this.$module.scene.displayMinimap = this.displayMinimap;
4266
+ this.updateMinimapScissor();
4267
+ }
4268
+ },
4269
+
4270
+ /**
4271
+ * Function used for reading in new scaffold metadata. This function will ignore
4272
+ * the state prop and read in the new url.
4273
+ *
4274
+ * @public
4275
+ */
4276
+ setURL: function setURL(newValue) {
4277
+ this.setURLAndState(newValue, undefined);
4278
+ },
4279
+
4280
+ /**
4281
+ * Callback when drawer is toggled.
4282
+ *
4283
+ */
4284
+ drawerToggled: function drawerToggled(flag) {
4285
+ this.drawerOpen = flag;
4286
+ this.adjustLayout();
4287
+ },
4288
+
4289
+ /**
4290
+ * Callback using ResizeObserver.
4291
+
4292
+ */
4293
+ adjustLayout: function adjustLayout() {
4294
+ var width = this.$refs.scaffoldContainer.clientWidth;
4295
+ this.minimisedSlider = width < 812;
4296
+
4297
+ if (this.minimisedSlider) {
4298
+ this.sliderPosition = this.drawerOpen ? "right" : "left";
4299
+ } else {
4300
+ this.sliderPosition = "";
4301
+ }
4302
+ },
4303
+ toggleRendering: function toggleRendering(flag) {
4304
+ if (this.$module.zincRenderer) {
4305
+ if (flag) {
4306
+ this.$module.zincRenderer.animate();
4307
+ } else {
4308
+ this.$module.zincRenderer.stopAnimate();
4309
+ }
4310
+ }
4311
+ },
4312
+ forceResize: function forceResize() {
4313
+ if (this.$module.zincRenderer) {
4314
+ this.$module.zincRenderer.onWindowResize();
4315
+ }
4316
+ }
4317
+ }
4318
+ });
4319
+ // CONCATENATED MODULE: ./src/components/ScaffoldVuer.vue?vue&type=script&lang=js&
4320
+ /* harmony default export */ var components_ScaffoldVuervue_type_script_lang_js_ = (ScaffoldVuervue_type_script_lang_js_);
4321
+ // EXTERNAL MODULE: ./src/components/ScaffoldVuer.vue?vue&type=style&index=0&id=1b66f0b7&scoped=true&lang=scss&
4322
+ var ScaffoldVuervue_type_style_index_0_id_1b66f0b7_scoped_true_lang_scss_ = __webpack_require__("fb06");
4323
+
4324
+ // EXTERNAL MODULE: ./src/components/ScaffoldVuer.vue?vue&type=style&index=1&lang=scss&
4325
+ var ScaffoldVuervue_type_style_index_1_lang_scss_ = __webpack_require__("642d");
4326
+
4327
+ // CONCATENATED MODULE: ./src/components/ScaffoldVuer.vue
4328
+
4329
+
4330
+
4331
+
4332
+
4333
+
4334
+
4335
+ /* normalize component */
4336
+
4337
+ var ScaffoldVuer_component = normalizeComponent(
4338
+ components_ScaffoldVuervue_type_script_lang_js_,
4339
+ render,
4340
+ staticRenderFns,
4341
+ false,
4342
+ null,
4343
+ "1b66f0b7",
4344
+ null
4345
+
4346
+ )
4347
+
4348
+ /* harmony default export */ var ScaffoldVuer = (ScaffoldVuer_component.exports);
4349
+ // CONCATENATED MODULE: ./src/components/index.js
4350
+ // The Vue build version to load with the `import` command
4351
+ // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
4352
+
4353
+
4354
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js
4355
+
4356
+
4357
+
4358
+
4359
+ /***/ }),
4360
+
4361
+ /***/ "fb06":
4362
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4363
+
4364
+ "use strict";
4365
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ScaffoldVuer_vue_vue_type_style_index_0_id_1b66f0b7_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("d7e1");
4366
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ScaffoldVuer_vue_vue_type_style_index_0_id_1b66f0b7_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ScaffoldVuer_vue_vue_type_style_index_0_id_1b66f0b7_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
4367
+ /* unused harmony reexport * */
4368
+
4369
+
4370
+ /***/ }),
4371
+
4372
+ /***/ "fd48":
4373
+ /***/ (function(module, exports) {
4374
+
4375
+ module.exports = require("core-js/modules/es.string.includes");
4376
+
4377
+ /***/ }),
4378
+
4379
+ /***/ "fd9c":
4380
+ /***/ (function(module, exports) {
4381
+
4382
+ module.exports = require("element-ui/lib/theme-chalk/row.css");
4383
+
4384
+ /***/ })
4385
+
4386
+ /******/ });
4387
+ });
4388
+ //# sourceMappingURL=scaffoldvuer.umd.js.map