@abi-software/scaffoldvuer 0.1.52-beta.4 → 0.1.53-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scaffoldvuer.common.js +22268 -1870
- package/dist/scaffoldvuer.common.js.map +1 -1
- package/dist/scaffoldvuer.css +1 -1
- package/dist/scaffoldvuer.umd.js +22216 -1818
- package/dist/scaffoldvuer.umd.js.map +1 -1
- package/dist/scaffoldvuer.umd.min.js +1 -1
- package/dist/scaffoldvuer.umd.min.js.map +1 -1
- package/package-lock.json +4377 -7541
- package/package.json +4 -4
- package/src/App.vue +5 -1
- package/src/components/ScaffoldTooltip.vue +33 -33
- package/src/components/ScaffoldVuer.vue +85 -56
- package/src/components/TreeControls.vue +69 -67
- package/src/scripts/RendererModule.js +24 -8
- package/src/scripts/organsRenderer.js +4 -2
- package/src/scripts/utilities.js +34 -0
- package/vue.config.js +1 -1
- package/src/components/TraditionalControls.vue +0 -545
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/scaffoldvuer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.53-beta.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"*.js"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@abi-software/svg-sprite": "^0.1.
|
|
25
|
+
"@abi-software/svg-sprite": "^0.1.15",
|
|
26
26
|
"axios": "^0.21.2",
|
|
27
|
-
"core-js": "^3.
|
|
27
|
+
"core-js": "^3.22.5",
|
|
28
28
|
"current-script-polyfill": "^1.0.0",
|
|
29
29
|
"element-ui": "^2.13.0",
|
|
30
30
|
"google-spreadsheet": "^3.1.15",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"vue": "^2.6.10",
|
|
34
34
|
"vue-drag-resize": "^1.3.2",
|
|
35
35
|
"vue-router": "^3.5.1",
|
|
36
|
-
"zincjs": "^1.0.
|
|
36
|
+
"zincjs": "^1.0.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@vue/cli-plugin-babel": "^4.0.0",
|
package/src/App.vue
CHANGED
|
@@ -338,6 +338,7 @@ export default {
|
|
|
338
338
|
})
|
|
339
339
|
},
|
|
340
340
|
saveSettings: function() {
|
|
341
|
+
const state = this.$refs.scaffold.getState();
|
|
341
342
|
this._sceneSettings.push(this.$refs.scaffold.getState());
|
|
342
343
|
},
|
|
343
344
|
restoreSettings: function() {
|
|
@@ -362,10 +363,13 @@ export default {
|
|
|
362
363
|
}
|
|
363
364
|
},
|
|
364
365
|
onReady: function() {
|
|
366
|
+
console.log("ready")
|
|
365
367
|
this.$refs.dropzone.revokeURLs();
|
|
368
|
+
const names = ["left ventricle.mesh2d", "right ventricle.mesh2d"];
|
|
369
|
+
this.$refs.scaffold.changeActiveByName(names, "", false);
|
|
366
370
|
},
|
|
367
371
|
onSelected: function(data) {
|
|
368
|
-
if (data && data[0].data.group) {
|
|
372
|
+
if (data && (data.length > 0) && data[0].data.group) {
|
|
369
373
|
delete this.$route.query["viewURL"];
|
|
370
374
|
this.$router.replace({
|
|
371
375
|
query: { ...this.$route.query, region: data[0].data.group }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :style="position" class="
|
|
2
|
+
<div :style="position" class="region-tooltip">
|
|
3
3
|
<el-popover
|
|
4
4
|
ref="tooltip"
|
|
5
5
|
v-model="display"
|
|
@@ -82,45 +82,45 @@ export default {
|
|
|
82
82
|
<style scoped lang="scss">
|
|
83
83
|
@import "~element-ui/packages/theme-chalk/src/popover";
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
.region-tooltip {
|
|
86
|
+
position: absolute;
|
|
87
|
+
height: 50px;
|
|
88
|
+
z-index: 2;
|
|
89
|
+
::v-deep .tooltip-popper {
|
|
90
|
+
padding: 2px 6px;
|
|
91
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
92
|
+
font-size: 16px;
|
|
93
|
+
color: $app-primary-color;
|
|
94
|
+
background-color: #fff;
|
|
95
|
+
border: 1px solid $app-primary-color;
|
|
96
|
+
border-radius: 4px;
|
|
97
|
+
white-space: nowrap;
|
|
98
|
+
min-width: unset;
|
|
99
|
+
pointer-events: none;
|
|
100
|
+
top: -15px!important;
|
|
96
101
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
&.el-popper[x-placement^="top"] {
|
|
103
|
+
.popper__arrow {
|
|
104
|
+
border-top-color: $app-primary-color !important;
|
|
105
|
+
&:after {
|
|
106
|
+
border-top-color: #fff !important;
|
|
107
|
+
}
|
|
102
108
|
}
|
|
103
109
|
}
|
|
104
|
-
}
|
|
105
110
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
&.el-popper[x-placement^="bottom"] {
|
|
112
|
+
.popper__arrow {
|
|
113
|
+
border-bottom-color: $app-primary-color !important;
|
|
114
|
+
&:after {
|
|
115
|
+
border-bottom-color: #fff !important;
|
|
116
|
+
}
|
|
111
117
|
}
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
|
-
}
|
|
115
120
|
|
|
116
|
-
.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
::v-deep .non-selectable {
|
|
123
|
-
user-select: none;
|
|
124
|
-
pointer-events: none;
|
|
121
|
+
::v-deep .non-selectable {
|
|
122
|
+
user-select: none;
|
|
123
|
+
pointer-events: none;
|
|
124
|
+
}
|
|
125
125
|
}
|
|
126
126
|
</style>
|
|
@@ -249,7 +249,7 @@ import OpacityControls from "./OpacityControls";
|
|
|
249
249
|
import ScaffoldTooltip from "./ScaffoldTooltip";
|
|
250
250
|
import TreeControls from "./TreeControls";
|
|
251
251
|
import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
|
|
252
|
-
|
|
252
|
+
import { findObjectsWithNames } from "../scripts/utilities.js";
|
|
253
253
|
import {
|
|
254
254
|
Col,
|
|
255
255
|
Loading,
|
|
@@ -535,8 +535,8 @@ export default {
|
|
|
535
535
|
beforeCreate: function() {
|
|
536
536
|
this.$module = new OrgansViewer();
|
|
537
537
|
this.isReady = false;
|
|
538
|
-
this.
|
|
539
|
-
this.
|
|
538
|
+
this.selectedObjects = [];
|
|
539
|
+
this.hoveredObjects = [];
|
|
540
540
|
this.currentBackground = "white";
|
|
541
541
|
this._currentURL = undefined;
|
|
542
542
|
this.availableBackground = ["white", "black", "lightskyblue"];
|
|
@@ -672,21 +672,30 @@ export default {
|
|
|
672
672
|
cameracontrol.stopAutoTumble();
|
|
673
673
|
this.isTransitioning = false;
|
|
674
674
|
},
|
|
675
|
+
findObjectsWithGroupName: function(name) {
|
|
676
|
+
let objects = [];
|
|
677
|
+
if (name && name != "" && this.$module.scene) {
|
|
678
|
+
objects = this.$module.scene.findObjectsWithGroupName(name);
|
|
679
|
+
}
|
|
680
|
+
return objects;
|
|
681
|
+
},
|
|
675
682
|
/**
|
|
676
683
|
* Focus on named region
|
|
677
684
|
*/
|
|
678
|
-
viewRegion: function(
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
685
|
+
viewRegion: function(names) {
|
|
686
|
+
const rootRegion = this.$module.scene.getRootRegion();
|
|
687
|
+
const groups = Array.isArray(names) ? names : [names];
|
|
688
|
+
const objects = findObjectsWithNames(rootRegion, groups, "");
|
|
689
|
+
let box = this.$module.scene.getBoundingBoxOfZincObjects(objects);
|
|
690
|
+
if (box) {
|
|
691
|
+
if (this.$module.isSyncControl()) {
|
|
692
|
+
this.$module.setSyncControlZoomToBox(box);
|
|
693
|
+
} else {
|
|
694
|
+
this.$module.scene.viewAllWithBoundingBox(box);
|
|
688
695
|
}
|
|
696
|
+
return true;
|
|
689
697
|
}
|
|
698
|
+
return false;
|
|
690
699
|
},
|
|
691
700
|
setFocusedRegion: function(name) {
|
|
692
701
|
if (name) {
|
|
@@ -737,14 +746,22 @@ export default {
|
|
|
737
746
|
* It will also update other controls.
|
|
738
747
|
*/
|
|
739
748
|
eventNotifierCallback: function(event) {
|
|
749
|
+
const names = [];
|
|
750
|
+
const region = undefined;
|
|
751
|
+
if (event.eventType == 1 || event.eventType == 2) {
|
|
752
|
+
event.identifiers.forEach(identifier => {
|
|
753
|
+
if (identifier) {
|
|
754
|
+
let id = identifier.data.id
|
|
755
|
+
? identifier.data.id
|
|
756
|
+
: identifier.data.group;
|
|
757
|
+
names.push(id);
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
}
|
|
740
761
|
if (event.eventType == 1) {
|
|
741
762
|
if (this.$refs.treeControl) {
|
|
742
|
-
if (
|
|
743
|
-
|
|
744
|
-
? event.identifiers[0].data.id
|
|
745
|
-
: event.identifiers[0].data.group;
|
|
746
|
-
let region = event.identifiers[0].data.region;
|
|
747
|
-
this.$refs.treeControl.changeActiveByName(id, region, true);
|
|
763
|
+
if (names.length > 0) {
|
|
764
|
+
this.$refs.treeControl.changeActiveByNames(names, region, false);
|
|
748
765
|
} else {
|
|
749
766
|
this.$refs.treeControl.removeActive(true);
|
|
750
767
|
}
|
|
@@ -753,28 +770,29 @@ export default {
|
|
|
753
770
|
this.$emit("scaffold-selected", event.identifiers);
|
|
754
771
|
} else if (event.eventType == 2) {
|
|
755
772
|
this.tData.visible = false;
|
|
756
|
-
|
|
757
|
-
if (
|
|
773
|
+
// const offsets = this.$refs.scaffoldContainer.getBoundingClientRect();
|
|
774
|
+
if (this.$refs.treeControl) {
|
|
775
|
+
if (names.length > 0) {
|
|
776
|
+
this.$refs.treeControl.changeHoverByNames(names, region, false);
|
|
777
|
+
} else {
|
|
778
|
+
this.$refs.treeControl.removeHover(true);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
if ((event.identifiers.length > 0) && event.identifiers[0]) {
|
|
758
782
|
let id = event.identifiers[0].data.id
|
|
759
783
|
? event.identifiers[0].data.id
|
|
760
784
|
: event.identifiers[0].data.group;
|
|
761
785
|
if (event.identifiers[0].coords) {
|
|
762
786
|
this.tData.visible = true;
|
|
763
787
|
this.tData.label = id;
|
|
764
|
-
this.tData.x = event.identifiers[0].coords.x
|
|
765
|
-
this.tData.y
|
|
766
|
-
}
|
|
767
|
-
if (this.$refs.treeControl) {
|
|
768
|
-
let region = event.identifiers[0].data.region;
|
|
769
|
-
this.$refs.treeControl.changeHoverByName(id, region, true);
|
|
770
|
-
} else {
|
|
771
|
-
this.$refs.treeControl.removeHover(true);
|
|
788
|
+
this.tData.x = event.identifiers[0].coords.x;
|
|
789
|
+
this.tData.y = event.identifiers[0].coords.y;
|
|
772
790
|
}
|
|
773
791
|
}
|
|
774
792
|
// Triggers when an object has been highlighted
|
|
775
793
|
this.$emit("scaffold-highlighted", event.identifiers);
|
|
776
794
|
} else if (event.eventType == 3) { //MOVE
|
|
777
|
-
if (event.identifiers[0]) {
|
|
795
|
+
if ((event.identifiers.length > 0) && event.identifiers[0]) {
|
|
778
796
|
if (event.identifiers[0].coords) {
|
|
779
797
|
const offsets = this.$refs.scaffoldContainer.getBoundingClientRect();
|
|
780
798
|
this.tData.x = event.identifiers[0].coords.x - offsets.left;
|
|
@@ -789,8 +807,8 @@ export default {
|
|
|
789
807
|
* @public
|
|
790
808
|
*/
|
|
791
809
|
getCoordinatesOfSelected: function() {
|
|
792
|
-
if (this.
|
|
793
|
-
return this.$module.scene.getObjectsScreenXY([this.
|
|
810
|
+
if (this.selectedObjects && this.selectedObjects.length > 0) {
|
|
811
|
+
return this.$module.scene.getObjectsScreenXY([this.selectedObjects]);
|
|
794
812
|
}
|
|
795
813
|
return undefined;
|
|
796
814
|
},
|
|
@@ -817,47 +835,54 @@ export default {
|
|
|
817
835
|
*
|
|
818
836
|
* @param {object} object Zinc object
|
|
819
837
|
*/
|
|
820
|
-
objectSelected: function(
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
this.$refs.opacityControl.setObject(this.
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
}
|
|
838
|
+
objectSelected: function(objects, propagate) {
|
|
839
|
+
this.selectedObjects = objects;
|
|
840
|
+
if (this.selectedObjects)
|
|
841
|
+
this.$refs.opacityControl.setObject(this.selectedObjects[0]);
|
|
842
|
+
if (objects) this.$module.setSelectedByZincObjects(objects, undefined, propagate);
|
|
843
|
+
else this.$module.setSelectedByObjects([], undefined, propagate);
|
|
827
844
|
},
|
|
828
845
|
/**
|
|
829
846
|
* A callback used by children components. Set the highlighted zinc object
|
|
830
847
|
*
|
|
831
848
|
* @param {object} object Zinc object
|
|
832
849
|
*/
|
|
833
|
-
objectHovered: function(
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
else this.$module.setHighlightedByObjects([], undefined, propagate);
|
|
838
|
-
}
|
|
850
|
+
objectHovered: function(objects, propagate) {
|
|
851
|
+
this.hoveredObjects = objects;
|
|
852
|
+
if (objects) this.$module.setHighlightedByZincObjects(objects, undefined, propagate);
|
|
853
|
+
else this.$module.setHighlightedByObjects([], undefined, propagate);
|
|
839
854
|
},
|
|
840
855
|
/**
|
|
841
856
|
* Set the selected by name.
|
|
842
857
|
*
|
|
843
|
-
* @param {
|
|
858
|
+
* @param {} name Name of the group
|
|
844
859
|
*/
|
|
845
|
-
changeActiveByName: function(
|
|
846
|
-
|
|
860
|
+
changeActiveByName: function(names, region, propagate) {
|
|
861
|
+
const isArray = Array.isArray(names);
|
|
862
|
+
if (names === undefined || (isArray && names.length === 0)) {
|
|
847
863
|
this.$refs.treeControl.removeActive(propagate);
|
|
848
|
-
else
|
|
849
|
-
|
|
864
|
+
} else {
|
|
865
|
+
let array = names;
|
|
866
|
+
if (!isArray)
|
|
867
|
+
array = [array];
|
|
868
|
+
this.$refs.treeControl.changeActiveByNames(array, region, propagate);
|
|
869
|
+
}
|
|
850
870
|
},
|
|
851
871
|
/**
|
|
852
872
|
* Set the highlighted by name.
|
|
853
873
|
*
|
|
854
874
|
* @param {name} name Name of the group
|
|
855
875
|
*/
|
|
856
|
-
changeHighlightedByName: function(
|
|
857
|
-
|
|
876
|
+
changeHighlightedByName: function(names, region, propagate) {
|
|
877
|
+
const isArray = Array.isArray(names);
|
|
878
|
+
if (names === undefined || (isArray && names.length === 0)) {
|
|
858
879
|
this.$refs.treeControl.removeHover(propagate);
|
|
859
|
-
else
|
|
860
|
-
|
|
880
|
+
} else {
|
|
881
|
+
let array = names;
|
|
882
|
+
if (!isArray)
|
|
883
|
+
array = [array];
|
|
884
|
+
this.$refs.treeControl.changeHoverByNames(array, region, propagate);
|
|
885
|
+
}
|
|
861
886
|
},
|
|
862
887
|
/**
|
|
863
888
|
* Start the animation.
|
|
@@ -1097,8 +1122,12 @@ export default {
|
|
|
1097
1122
|
const payload = this.$module.NDCCameraControl.getPanZoom();
|
|
1098
1123
|
this.$emit("scaffold-navigated", payload);
|
|
1099
1124
|
},
|
|
1100
|
-
|
|
1101
|
-
|
|
1125
|
+
/**
|
|
1126
|
+
* Rotate mode - "none", "horizontal", "vertical", "free" but
|
|
1127
|
+
* it will be ignored if flag is set to false.
|
|
1128
|
+
*/
|
|
1129
|
+
toggleSyncControl: function(flag, rotateMode) {
|
|
1130
|
+
this.$module.toggleSyncControl(flag, rotateMode);
|
|
1102
1131
|
this.$module.setSyncControlCallback(this.syncControlCallback);
|
|
1103
1132
|
}
|
|
1104
1133
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
default-expand-all
|
|
18
18
|
node-key="id"
|
|
19
19
|
show-checkbox
|
|
20
|
-
:check-strictly="
|
|
20
|
+
:check-strictly="false"
|
|
21
21
|
:data="treeData"
|
|
22
22
|
:default-checked-keys="['__r/']"
|
|
23
23
|
:expand-on-click-node="false"
|
|
@@ -27,14 +27,8 @@
|
|
|
27
27
|
slot-scope="{ node, data }"
|
|
28
28
|
class="region-tree-node"
|
|
29
29
|
:class="{
|
|
30
|
-
activeItem:
|
|
31
|
-
|
|
32
|
-
((active.regionPath === data.regionPath) ||
|
|
33
|
-
active.regionPath === undefined)),
|
|
34
|
-
hoverItem:
|
|
35
|
-
(hover.group === data.label &&
|
|
36
|
-
((hover.regionPath === data.regionPath) ||
|
|
37
|
-
hover.regionPath === undefined))
|
|
30
|
+
activeItem: nodeIsActive(data),
|
|
31
|
+
hoverItem: nodeIsHover(data),
|
|
38
32
|
}"
|
|
39
33
|
@click="changeActiveByNode(data, true)"
|
|
40
34
|
@mouseover="changeHoverByNode(data, true)"
|
|
@@ -68,6 +62,7 @@ import Vue from "vue";
|
|
|
68
62
|
import { Checkbox, CheckboxGroup, ColorPicker, Row, Tree } from "element-ui";
|
|
69
63
|
import lang from "element-ui/lib/locale/lang/en";
|
|
70
64
|
import locale from "element-ui/lib/locale";
|
|
65
|
+
import { createListFromPrimitives, extractAllIds, findObjectsWithNames } from "../scripts/utilities.js";
|
|
71
66
|
|
|
72
67
|
const orderBy = require("lodash/orderBy");
|
|
73
68
|
const uniq = require("lodash/uniq");
|
|
@@ -90,12 +85,6 @@ const nameSorting = (a, b) => {
|
|
|
90
85
|
return 0;
|
|
91
86
|
};
|
|
92
87
|
|
|
93
|
-
const extractAllIds = (item, list) => {
|
|
94
|
-
list.push(item.id);
|
|
95
|
-
if (item.children)
|
|
96
|
-
item.children.forEach(child => extractAllIds(child, list));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
88
|
/**
|
|
100
89
|
* A vue component for toggling visibility of various regions.
|
|
101
90
|
*/
|
|
@@ -117,8 +106,8 @@ export default {
|
|
|
117
106
|
data: function () {
|
|
118
107
|
return {
|
|
119
108
|
treeData: [{ label: "Root", id: "__r/", children: [] }],
|
|
120
|
-
active: {group: "", regionPath: undefined},
|
|
121
|
-
hover: {group: "", regionPath: undefined},
|
|
109
|
+
active: [{group: "", regionPath: undefined}],
|
|
110
|
+
hover: [{group: "", regionPath: undefined}],
|
|
122
111
|
myPopperClass: "hide-scaffold-colour-popup",
|
|
123
112
|
drawerOpen: true,
|
|
124
113
|
};
|
|
@@ -201,6 +190,28 @@ export default {
|
|
|
201
190
|
return data;
|
|
202
191
|
}
|
|
203
192
|
},
|
|
193
|
+
nodeIsActive: function(data) {
|
|
194
|
+
for (let i = 0; i < this.active.length; i++) {
|
|
195
|
+
let item = this.active[i];
|
|
196
|
+
if (item.group === data.label &&
|
|
197
|
+
((item.regionPath === item.regionPath) ||
|
|
198
|
+
item.regionPath === undefined)) {
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return false;
|
|
203
|
+
},
|
|
204
|
+
nodeIsHover: function(data) {
|
|
205
|
+
for (let i = 0; i < this.hover.length; i++) {
|
|
206
|
+
let item = this.hover[i];
|
|
207
|
+
if (item.group === data.label &&
|
|
208
|
+
((item.regionPath === item.regionPath) ||
|
|
209
|
+
item.regionPath === undefined)) {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return false;
|
|
214
|
+
},
|
|
204
215
|
/**
|
|
205
216
|
* This is called when a new organ is read into the scene.
|
|
206
217
|
*/
|
|
@@ -228,30 +239,37 @@ export default {
|
|
|
228
239
|
}
|
|
229
240
|
},
|
|
230
241
|
checkChanged: function (node, data) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
242
|
+
const rootRegion = this.module.scene.getRootRegion();
|
|
243
|
+
rootRegion.hideAllChildren();
|
|
244
|
+
data.checkedNodes.forEach(localNode => {
|
|
245
|
+
if (localNode.region) localNode.region.setVisibility(true);
|
|
246
|
+
if (localNode.primitives) {
|
|
247
|
+
localNode.primitives.forEach(primitive => {
|
|
248
|
+
primitive.setVisibility(true);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
data.halfCheckedNodes.forEach(localNode => {
|
|
253
|
+
if (localNode.region) localNode.region.setVisibility(true);
|
|
254
|
+
});
|
|
238
255
|
},
|
|
239
|
-
|
|
240
|
-
if (
|
|
241
|
-
this.active
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
this.$emit("object-selected",
|
|
256
|
+
changeActiveByPrimitives: function (primitives, propagate) {
|
|
257
|
+
if (primitives && primitives.length > 0) {
|
|
258
|
+
this.active = [];
|
|
259
|
+
const list = createListFromPrimitives(primitives);
|
|
260
|
+
this.active.push(...list);
|
|
261
|
+
this.$emit("object-selected", primitives, propagate);
|
|
245
262
|
} else {
|
|
246
263
|
this.removeActive(propagate);
|
|
247
264
|
}
|
|
248
265
|
this.removeHover(propagate);
|
|
249
266
|
},
|
|
250
|
-
|
|
251
|
-
if (
|
|
252
|
-
this.hover
|
|
253
|
-
|
|
254
|
-
this
|
|
267
|
+
changeHoverByPrimitives: function (primitives, propagate) {
|
|
268
|
+
if (primitives && primitives.length > 0) {
|
|
269
|
+
this.hover = [];
|
|
270
|
+
const list = createListFromPrimitives(primitives);
|
|
271
|
+
this.hover.push(...list);
|
|
272
|
+
this.$emit("object-hovered", primitives, propagate);
|
|
255
273
|
} else {
|
|
256
274
|
this.removeHover(propagate);
|
|
257
275
|
}
|
|
@@ -259,43 +277,41 @@ export default {
|
|
|
259
277
|
/**
|
|
260
278
|
* Select a region by its name.
|
|
261
279
|
*/
|
|
262
|
-
|
|
280
|
+
changeActiveByNames: function (names, regionPath, propagate) {
|
|
263
281
|
const rootRegion = this.module.scene.getRootRegion();
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
this.
|
|
282
|
+
const targetObjects = findObjectsWithNames(rootRegion, names,
|
|
283
|
+
regionPath);
|
|
284
|
+
this.changeActiveByPrimitives(targetObjects, propagate);
|
|
267
285
|
},
|
|
268
286
|
/**
|
|
269
287
|
* Hover a region by its name.
|
|
270
288
|
*/
|
|
271
|
-
|
|
289
|
+
changeHoverByNames: function (names, regionPath, propagate) {
|
|
272
290
|
const rootRegion = this.module.scene.getRootRegion();
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
this.
|
|
291
|
+
const targetObjects = findObjectsWithNames(rootRegion, names,
|
|
292
|
+
regionPath);
|
|
293
|
+
this.changeHoverByPrimitives(targetObjects, propagate);
|
|
276
294
|
},
|
|
277
295
|
changeActiveByNode: function (node, propagate) {
|
|
278
296
|
if (node.primitives)
|
|
279
|
-
this.
|
|
297
|
+
this.changeActiveByPrimitives(node.primitives, propagate);
|
|
280
298
|
},
|
|
281
299
|
changeHoverByNode: function (node, propagate) {
|
|
282
300
|
if (node.primitives)
|
|
283
|
-
this.
|
|
301
|
+
this.changeHoverByPrimitives(node.primitives, propagate);
|
|
284
302
|
},
|
|
285
303
|
/**
|
|
286
304
|
* Unselect the current selected region.
|
|
287
305
|
*/
|
|
288
306
|
removeActive: function (propagate) {
|
|
289
|
-
this.active
|
|
290
|
-
this.active.regionPath = undefined;
|
|
307
|
+
this.active = [];
|
|
291
308
|
this.$emit("object-selected", undefined, propagate);
|
|
292
309
|
},
|
|
293
310
|
/**
|
|
294
311
|
* Unselect the current hover region.
|
|
295
312
|
*/
|
|
296
313
|
removeHover: function (propagate) {
|
|
297
|
-
this.hover
|
|
298
|
-
this.hover.regionPath = undefined;
|
|
314
|
+
this.hover = [];
|
|
299
315
|
this.$emit("object-hovered", undefined, propagate);
|
|
300
316
|
},
|
|
301
317
|
/**
|
|
@@ -309,19 +325,6 @@ export default {
|
|
|
309
325
|
this.$refs.regionTree.updateKeyChildren( "__r/", []);
|
|
310
326
|
this.$emit("object-selected", undefined);
|
|
311
327
|
},
|
|
312
|
-
getFirstZincObjectWithGroupName: function (region, name) {
|
|
313
|
-
if (region) {
|
|
314
|
-
let array = region.findGeometriesWithGroupName(name);
|
|
315
|
-
if (array.length > 0) return array[0];
|
|
316
|
-
array = region.findGlyphsetsWithGroupName(name);
|
|
317
|
-
if (array.length > 0) return array[0];
|
|
318
|
-
array = region.findLinesWithGroupName(name);
|
|
319
|
-
if (array.length > 0) return array[0];
|
|
320
|
-
array = region.findPointsetsWithGroupName(name);
|
|
321
|
-
if (array.length > 0) return array[0];
|
|
322
|
-
}
|
|
323
|
-
return undefined;
|
|
324
|
-
},
|
|
325
328
|
getColour: function (nodeData) {
|
|
326
329
|
if (nodeData) {
|
|
327
330
|
let graphic = nodeData.primitives[0];
|
|
@@ -333,12 +336,11 @@ export default {
|
|
|
333
336
|
return "#FFFFFF";
|
|
334
337
|
},
|
|
335
338
|
setColour: function (nodeData, value) {
|
|
336
|
-
if (nodeData) {
|
|
337
|
-
|
|
338
|
-
if (graphic) {
|
|
339
|
+
if (nodeData && nodeData.primitives) {
|
|
340
|
+
nodeData.primitives.forEach(primitive => {
|
|
339
341
|
let hexString = value.replace("#", "0x");
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
+
primitive.setColourHex(hexString);
|
|
343
|
+
});
|
|
342
344
|
}
|
|
343
345
|
},
|
|
344
346
|
viewAll: function () {
|
|
@@ -47,7 +47,8 @@ RendererModule.prototype.getIntersectedObject = function(intersects) {
|
|
|
47
47
|
if (intersects[i].object &&
|
|
48
48
|
intersects[i].object.userData &&
|
|
49
49
|
intersects[i].object.userData.isZincObject &&
|
|
50
|
-
(intersects[i].object.name
|
|
50
|
+
((intersects[i].object.name &&
|
|
51
|
+
intersects[i].object.name !== "_Unnamed") ||
|
|
51
52
|
intersects[i].object.userData.isMarker))
|
|
52
53
|
return intersects[i];
|
|
53
54
|
}
|
|
@@ -102,9 +103,17 @@ RendererModule.prototype.setHighlightedByObjects = function(
|
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
|
|
105
|
-
RendererModule.prototype.
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
RendererModule.prototype.setHighlightedByZincObjects = function(
|
|
107
|
+
zincObjects, coords, propagateChanges) {
|
|
108
|
+
let morphs = [];
|
|
109
|
+
if (zincObjects) {
|
|
110
|
+
zincObjects.forEach(zincObject => {
|
|
111
|
+
if (zincObject && zincObject.morph)
|
|
112
|
+
morphs.push(zincObject.morph);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return this.setHighlightedByObjects(morphs, coords,propagateChanges);
|
|
108
117
|
}
|
|
109
118
|
|
|
110
119
|
RendererModule.prototype.setupLiveCoordinates = function(zincObjects) {
|
|
@@ -159,10 +168,17 @@ RendererModule.prototype.setSelectedByObjects = function(
|
|
|
159
168
|
return changed;
|
|
160
169
|
}
|
|
161
170
|
|
|
162
|
-
RendererModule.prototype.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
171
|
+
RendererModule.prototype.setSelectedByZincObjects = function(
|
|
172
|
+
zincObjects, coords, propagateChanges) {
|
|
173
|
+
let morphs = [];
|
|
174
|
+
if (zincObjects) {
|
|
175
|
+
zincObjects.forEach(zincObject => {
|
|
176
|
+
if (zincObject && zincObject.morph)
|
|
177
|
+
morphs.push(zincObject.morph);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return this.setSelectedByObjects(morphs, coords, propagateChanges);
|
|
166
182
|
}
|
|
167
183
|
|
|
168
184
|
const addGlyphToArray = function(objects) {
|