@abi-software/scaffoldvuer 1.21.1-beta.2 → 2.0.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.
- package/README.md +31 -12
- package/dist/index.html +9 -6
- package/dist/scaffoldvuer.js +14095 -13154
- package/dist/scaffoldvuer.umd.cjs +48 -48
- package/dist/style.css +1 -1
- package/eslint.config.js +37 -9
- package/package.json +10 -3
- package/public/index.html +9 -6
- package/src/App.vue +312 -279
- package/src/ScaffoldVuer-wc.js +4 -4
- package/src/app/DropZone.vue +11 -27
- package/src/app/ModelsInformation.js +22 -19
- package/src/app/ModelsTable.vue +42 -65
- package/src/app/TextureDemos.js +38 -64
- package/src/assets/_variables.scss +12 -10
- package/src/components/GlyphsControls.vue +3 -23
- package/src/components/LinesControls.vue +27 -66
- package/src/components/OpacityControls.vue +22 -26
- package/src/components/PointsControls.vue +20 -71
- package/src/components/PrimitiveControls.vue +35 -49
- package/src/components/ScaffoldOverlay.vue +63 -63
- package/src/components/ScaffoldTooltip.vue +36 -49
- package/src/components/ScaffoldTreeControls.vue +81 -129
- package/src/components/ScaffoldVuer.vue +509 -498
- package/src/components/TextureSlidesControls.vue +22 -64
- package/src/components/TransformationControls.vue +15 -42
- package/src/components/index.js +2 -2
- package/src/main.js +16 -18
- package/src/scripts/Annotation.js +3 -3
- package/src/scripts/BaseModule.js +26 -30
- package/src/scripts/EventNotifier.js +30 -36
- package/src/scripts/GraphicsHighlight.js +43 -50
- package/src/scripts/LocalFilesHelper.js +27 -26
- package/src/scripts/MappedNerves.js +2139 -697
- package/src/scripts/MappedOrgans.js +24 -25
- package/src/scripts/OrgansRenderer.js +445 -425
- package/src/scripts/RendererModule.js +133 -122
- package/src/scripts/Search.js +135 -151
- package/src/scripts/Utilities.js +129 -127
- package/src/scripts/WebGL.js +57 -91
- package/src/scripts/niftiHelper.js +3 -3
- package/src/store/index.js +7 -7
- package/vite.config.js +51 -50
- package/vite.static-build.js +7 -7
- package/vuese-generator.js +48 -56
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="tree-controls" :class="{ open: drawerOpen, close: !drawerOpen }">
|
|
3
3
|
<div class="tree-controls-scroll">
|
|
4
|
-
<div class="tree-controls-container"
|
|
5
|
-
:style="{ 'max-height': `${maxHeight}px` }">
|
|
4
|
+
<div class="tree-controls-container" :style="{ 'max-height': `${maxHeight}px` }">
|
|
6
5
|
<slot name="treeSlot"></slot>
|
|
7
6
|
<TreeControls
|
|
8
7
|
mapType="scaffold"
|
|
@@ -24,7 +23,7 @@
|
|
|
24
23
|
<div
|
|
25
24
|
class="drawer-button"
|
|
26
25
|
:class="{ open: drawerOpen, close: !drawerOpen }"
|
|
27
|
-
:style="{
|
|
26
|
+
:style="{ bottom: `${drawerBottom}px` }"
|
|
28
27
|
@click="toggleDrawer"
|
|
29
28
|
>
|
|
30
29
|
<el-icon><el-icon-arrow-left /></el-icon>
|
|
@@ -33,17 +32,16 @@
|
|
|
33
32
|
</template>
|
|
34
33
|
|
|
35
34
|
<script>
|
|
36
|
-
|
|
37
|
-
import { ArrowLeft as ElIconArrowLeft } from "@element-plus/icons-vue";
|
|
35
|
+
import { ArrowLeft as ElIconArrowLeft } from '@element-plus/icons-vue';
|
|
38
36
|
import {
|
|
39
37
|
convertUUIDsToFullPaths,
|
|
40
38
|
createListFromPrimitives,
|
|
41
39
|
extractAllFullPaths,
|
|
42
40
|
findObjectsWithNames,
|
|
43
|
-
} from
|
|
44
|
-
import { TreeControls } from
|
|
45
|
-
import
|
|
46
|
-
import { markRaw } from
|
|
41
|
+
} from '../scripts/Utilities.js';
|
|
42
|
+
import { TreeControls } from '@abi-software/map-utilities';
|
|
43
|
+
import '@abi-software/map-utilities/dist/style.css';
|
|
44
|
+
import { markRaw } from 'vue';
|
|
47
45
|
|
|
48
46
|
const nameSorting = (a, b) => {
|
|
49
47
|
const labelA = a.label.toUpperCase();
|
|
@@ -61,7 +59,7 @@ const nameSorting = (a, b) => {
|
|
|
61
59
|
* A vue component for toggling visibility of various regions.
|
|
62
60
|
*/
|
|
63
61
|
export default {
|
|
64
|
-
name:
|
|
62
|
+
name: 'ScaffoldTreeControls',
|
|
65
63
|
components: {
|
|
66
64
|
ElIconArrowLeft,
|
|
67
65
|
TreeControls,
|
|
@@ -76,9 +74,7 @@ export default {
|
|
|
76
74
|
},
|
|
77
75
|
data: function () {
|
|
78
76
|
return {
|
|
79
|
-
treeData: [
|
|
80
|
-
{ label: "Root", regionPath: "", id: undefined, children: [] },
|
|
81
|
-
],
|
|
77
|
+
treeData: [{ label: 'Root', regionPath: '', id: undefined, children: [] }],
|
|
82
78
|
active: [],
|
|
83
79
|
hover: [],
|
|
84
80
|
drawerOpen: true,
|
|
@@ -88,13 +84,13 @@ export default {
|
|
|
88
84
|
};
|
|
89
85
|
},
|
|
90
86
|
computed: {
|
|
91
|
-
drawerBottom: function() {
|
|
87
|
+
drawerBottom: function () {
|
|
92
88
|
if (100 > this.maxHeight) {
|
|
93
89
|
return this.maxHeight;
|
|
94
90
|
}
|
|
95
91
|
return 100;
|
|
96
92
|
},
|
|
97
|
-
maxHeight: function() {
|
|
93
|
+
maxHeight: function () {
|
|
98
94
|
let height = this.containerHeight - 114;
|
|
99
95
|
if (0 > height) {
|
|
100
96
|
height = 0;
|
|
@@ -129,27 +125,25 @@ export default {
|
|
|
129
125
|
*/
|
|
130
126
|
},
|
|
131
127
|
methods: {
|
|
132
|
-
setCheckboxDisabled: function(data, flag, childrenOnly) {
|
|
128
|
+
setCheckboxDisabled: function (data, flag, childrenOnly) {
|
|
133
129
|
if (data) {
|
|
134
130
|
if (!childrenOnly) {
|
|
135
131
|
data.disabled = flag;
|
|
136
132
|
}
|
|
137
133
|
if (data.children) {
|
|
138
|
-
data.children.forEach(child =>
|
|
139
|
-
this.setCheckboxDisabled(child, flag, false)
|
|
140
|
-
);
|
|
134
|
+
data.children.forEach((child) => this.setCheckboxDisabled(child, flag, false));
|
|
141
135
|
}
|
|
142
136
|
}
|
|
143
137
|
},
|
|
144
138
|
setRegionCheckboxDisabled: function (region, flag, childrenOnly) {
|
|
145
139
|
if (this.treeData[0] && region?.uuid) {
|
|
146
|
-
const data = this.findDataWithId(this.treeData[0], region?.uuid)
|
|
140
|
+
const data = this.findDataWithId(this.treeData[0], region?.uuid);
|
|
147
141
|
if (data) {
|
|
148
142
|
this.setCheckboxDisabled(data, flag, childrenOnly);
|
|
149
143
|
}
|
|
150
144
|
}
|
|
151
145
|
},
|
|
152
|
-
findDataWithId: function(data, uuid) {
|
|
146
|
+
findDataWithId: function (data, uuid) {
|
|
153
147
|
if (data) {
|
|
154
148
|
if (data.id === uuid) {
|
|
155
149
|
return data;
|
|
@@ -176,8 +170,7 @@ export default {
|
|
|
176
170
|
});
|
|
177
171
|
this.nodeNumbers++;
|
|
178
172
|
this.$nextTick(() => {
|
|
179
|
-
const checked =
|
|
180
|
-
this.$refs.treeControls.$refs.regionTree.getCheckedKeys();
|
|
173
|
+
const checked = this.$refs.treeControls.$refs.regionTree.getCheckedKeys();
|
|
181
174
|
if (!checked.includes(item.id) && object.getVisibility()) {
|
|
182
175
|
this.$refs.treeControls.$refs.regionTree.setChecked(item.id, true);
|
|
183
176
|
}
|
|
@@ -193,13 +186,9 @@ export default {
|
|
|
193
186
|
}
|
|
194
187
|
if (paths.length > 0) {
|
|
195
188
|
const _paths = [...paths];
|
|
196
|
-
let childRegionItem = data.children.find(
|
|
197
|
-
|
|
198
|
-
);
|
|
199
|
-
const path = prefix + "/" + paths[0];
|
|
200
|
-
const region = this.module.scene
|
|
201
|
-
.getRootRegion()
|
|
202
|
-
.findChildFromPath(path);
|
|
189
|
+
let childRegionItem = data.children.find((child) => child.label == _paths[0]);
|
|
190
|
+
const path = prefix + '/' + paths[0];
|
|
191
|
+
const region = this.module.scene.getRootRegion().findChildFromPath(path);
|
|
203
192
|
if (!childRegionItem) {
|
|
204
193
|
childRegionItem = {
|
|
205
194
|
label: _paths[0],
|
|
@@ -210,7 +199,7 @@ export default {
|
|
|
210
199
|
};
|
|
211
200
|
this.addTreeItem(data.children, childRegionItem, region);
|
|
212
201
|
//Special case for helper region
|
|
213
|
-
if (path ===
|
|
202
|
+
if (path === '/_helper') {
|
|
214
203
|
this.$nextTick(() => {
|
|
215
204
|
this.$refs.treeControls.$refs.regionTree.setChecked(childRegionItem.id, false);
|
|
216
205
|
});
|
|
@@ -244,7 +233,7 @@ export default {
|
|
|
244
233
|
const region = zincObject.region;
|
|
245
234
|
if (region) {
|
|
246
235
|
const paths = region.getFullSeparatedPath();
|
|
247
|
-
const regionData = this.findOrCreateRegion(this.treeData[0], paths,
|
|
236
|
+
const regionData = this.findOrCreateRegion(this.treeData[0], paths, '');
|
|
248
237
|
if (zincObject.groupName) {
|
|
249
238
|
if (regionData) {
|
|
250
239
|
if (!regionData.children) {
|
|
@@ -253,7 +242,7 @@ export default {
|
|
|
253
242
|
const child = {
|
|
254
243
|
disabled: false,
|
|
255
244
|
label: zincObject.groupName,
|
|
256
|
-
id: region.uuid +
|
|
245
|
+
id: region.uuid + '/' + zincObject.uuid,
|
|
257
246
|
isPrimitives: true,
|
|
258
247
|
regionPath: zincObject.region.getFullPath(),
|
|
259
248
|
isTextureSlides: zincObject.isTextureSlides ? true : false,
|
|
@@ -263,9 +252,9 @@ export default {
|
|
|
263
252
|
}
|
|
264
253
|
}
|
|
265
254
|
},
|
|
266
|
-
removeGroupFromRegionTreeData: function(region, groupName) {
|
|
255
|
+
removeGroupFromRegionTreeData: function (region, groupName) {
|
|
267
256
|
const paths = region.getFullSeparatedPath();
|
|
268
|
-
const regionData = this.findOrCreateRegion(this.treeData[0], paths,
|
|
257
|
+
const regionData = this.findOrCreateRegion(this.treeData[0], paths, '');
|
|
269
258
|
for (let i = 0; i < regionData.children.length; i++) {
|
|
270
259
|
if (regionData.children[i].label === groupName) {
|
|
271
260
|
regionData.children.splice(i, 1);
|
|
@@ -274,14 +263,14 @@ export default {
|
|
|
274
263
|
}
|
|
275
264
|
}
|
|
276
265
|
},
|
|
277
|
-
zincObjectRenamed: function(zincObject, oldName) {
|
|
266
|
+
zincObjectRenamed: function (zincObject, oldName) {
|
|
278
267
|
const objects = zincObject.region.findObjectsWithGroupName(oldName, false);
|
|
279
268
|
if (objects.length < 1) {
|
|
280
269
|
this.removeGroupFromRegionTreeData(zincObject.region, oldName);
|
|
281
270
|
}
|
|
282
271
|
this.zincObjectAdded(zincObject);
|
|
283
272
|
},
|
|
284
|
-
zincObjectRemoved: function(zincObject) {
|
|
273
|
+
zincObjectRemoved: function (zincObject) {
|
|
285
274
|
const group = zincObject.groupName;
|
|
286
275
|
const objects = zincObject.region.findObjectsWithGroupName(group, false);
|
|
287
276
|
if (objects.length === 0) {
|
|
@@ -292,9 +281,7 @@ export default {
|
|
|
292
281
|
const isRegion = node.isRegion;
|
|
293
282
|
const isPrimitives = node.isPrimitives;
|
|
294
283
|
const isChecked = data.checkedKeys.includes(node.id);
|
|
295
|
-
const region = this.module.scene
|
|
296
|
-
.getRootRegion()
|
|
297
|
-
.findChildFromPath(node.regionPath);
|
|
284
|
+
const region = this.module.scene.getRootRegion().findChildFromPath(node.regionPath);
|
|
298
285
|
if (isRegion) {
|
|
299
286
|
if (isChecked) {
|
|
300
287
|
region.showAllPrimitives();
|
|
@@ -303,7 +290,7 @@ export default {
|
|
|
303
290
|
region.hideAllPrimitives();
|
|
304
291
|
//this.checkedRegions = this.checkedRegions.filter(region => region.label !== node.label);
|
|
305
292
|
}
|
|
306
|
-
this.$emit(
|
|
293
|
+
this.$emit('check-changed', { region, isChecked });
|
|
307
294
|
}
|
|
308
295
|
if (isPrimitives) {
|
|
309
296
|
const primitives = region.findObjectsWithGroupName(node.label);
|
|
@@ -311,7 +298,7 @@ export default {
|
|
|
311
298
|
const visibility = isChecked && !node.disabled;
|
|
312
299
|
primitive.setVisibility(visibility);
|
|
313
300
|
});
|
|
314
|
-
this.$emit(
|
|
301
|
+
this.$emit('check-changed', { zincObjects: primitives, isChecked });
|
|
315
302
|
}
|
|
316
303
|
},
|
|
317
304
|
updateActiveUI: function (primitives) {
|
|
@@ -321,7 +308,7 @@ export default {
|
|
|
321
308
|
changeActiveByPrimitives: function (primitives, propagate) {
|
|
322
309
|
if (primitives && primitives.length > 0) {
|
|
323
310
|
this.updateActiveUI(primitives);
|
|
324
|
-
this.$emit(
|
|
311
|
+
this.$emit('object-selected', primitives, propagate);
|
|
325
312
|
} else {
|
|
326
313
|
this.removeActive(propagate);
|
|
327
314
|
}
|
|
@@ -334,7 +321,7 @@ export default {
|
|
|
334
321
|
changeHoverByPrimitives: function (primitives, propagate) {
|
|
335
322
|
if (primitives && primitives.length > 0) {
|
|
336
323
|
this.updateHoverUI(primitives);
|
|
337
|
-
this.$emit(
|
|
324
|
+
this.$emit('object-hovered', primitives, propagate);
|
|
338
325
|
} else {
|
|
339
326
|
this.removeHover(propagate);
|
|
340
327
|
}
|
|
@@ -344,12 +331,7 @@ export default {
|
|
|
344
331
|
*/
|
|
345
332
|
changeActiveByNames: function (names, regionPath, propagate) {
|
|
346
333
|
const rootRegion = this.module.scene.getRootRegion();
|
|
347
|
-
const targetObjects = findObjectsWithNames(
|
|
348
|
-
rootRegion,
|
|
349
|
-
names,
|
|
350
|
-
regionPath,
|
|
351
|
-
true
|
|
352
|
-
);
|
|
334
|
+
const targetObjects = findObjectsWithNames(rootRegion, names, regionPath, true);
|
|
353
335
|
this.changeActiveByPrimitives(targetObjects, propagate);
|
|
354
336
|
},
|
|
355
337
|
/**
|
|
@@ -357,12 +339,7 @@ export default {
|
|
|
357
339
|
*/
|
|
358
340
|
changeHoverByNames: function (names, regionPath, propagate) {
|
|
359
341
|
const rootRegion = this.module.scene.getRootRegion();
|
|
360
|
-
const targetObjects = findObjectsWithNames(
|
|
361
|
-
rootRegion,
|
|
362
|
-
names,
|
|
363
|
-
regionPath,
|
|
364
|
-
true
|
|
365
|
-
);
|
|
342
|
+
const targetObjects = findObjectsWithNames(rootRegion, names, regionPath, true);
|
|
366
343
|
this.changeHoverByPrimitives(targetObjects, propagate);
|
|
367
344
|
},
|
|
368
345
|
changeActiveByNode: function (node, propagate) {
|
|
@@ -383,14 +360,14 @@ export default {
|
|
|
383
360
|
*/
|
|
384
361
|
removeActive: function (propagate) {
|
|
385
362
|
this.active = [];
|
|
386
|
-
this.$emit(
|
|
363
|
+
this.$emit('object-selected', [], propagate);
|
|
387
364
|
},
|
|
388
365
|
/**
|
|
389
366
|
* Unselect the current hover region.
|
|
390
367
|
*/
|
|
391
368
|
removeHover: function (propagate) {
|
|
392
369
|
this.hover = [];
|
|
393
|
-
this.$emit(
|
|
370
|
+
this.$emit('object-hovered', [], propagate);
|
|
394
371
|
},
|
|
395
372
|
/**
|
|
396
373
|
* Reset the controls.
|
|
@@ -399,21 +376,23 @@ export default {
|
|
|
399
376
|
this.active.length = 0;
|
|
400
377
|
this.hover.length = 0;
|
|
401
378
|
this.nodeNumbers = 0;
|
|
402
|
-
this.$refs.treeControls.$refs.regionTree.updateKeyChildren(
|
|
403
|
-
this.treeData[0].id,
|
|
404
|
-
[]
|
|
405
|
-
);
|
|
379
|
+
this.$refs.treeControls.$refs.regionTree.updateKeyChildren(this.treeData[0].id, []);
|
|
406
380
|
this.treeData[0].children.length = 0;
|
|
407
381
|
this.treeData[0].id = undefined;
|
|
408
|
-
this.$emit(
|
|
382
|
+
this.$emit('object-selected', []);
|
|
409
383
|
},
|
|
410
|
-
forEachChildInNode: function(node, checkedList, regionPath, parentsAreVisible, callback) {
|
|
384
|
+
forEachChildInNode: function (node, checkedList, regionPath, parentsAreVisible, callback) {
|
|
411
385
|
if (node.isRegion) {
|
|
412
386
|
if (node.children) {
|
|
413
387
|
const isVisible = regionPath === '' || checkedList.includes(node.id);
|
|
414
|
-
node.children.forEach(
|
|
415
|
-
|
|
416
|
-
child,
|
|
388
|
+
node.children.forEach((child) =>
|
|
389
|
+
this.forEachChildInNode(
|
|
390
|
+
child,
|
|
391
|
+
checkedList,
|
|
392
|
+
node.regionPath,
|
|
393
|
+
parentsAreVisible && isVisible,
|
|
394
|
+
callback,
|
|
395
|
+
),
|
|
417
396
|
);
|
|
418
397
|
}
|
|
419
398
|
} else if (node.isPrimitives) {
|
|
@@ -427,10 +406,10 @@ export default {
|
|
|
427
406
|
let graphic = targetObjects[0];
|
|
428
407
|
if (graphic) {
|
|
429
408
|
let hex = graphic.getColourHex();
|
|
430
|
-
if (hex) return
|
|
409
|
+
if (hex) return '#' + hex;
|
|
431
410
|
}
|
|
432
411
|
}
|
|
433
|
-
return
|
|
412
|
+
return '#FFFFFF';
|
|
434
413
|
},
|
|
435
414
|
getNodeDataByRegionAndGroup: function (regin, group) {
|
|
436
415
|
for (const treeRegion of this.treeDataEntry) {
|
|
@@ -448,12 +427,7 @@ export default {
|
|
|
448
427
|
getZincObjectsFromNode: function (node, transverse) {
|
|
449
428
|
const rootRegion = this.module.scene.getRootRegion();
|
|
450
429
|
if (node.isPrimitives) {
|
|
451
|
-
return findObjectsWithNames(
|
|
452
|
-
rootRegion,
|
|
453
|
-
node.label,
|
|
454
|
-
node.regionPath,
|
|
455
|
-
transverse
|
|
456
|
-
);
|
|
430
|
+
return findObjectsWithNames(rootRegion, node.label, node.regionPath, transverse);
|
|
457
431
|
} else if (node.isRegion) {
|
|
458
432
|
if (node.regionPath) {
|
|
459
433
|
let targetRegion = rootRegion.findChildFromPath(node.regionPath);
|
|
@@ -495,10 +469,10 @@ export default {
|
|
|
495
469
|
const colour = this.getColour(data);
|
|
496
470
|
// Default colour will be used for reset colour action
|
|
497
471
|
if (!data.defaultColour) {
|
|
498
|
-
data[
|
|
472
|
+
data['defaultColour'] = colour;
|
|
499
473
|
}
|
|
500
474
|
// Active colour is used for current display
|
|
501
|
-
data[
|
|
475
|
+
data['activeColour'] = colour;
|
|
502
476
|
}
|
|
503
477
|
});
|
|
504
478
|
},
|
|
@@ -508,39 +482,35 @@ export default {
|
|
|
508
482
|
targetObjects.forEach((primitive) => {
|
|
509
483
|
// Click clear will return null, so set it to the default colour
|
|
510
484
|
const activeColour = value ? value : nodeData.defaultColour;
|
|
511
|
-
let hexString = activeColour.replace(
|
|
485
|
+
let hexString = activeColour.replace('#', '0x');
|
|
512
486
|
primitive.setColourHex(hexString);
|
|
513
487
|
this.setColourField(this.treeData[0].children, nodeData);
|
|
514
488
|
});
|
|
515
489
|
}
|
|
516
490
|
},
|
|
517
|
-
updateAllNodeColours: function() {
|
|
518
|
-
const checkedList =
|
|
519
|
-
this.$refs.treeControls.$refs.regionTree.getCheckedKeys();
|
|
491
|
+
updateAllNodeColours: function () {
|
|
492
|
+
const checkedList = this.$refs.treeControls.$refs.regionTree.getCheckedKeys();
|
|
520
493
|
this.forEachChildInNode(
|
|
521
494
|
this.treeData[0],
|
|
522
495
|
checkedList,
|
|
523
|
-
|
|
496
|
+
'',
|
|
524
497
|
true,
|
|
525
|
-
(node,
|
|
498
|
+
(node, _regionPath, _parentsAreVisible) => {
|
|
526
499
|
if (node.isPrimitives) {
|
|
527
500
|
node.activeColour = this.getColour(node);
|
|
528
501
|
}
|
|
529
|
-
}
|
|
502
|
+
},
|
|
530
503
|
);
|
|
531
504
|
},
|
|
532
|
-
setOutlines: function(flag) {
|
|
533
|
-
const checkedList =
|
|
534
|
-
this.$refs.treeControls.$refs.regionTree.getCheckedKeys();
|
|
505
|
+
setOutlines: function (flag) {
|
|
506
|
+
const checkedList = this.$refs.treeControls.$refs.regionTree.getCheckedKeys();
|
|
535
507
|
this.forEachChildInNode(
|
|
536
508
|
this.treeData[0],
|
|
537
509
|
checkedList,
|
|
538
|
-
|
|
510
|
+
'',
|
|
539
511
|
true,
|
|
540
512
|
(node, regionPath, parentsAreVisible) => {
|
|
541
|
-
const region = this.module.scene
|
|
542
|
-
.getRootRegion()
|
|
543
|
-
.findChildFromPath(regionPath);
|
|
513
|
+
const region = this.module.scene.getRootRegion().findChildFromPath(regionPath);
|
|
544
514
|
const primitives = region.findObjectsWithGroupName(node.label);
|
|
545
515
|
if (flag) {
|
|
546
516
|
primitives.forEach((primitive) => {
|
|
@@ -561,7 +531,7 @@ export default {
|
|
|
561
531
|
});
|
|
562
532
|
}
|
|
563
533
|
}
|
|
564
|
-
}
|
|
534
|
+
},
|
|
565
535
|
);
|
|
566
536
|
},
|
|
567
537
|
visibilityToggle: function (item, event) {
|
|
@@ -577,13 +547,13 @@ export default {
|
|
|
577
547
|
},
|
|
578
548
|
toggleDrawer: function () {
|
|
579
549
|
this.drawerOpen = !this.drawerOpen;
|
|
580
|
-
this.$emit(
|
|
550
|
+
this.$emit('drawer-toggled', this.drawerOpen);
|
|
581
551
|
},
|
|
582
552
|
//Set visibility using full paths and add found id to the ids list
|
|
583
553
|
//and remove item from list if remove is set to true.
|
|
584
|
-
setTreeVisibilityWithFullPaths: function (node, list, ids,
|
|
554
|
+
setTreeVisibilityWithFullPaths: function (node, list, ids, _remove) {
|
|
585
555
|
let flag = false;
|
|
586
|
-
let nodeName =
|
|
556
|
+
let nodeName = '';
|
|
587
557
|
if (node.isRegion) {
|
|
588
558
|
nodeName = `__r${node.regionPath}`;
|
|
589
559
|
}
|
|
@@ -597,10 +567,8 @@ export default {
|
|
|
597
567
|
list.splice(index, 1);
|
|
598
568
|
ids.push(node.id);
|
|
599
569
|
}
|
|
600
|
-
const region = this.module.scene
|
|
601
|
-
|
|
602
|
-
.findChildFromPath(node.regionPath);
|
|
603
|
-
if (nodeName && nodeName !== "__r") {
|
|
570
|
+
const region = this.module.scene.getRootRegion().findChildFromPath(node.regionPath);
|
|
571
|
+
if (nodeName && nodeName !== '__r') {
|
|
604
572
|
if (node.isPrimitives) {
|
|
605
573
|
const primitives = region.findObjectsWithGroupName(node.label);
|
|
606
574
|
primitives.forEach((primitive) => primitive.setVisibility(flag));
|
|
@@ -621,7 +589,7 @@ export default {
|
|
|
621
589
|
// the number will be much less than all node ids
|
|
622
590
|
ids.forEach((id) => {
|
|
623
591
|
this.$refs.treeControls.$refs.regionTree.setChecked(id, true, true); // Set new checked keys
|
|
624
|
-
})
|
|
592
|
+
});
|
|
625
593
|
});
|
|
626
594
|
},
|
|
627
595
|
checkAllKeys: function (ignore = []) {
|
|
@@ -629,29 +597,20 @@ export default {
|
|
|
629
597
|
const ids = [];
|
|
630
598
|
extractAllFullPaths(this.treeData[0], keysList);
|
|
631
599
|
const modifiedKeysList = keysList.filter((key) => {
|
|
632
|
-
return !ignore.some(item => key.includes(item));
|
|
600
|
+
return !ignore.some((item) => key.includes(item));
|
|
633
601
|
});
|
|
634
|
-
this.setTreeVisibilityWithFullPaths(
|
|
635
|
-
this.treeData[0],
|
|
636
|
-
modifiedKeysList,
|
|
637
|
-
ids,
|
|
638
|
-
true
|
|
639
|
-
);
|
|
602
|
+
this.setTreeVisibilityWithFullPaths(this.treeData[0], modifiedKeysList, ids, true);
|
|
640
603
|
this.$refs.treeControls.$refs.regionTree.setCheckedKeys(ids);
|
|
641
604
|
},
|
|
642
605
|
getState: function () {
|
|
643
|
-
let checkedItems =
|
|
644
|
-
this.$refs.treeControls.$refs.regionTree.getCheckedKeys();
|
|
606
|
+
let checkedItems = this.$refs.treeControls.$refs.regionTree.getCheckedKeys();
|
|
645
607
|
if (checkedItems.length === this.nodeNumbers) {
|
|
646
|
-
return { checkAll: true, version:
|
|
608
|
+
return { checkAll: true, version: '2.0' };
|
|
647
609
|
} else {
|
|
648
610
|
//We cannot use the generated uuid as the identifier for permastate,
|
|
649
611
|
//convert it back to paths
|
|
650
|
-
let paths = convertUUIDsToFullPaths(
|
|
651
|
-
|
|
652
|
-
checkedItems
|
|
653
|
-
);
|
|
654
|
-
return { checkedItems: paths, version: "2.0" };
|
|
612
|
+
let paths = convertUUIDsToFullPaths(this.module.scene.getRootRegion(), checkedItems);
|
|
613
|
+
return { checkedItems: paths, version: '2.0' };
|
|
655
614
|
}
|
|
656
615
|
},
|
|
657
616
|
setState: function (state) {
|
|
@@ -660,19 +619,14 @@ export default {
|
|
|
660
619
|
this.checkAllKeys();
|
|
661
620
|
} else if (state.checkedItems) {
|
|
662
621
|
let list = [];
|
|
663
|
-
if (state.version !==
|
|
664
|
-
list = state.checkedItems.map((item) =>
|
|
665
|
-
list.shift(
|
|
622
|
+
if (state.version !== '2.0') {
|
|
623
|
+
list = state.checkedItems.map((item) => '/' + item);
|
|
624
|
+
list.shift('__r/');
|
|
666
625
|
} else {
|
|
667
626
|
list.push(...state.checkedItems);
|
|
668
627
|
}
|
|
669
628
|
const ids = [];
|
|
670
|
-
this.setTreeVisibilityWithFullPaths(
|
|
671
|
-
this.treeData[0],
|
|
672
|
-
list,
|
|
673
|
-
ids,
|
|
674
|
-
true
|
|
675
|
-
);
|
|
629
|
+
this.setTreeVisibilityWithFullPaths(this.treeData[0], list, ids, true);
|
|
676
630
|
this.$refs.treeControls.$refs.regionTree.setCheckedKeys(ids);
|
|
677
631
|
}
|
|
678
632
|
}
|
|
@@ -718,8 +672,8 @@ export default {
|
|
|
718
672
|
}
|
|
719
673
|
|
|
720
674
|
.tree-controls-scroll {
|
|
721
|
-
overflow-y:auto;
|
|
722
|
-
overflow-x:hidden;
|
|
675
|
+
overflow-y: auto;
|
|
676
|
+
overflow-x: hidden;
|
|
723
677
|
//scrollbar-width: thin;
|
|
724
678
|
|
|
725
679
|
&:hover {
|
|
@@ -730,11 +684,9 @@ export default {
|
|
|
730
684
|
|
|
731
685
|
&::-webkit-scrollbar-track {
|
|
732
686
|
border-radius: 8px; /* Rounded corners for the track */
|
|
733
|
-
|
|
734
687
|
}
|
|
735
688
|
&::-webkit-scrollbar {
|
|
736
|
-
width:4px;
|
|
737
|
-
|
|
689
|
+
width: 4px;
|
|
738
690
|
}
|
|
739
691
|
&::-webkit-scrollbar-thumb {
|
|
740
692
|
border-radius: 10px;
|