@abi-software/scaffoldvuer 1.0.0 → 1.1.0-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.
- package/dist/scaffoldvuer.js +18734 -17156
- package/dist/scaffoldvuer.umd.cjs +181 -181
- package/dist/style.css +1 -1
- package/package.json +4 -3
- package/src/App.vue +37 -2
- package/src/components/CreateTooltipContent.vue +201 -0
- package/src/components/LinesControls.vue +196 -0
- package/src/components/OpacityControls.vue +14 -32
- package/src/components/PointsControls.vue +194 -0
- package/src/components/PrimitiveControls.vue +86 -16
- package/src/components/ScaffoldTooltip.vue +26 -2
- package/src/components/ScaffoldVuer.vue +390 -40
- package/src/components/TextureSlidesControls.vue +7 -19
- package/src/components/TransformationControls.vue +194 -0
- package/src/components/TreeControls.vue +11 -11
- package/src/components.d.ts +7 -0
- package/src/scripts/GraphicsHighlight.js +1 -2
- package/src/scripts/OrgansRenderer.js +30 -12
- package/src/scripts/RendererModule.js +32 -16
- package/src/scripts/Utilities.js +192 -0
|
@@ -8,12 +8,15 @@
|
|
|
8
8
|
>
|
|
9
9
|
<map-svg-sprite-color />
|
|
10
10
|
<scaffold-tooltip
|
|
11
|
+
:createData="createData"
|
|
11
12
|
:label="tData.label"
|
|
12
13
|
:region="tData.region"
|
|
13
14
|
:visible="tData.visible"
|
|
14
15
|
:x="tData.x"
|
|
15
16
|
:y="tData.y"
|
|
16
17
|
:annotationDisplay="viewingMode === 'Annotation' && tData.active === true"
|
|
18
|
+
@confirm-create="confirmCreate($event)"
|
|
19
|
+
@cancel-create="cancelCreate()"
|
|
17
20
|
/>
|
|
18
21
|
<div
|
|
19
22
|
id="organsDisplayArea"
|
|
@@ -23,6 +26,71 @@
|
|
|
23
26
|
@keydown.66="backgroundChangeCallback"
|
|
24
27
|
/>
|
|
25
28
|
<div v-show="displayUI && !isTransitioning">
|
|
29
|
+
<div
|
|
30
|
+
class="bottom-draw-control"
|
|
31
|
+
v-if="viewingMode === 'Annotation' && userInformation"
|
|
32
|
+
>
|
|
33
|
+
<el-popover
|
|
34
|
+
content="Comment"
|
|
35
|
+
placement="top"
|
|
36
|
+
:teleported="false"
|
|
37
|
+
trigger="manual"
|
|
38
|
+
width="80"
|
|
39
|
+
popper-class="flatmap-popper"
|
|
40
|
+
:visible="hoverVisibilities[9].value"
|
|
41
|
+
>
|
|
42
|
+
<template #reference>
|
|
43
|
+
<map-svg-icon
|
|
44
|
+
icon="comment"
|
|
45
|
+
class="icon-button shape"
|
|
46
|
+
:class="[createData.shape === '' ? 'active' : '']"
|
|
47
|
+
@click="toggleDrawing('')"
|
|
48
|
+
@mouseover="showHelpText(9)"
|
|
49
|
+
@mouseout="hideHelpText(9)"
|
|
50
|
+
/>
|
|
51
|
+
</template>
|
|
52
|
+
</el-popover>
|
|
53
|
+
<el-popover
|
|
54
|
+
content="Draw Point"
|
|
55
|
+
placement="top"
|
|
56
|
+
:teleported="false"
|
|
57
|
+
trigger="manual"
|
|
58
|
+
width="80"
|
|
59
|
+
popper-class="flatmap-popper"
|
|
60
|
+
:visible="hoverVisibilities[10].value"
|
|
61
|
+
>
|
|
62
|
+
<template #reference>
|
|
63
|
+
<map-svg-icon
|
|
64
|
+
icon="drawPoint"
|
|
65
|
+
class="icon-button shape"
|
|
66
|
+
:class="[createData.shape === 'Point' ? 'active' : '']"
|
|
67
|
+
@click="toggleDrawing('Point')"
|
|
68
|
+
@mouseover="showHelpText(10)"
|
|
69
|
+
@mouseout="hideHelpText(10)"
|
|
70
|
+
/>
|
|
71
|
+
</template>
|
|
72
|
+
</el-popover>
|
|
73
|
+
<el-popover
|
|
74
|
+
content="Draw Line"
|
|
75
|
+
placement="top"
|
|
76
|
+
:teleported="false"
|
|
77
|
+
trigger="manual"
|
|
78
|
+
width="80"
|
|
79
|
+
popper-class="flatmap-popper"
|
|
80
|
+
:visible="hoverVisibilities[11].value"
|
|
81
|
+
>
|
|
82
|
+
<template #reference>
|
|
83
|
+
<map-svg-icon
|
|
84
|
+
icon="drawLine"
|
|
85
|
+
class="icon-button shape"
|
|
86
|
+
:class="[createData.shape === 'Line' ? 'active' : '']"
|
|
87
|
+
@click="toggleDrawing('Line')"
|
|
88
|
+
@mouseover="showHelpText(11)"
|
|
89
|
+
@mouseout="hideHelpText(11)"
|
|
90
|
+
/>
|
|
91
|
+
</template>
|
|
92
|
+
</el-popover>
|
|
93
|
+
</div>
|
|
26
94
|
<el-popover
|
|
27
95
|
v-if="displayWarning"
|
|
28
96
|
ref="warningPopover"
|
|
@@ -86,7 +154,7 @@
|
|
|
86
154
|
</template>
|
|
87
155
|
</el-popover>
|
|
88
156
|
<div class="primitive-controls-box">
|
|
89
|
-
<primitive-controls ref="primitiveControls" />
|
|
157
|
+
<primitive-controls ref="primitiveControls" :createData="createData"/>
|
|
90
158
|
</div>
|
|
91
159
|
<el-popover
|
|
92
160
|
v-if="timeVarying"
|
|
@@ -270,8 +338,9 @@
|
|
|
270
338
|
placeholder="Select"
|
|
271
339
|
class="scaffold-select-box viewing-mode"
|
|
272
340
|
popper-class="scaffold_viewer_dropdown"
|
|
341
|
+
@change="viewingModeChange"
|
|
273
342
|
>
|
|
274
|
-
|
|
343
|
+
<el-option v-for="item in viewingModes" :key="item" :label="item" :value="item">
|
|
275
344
|
<el-row>
|
|
276
345
|
<el-col :span="12">{{ item }}</el-col>
|
|
277
346
|
</el-row>
|
|
@@ -346,7 +415,7 @@
|
|
|
346
415
|
|
|
347
416
|
<script>
|
|
348
417
|
/* eslint-disable no-alert, no-console */
|
|
349
|
-
import {
|
|
418
|
+
import { markRaw, shallowRef } from 'vue';
|
|
350
419
|
import {
|
|
351
420
|
WarningFilled as ElIconWarningFilled,
|
|
352
421
|
ArrowDown as ElIconArrowDown,
|
|
@@ -356,9 +425,16 @@ import PrimitiveControls from "./PrimitiveControls.vue";
|
|
|
356
425
|
import ScaffoldTooltip from "./ScaffoldTooltip.vue";
|
|
357
426
|
import TreeControls from "./TreeControls.vue";
|
|
358
427
|
import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
|
|
359
|
-
import {
|
|
428
|
+
import {
|
|
429
|
+
addUserAnnotationWithFeature,
|
|
430
|
+
annotationFeaturesToPrimitives,
|
|
431
|
+
getDrawnAnnotations,
|
|
432
|
+
getEditableLines,
|
|
433
|
+
getObjectsFromAnnotations,
|
|
434
|
+
findObjectsWithNames,
|
|
435
|
+
updateBoundingBox,
|
|
436
|
+
} from "../scripts/Utilities.js";
|
|
360
437
|
|
|
361
|
-
import { SearchIndex } from "../scripts/Search.js";
|
|
362
438
|
import {
|
|
363
439
|
ElButton as Button,
|
|
364
440
|
ElCol as Col,
|
|
@@ -371,8 +447,12 @@ import {
|
|
|
371
447
|
ElTabPane as TabPane,
|
|
372
448
|
ElTabs as Tabs,
|
|
373
449
|
} from "element-plus";
|
|
374
|
-
import {
|
|
450
|
+
import { AnnotationService } from '@abi-software/sparc-annotation';
|
|
375
451
|
import { EventNotifier } from "../scripts/EventNotifier.js";
|
|
452
|
+
import { OrgansViewer } from "../scripts/OrgansRenderer.js";
|
|
453
|
+
import { SearchIndex } from "../scripts/Search.js";
|
|
454
|
+
import { mapState } from 'pinia';
|
|
455
|
+
import { useMainStore } from "@/store/index";
|
|
376
456
|
|
|
377
457
|
/**
|
|
378
458
|
* A vue component of the scaffold viewer.
|
|
@@ -402,6 +482,10 @@ export default {
|
|
|
402
482
|
ElIconArrowDown,
|
|
403
483
|
ElIconArrowLeft,
|
|
404
484
|
},
|
|
485
|
+
setup(props) {
|
|
486
|
+
const annotator = markRaw(new AnnotationService(`${props.flatmapAPI}annotator`));
|
|
487
|
+
return { annotator };
|
|
488
|
+
},
|
|
405
489
|
props: {
|
|
406
490
|
/**
|
|
407
491
|
* URL of the zincjs metadata. This value will be ignored if a valid
|
|
@@ -588,8 +672,19 @@ export default {
|
|
|
588
672
|
},
|
|
589
673
|
data: function () {
|
|
590
674
|
return {
|
|
675
|
+
annotator: undefined,
|
|
676
|
+
createData: {
|
|
677
|
+
drawingBox: false,
|
|
678
|
+
toBeConfirmed: false,
|
|
679
|
+
points: [],
|
|
680
|
+
shape: "",
|
|
681
|
+
x: 0,
|
|
682
|
+
y: 0,
|
|
683
|
+
editingIndex: -1,
|
|
684
|
+
faceIndex: -1,
|
|
685
|
+
},
|
|
591
686
|
currentTime: 0.0,
|
|
592
|
-
timeVarying:
|
|
687
|
+
timeVarying: false,
|
|
593
688
|
isPlaying: false,
|
|
594
689
|
isReady: false,
|
|
595
690
|
/**
|
|
@@ -607,6 +702,9 @@ export default {
|
|
|
607
702
|
{ value: false },
|
|
608
703
|
{ value: false },
|
|
609
704
|
{ value: false },
|
|
705
|
+
{ value: false },
|
|
706
|
+
{ value: false },
|
|
707
|
+
{ value: false },
|
|
610
708
|
],
|
|
611
709
|
inHelp: false,
|
|
612
710
|
loading: false,
|
|
@@ -665,6 +763,7 @@ export default {
|
|
|
665
763
|
],
|
|
666
764
|
openMapRef: undefined,
|
|
667
765
|
backgroundIconRef: undefined,
|
|
766
|
+
userInformation: undefined,
|
|
668
767
|
};
|
|
669
768
|
},
|
|
670
769
|
watch: {
|
|
@@ -736,7 +835,7 @@ export default {
|
|
|
736
835
|
this.setMarkerModeForObjectsWithName(l, "on");
|
|
737
836
|
})
|
|
738
837
|
this.previousMarkerLabels = labels;
|
|
739
|
-
}
|
|
838
|
+
},
|
|
740
839
|
},
|
|
741
840
|
beforeCreate: function () {
|
|
742
841
|
this.$module = new OrgansViewer();
|
|
@@ -747,9 +846,6 @@ export default {
|
|
|
747
846
|
this.availableBackground = ["white", "black", "lightskyblue"];
|
|
748
847
|
this.$_searchIndex = new SearchIndex();
|
|
749
848
|
},
|
|
750
|
-
created: function() {
|
|
751
|
-
this.timeVarying = toRef(this.$module.sceneData, 'timeVarying');
|
|
752
|
-
},
|
|
753
849
|
mounted: function () {
|
|
754
850
|
this.openMapRef = shallowRef(this.$refs.openMapRef);
|
|
755
851
|
this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef);
|
|
@@ -773,17 +869,20 @@ export default {
|
|
|
773
869
|
this.$module.destroy();
|
|
774
870
|
this.$module = undefined;
|
|
775
871
|
},
|
|
872
|
+
computed: {
|
|
873
|
+
...mapState(useMainStore, ['userToken']),
|
|
874
|
+
},
|
|
776
875
|
methods: {
|
|
777
876
|
/**
|
|
778
877
|
* @vuese
|
|
779
|
-
* Call this to manually add a zinc object into the current scene
|
|
780
|
-
*
|
|
878
|
+
* Call this to manually add a zinc object into the current scene.
|
|
879
|
+
* This will subsequently trigger a zincObjectAdded
|
|
880
|
+
* @arg ZincObject object to be added
|
|
781
881
|
*/
|
|
782
882
|
addZincObject: function (zincObject) {
|
|
783
883
|
if (this.$module.scene) {
|
|
884
|
+
// zincObjectAdded will be alled in sequential callback
|
|
784
885
|
this.$module.scene.addZincObject(zincObject);
|
|
785
|
-
this.zincObjectAdded(zincObject);
|
|
786
|
-
if (this.$refs.treeControls) this.$refs.treeControls.zincObjectAdded(zincObject);
|
|
787
886
|
}
|
|
788
887
|
},
|
|
789
888
|
/**
|
|
@@ -793,6 +892,9 @@ export default {
|
|
|
793
892
|
zincObjectAdded: function (zincObject) {
|
|
794
893
|
this.loading = false;
|
|
795
894
|
this.$_searchIndex.addZincObject(zincObject, zincObject.uuid);
|
|
895
|
+
if (this.timeVarying === false && zincObject.isTimeVarying()) {
|
|
896
|
+
this.timeVarying = true;
|
|
897
|
+
}
|
|
796
898
|
//Emit when a new object is added to the scene
|
|
797
899
|
//@arg The object added to the sceene
|
|
798
900
|
this.$emit("zinc-object-added", zincObject);
|
|
@@ -863,6 +965,65 @@ export default {
|
|
|
863
965
|
if (this.$_searchIndex) this.$_searchIndex.removeAll();
|
|
864
966
|
if (this.$module.scene) this.$module.scene.clearAll();
|
|
865
967
|
},
|
|
968
|
+
/**
|
|
969
|
+
* @vuese
|
|
970
|
+
* Confirm creation of new primitive. This is only called from callback.
|
|
971
|
+
*/
|
|
972
|
+
confirmCreate: function(payload) {
|
|
973
|
+
if (payload) {
|
|
974
|
+
let object = undefined;
|
|
975
|
+
if (payload.shape === "Point") {
|
|
976
|
+
object = this.$module.scene.createPoints(
|
|
977
|
+
payload.region,
|
|
978
|
+
payload.group,
|
|
979
|
+
this.createData.points,
|
|
980
|
+
undefined,
|
|
981
|
+
0x0022ee,
|
|
982
|
+
);
|
|
983
|
+
} else if (payload.shape === "Line") {
|
|
984
|
+
object = this.$module.scene.createLines(
|
|
985
|
+
payload.region,
|
|
986
|
+
payload.group,
|
|
987
|
+
[this.createData.points[0], this.createData.points[1]],
|
|
988
|
+
0x00ee22,
|
|
989
|
+
);
|
|
990
|
+
} else if (payload.editingIndex > -1) {
|
|
991
|
+
if (this._editingZincObject) {
|
|
992
|
+
this._editingZincObject.editVertice([this.createData.points[1]],
|
|
993
|
+
payload.editingIndex);
|
|
994
|
+
const region = this._editingZincObject.region.getFullPath() + "/";
|
|
995
|
+
const group = this._editingZincObject.groupName;
|
|
996
|
+
addUserAnnotationWithFeature(this.annotator, this.userToken, this._editingZincObject,
|
|
997
|
+
region, group, this.url, "Position Updated");
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
if (object) {
|
|
1001
|
+
addUserAnnotationWithFeature(this.annotator, this.userToken, object.zincObject,
|
|
1002
|
+
payload.region, payload.group, this.url, "Create");
|
|
1003
|
+
object.zincObject.isEditable = true;
|
|
1004
|
+
this.tData.region = payload.region;
|
|
1005
|
+
this.tData.label = payload.group;
|
|
1006
|
+
this.changeActiveByName([payload.group], payload.region, false);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
this.cancelCreate();
|
|
1010
|
+
},
|
|
1011
|
+
cancelCreate: function() {
|
|
1012
|
+
this.createData.points.length = 0;
|
|
1013
|
+
this.createData.toBeConfirmed = false;
|
|
1014
|
+
this._editingZincObject = undefined;
|
|
1015
|
+
this.createData.editingIndex = -1;
|
|
1016
|
+
this.createData.faceIndex = -1;
|
|
1017
|
+
this.tData.visible = false;
|
|
1018
|
+
if (this._tempLine) {
|
|
1019
|
+
this.$module.scene.removeTemporaryPrimitive(this._tempLine);
|
|
1020
|
+
this._tempLine = undefined;
|
|
1021
|
+
}
|
|
1022
|
+
if (this._tempPoint) {
|
|
1023
|
+
this.$module.scene.removeTemporaryPrimitive(this._tempPoint);
|
|
1024
|
+
this._tempPoint = undefined;
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
866
1027
|
formatTooltip(val) {
|
|
867
1028
|
if (this.timeMax >= 1000) {
|
|
868
1029
|
if (val) {
|
|
@@ -880,7 +1041,19 @@ export default {
|
|
|
880
1041
|
*/
|
|
881
1042
|
fitWindow: function () {
|
|
882
1043
|
if (this.$module.scene) {
|
|
1044
|
+
//We do not want the bounding box to affect the
|
|
1045
|
+
//bounding box calculation.
|
|
1046
|
+
let vis = false;
|
|
1047
|
+
if (this._boundingBoxGeo) {
|
|
1048
|
+
vis = this._boundingBoxGeo.getVisibility();
|
|
1049
|
+
this._boundingBoxGeo.setVisibility(false);
|
|
1050
|
+
}
|
|
883
1051
|
this.$module.scene.viewAll();
|
|
1052
|
+
if (this._boundingBoxGeo) {
|
|
1053
|
+
updateBoundingBox(this._boundingBoxGeo, this.$module.scene);
|
|
1054
|
+
//Resume the bounding box visibility
|
|
1055
|
+
this._boundingBoxGeo.setVisibility(vis);
|
|
1056
|
+
}
|
|
884
1057
|
}
|
|
885
1058
|
},
|
|
886
1059
|
/**
|
|
@@ -936,6 +1109,29 @@ export default {
|
|
|
936
1109
|
}
|
|
937
1110
|
return objects;
|
|
938
1111
|
},
|
|
1112
|
+
/**
|
|
1113
|
+
* Switch active drawing type
|
|
1114
|
+
* @arg shapeName shape to toggle
|
|
1115
|
+
*
|
|
1116
|
+
* @vuese
|
|
1117
|
+
*/
|
|
1118
|
+
toggleDrawing: function (shapeName) {
|
|
1119
|
+
if (shapeName === this.createData.shape) {
|
|
1120
|
+
this.createData.shape = "";
|
|
1121
|
+
this.$module.selectObjectOnPick = true;
|
|
1122
|
+
} else {
|
|
1123
|
+
this.createData.shape = shapeName;
|
|
1124
|
+
this.$module.selectObjectOnPick = false;
|
|
1125
|
+
}
|
|
1126
|
+
},
|
|
1127
|
+
/**
|
|
1128
|
+
* Toggle the drawing box which aid the drawing
|
|
1129
|
+
*
|
|
1130
|
+
* @vuese
|
|
1131
|
+
*/
|
|
1132
|
+
toggleDrawingBox: function () {
|
|
1133
|
+
this.createData.drawingBox = !this.createData.drawingBox;
|
|
1134
|
+
},
|
|
939
1135
|
/**
|
|
940
1136
|
* Find and and zoom into objects with the provided list of names.
|
|
941
1137
|
* @arg List of names
|
|
@@ -984,6 +1180,50 @@ export default {
|
|
|
984
1180
|
}
|
|
985
1181
|
}
|
|
986
1182
|
},
|
|
1183
|
+
createEditTemporaryLines: function(worldCoords) {
|
|
1184
|
+
if (worldCoords) {
|
|
1185
|
+
if (this.createData.shape === "Line" || this.createData.editingIndex > -1) {
|
|
1186
|
+
if (this.createData.points.length === 1) {
|
|
1187
|
+
if (this._tempLine) {
|
|
1188
|
+
const positionAttribute = this._tempLine.geometry.getAttribute( 'position' );
|
|
1189
|
+
positionAttribute.setXYZ(1, worldCoords[0], worldCoords[1], worldCoords[2]);
|
|
1190
|
+
positionAttribute.needsUpdate = true;
|
|
1191
|
+
} else {
|
|
1192
|
+
this._tempLine = this.$module.scene.addTemporaryLines(
|
|
1193
|
+
[this.createData.points[0], worldCoords], 0x00ffff);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
},
|
|
1199
|
+
draw: function(data) {
|
|
1200
|
+
if (data && data.length > 0 && data[0].data.group) {
|
|
1201
|
+
if (data[0].extraData.worldCoords) {
|
|
1202
|
+
if (this.createData.shape === "Point") {
|
|
1203
|
+
this.drawPoint(data[0].extraData.worldCoords, data);
|
|
1204
|
+
} else if (this.createData.shape === "Line" ||
|
|
1205
|
+
this.createData.editingIndex > -1) {
|
|
1206
|
+
this.drawLine(data[0].extraData.worldCoords, data);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
},
|
|
1211
|
+
drawPoint: function(coords, data) {
|
|
1212
|
+
this.createData.points.length = 0;
|
|
1213
|
+
this.createData.points.push(coords);
|
|
1214
|
+
this.showRegionTooltipWithAnnotations(data, true, true);
|
|
1215
|
+
this.createData.toBeConfirmed = true;
|
|
1216
|
+
},
|
|
1217
|
+
drawLine: function(coords, data) {
|
|
1218
|
+
if (this.createData.points.length === 1) {
|
|
1219
|
+
this.createData.points.push(coords);
|
|
1220
|
+
this.showRegionTooltipWithAnnotations(data, true, true);
|
|
1221
|
+
this.createData.toBeConfirmed = true;
|
|
1222
|
+
} else {
|
|
1223
|
+
this._tempPoint = this.$module.scene.addTemporaryPoints([coords], 0xffff00);
|
|
1224
|
+
this.createData.points.push(coords);
|
|
1225
|
+
}
|
|
1226
|
+
},
|
|
987
1227
|
/**
|
|
988
1228
|
* Return renderer information
|
|
989
1229
|
*
|
|
@@ -1010,6 +1250,36 @@ export default {
|
|
|
1010
1250
|
setTimeout(this.stopFreeSpin, 4000);
|
|
1011
1251
|
}
|
|
1012
1252
|
},
|
|
1253
|
+
activateAnnotationMode: function(names, event) {
|
|
1254
|
+
if (this.userInformation) {
|
|
1255
|
+
if ((this.createData.shape !== "") || (this.createData.editingIndex > -1)) {
|
|
1256
|
+
// Create new shape bsaed on current settings
|
|
1257
|
+
if (names.length > 0) {
|
|
1258
|
+
if (event.identifiers[0].coords) {
|
|
1259
|
+
this.createData.x = event.identifiers[0].coords.x;
|
|
1260
|
+
this.createData.y = event.identifiers[0].coords.y;
|
|
1261
|
+
this.draw(event.identifiers);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
} else {
|
|
1265
|
+
//Make sure the tooltip is displayed with annotation mode
|
|
1266
|
+
const editing = getEditableLines(event);
|
|
1267
|
+
if (editing) {
|
|
1268
|
+
this.activateEditingMode(editing.zincObject, editing.faceIndex,
|
|
1269
|
+
editing.vertexIndex, editing.point);
|
|
1270
|
+
}
|
|
1271
|
+
this.showRegionTooltipWithAnnotations(event.identifiers, true, true);
|
|
1272
|
+
}
|
|
1273
|
+
} else {
|
|
1274
|
+
this.showRegionTooltipWithAnnotations(event.identifiers, true, true);
|
|
1275
|
+
}
|
|
1276
|
+
},
|
|
1277
|
+
activateEditingMode: function(zincObject, faceIndex, vertexIndex, point) {
|
|
1278
|
+
this._editingZincObject = zincObject;
|
|
1279
|
+
this.createData.faceIndex = faceIndex;
|
|
1280
|
+
this.createData.editingIndex = vertexIndex;
|
|
1281
|
+
this.drawLine(point, undefined);
|
|
1282
|
+
},
|
|
1013
1283
|
/**
|
|
1014
1284
|
* Callback when a region is selected/highlighted.
|
|
1015
1285
|
* It will also update other controls.
|
|
@@ -1018,7 +1288,6 @@ export default {
|
|
|
1018
1288
|
eventNotifierCallback: function (event) {
|
|
1019
1289
|
const names = [];
|
|
1020
1290
|
let zincObjects = [];
|
|
1021
|
-
const region = undefined;
|
|
1022
1291
|
if (event.eventType == 1 || event.eventType == 2) {
|
|
1023
1292
|
event.identifiers.forEach((identifier) => {
|
|
1024
1293
|
if (identifier) {
|
|
@@ -1033,26 +1302,27 @@ export default {
|
|
|
1033
1302
|
/*
|
|
1034
1303
|
* Event Type 1: Selected
|
|
1035
1304
|
* Event Type 2: Highlighted
|
|
1036
|
-
* Event Type
|
|
1305
|
+
* Event Type 3: Move
|
|
1037
1306
|
*/
|
|
1038
1307
|
if (event.eventType == 1) {
|
|
1039
|
-
if (this.$refs.treeControls) {
|
|
1040
|
-
if (names.length > 0) {
|
|
1041
|
-
//this.$refs.treeControls.changeActiveByNames(names, region, false);
|
|
1042
|
-
this.$refs.treeControls.updateActiveUI(zincObjects);
|
|
1043
|
-
} else {
|
|
1044
|
-
this.hideRegionTooltip();
|
|
1045
|
-
this.$refs.treeControls.removeActive(true);
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
// Triggers when an object has been selected
|
|
1049
1308
|
if (this.viewingMode === 'Annotation') {
|
|
1050
|
-
|
|
1051
|
-
|
|
1309
|
+
this.activateAnnotationMode(names, event);
|
|
1310
|
+
|
|
1311
|
+
} else {
|
|
1312
|
+
if (this.$refs.treeControls) {
|
|
1313
|
+
if (names.length > 0) {
|
|
1314
|
+
//this.$refs.treeControls.changeActiveByNames(names, region, false);
|
|
1315
|
+
this.$refs.treeControls.updateActiveUI(zincObjects);
|
|
1316
|
+
this.updatePrimitiveControls(zincObjects);
|
|
1317
|
+
} else {
|
|
1318
|
+
this.hideRegionTooltip();
|
|
1319
|
+
this.$refs.treeControls.removeActive(false);
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
//Emit when an object is selected
|
|
1323
|
+
//@arg Identifier of selected objects
|
|
1324
|
+
this.$emit("scaffold-selected", event.identifiers);
|
|
1052
1325
|
}
|
|
1053
|
-
//Emit when an object is selected
|
|
1054
|
-
//@arg Identifier of selected objects
|
|
1055
|
-
this.$emit("scaffold-selected", event.identifiers);
|
|
1056
1326
|
} else if (event.eventType == 2) {
|
|
1057
1327
|
if (this.selectedObjects.length === 0) {
|
|
1058
1328
|
this.hideRegionTooltip();
|
|
@@ -1073,11 +1343,15 @@ export default {
|
|
|
1073
1343
|
this.tData.active = false;
|
|
1074
1344
|
this.tData.visible = true;
|
|
1075
1345
|
this.tData.label = id;
|
|
1076
|
-
if (event.identifiers[0].data.region)
|
|
1346
|
+
if (event.identifiers[0].data.region) {
|
|
1077
1347
|
this.tData.region = event.identifiers[0].data.region;
|
|
1078
|
-
|
|
1348
|
+
}
|
|
1349
|
+
else {
|
|
1350
|
+
this.tData.region = undefined;
|
|
1351
|
+
}
|
|
1079
1352
|
this.tData.x = event.identifiers[0].coords.x;
|
|
1080
1353
|
this.tData.y = event.identifiers[0].coords.y;
|
|
1354
|
+
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1081
1355
|
}
|
|
1082
1356
|
}
|
|
1083
1357
|
//Emit when an object is highlighted
|
|
@@ -1092,7 +1366,9 @@ export default {
|
|
|
1092
1366
|
this.$refs.scaffoldContainer.getBoundingClientRect();
|
|
1093
1367
|
this.tData.x = event.identifiers[0].coords.x - offsets.left;
|
|
1094
1368
|
this.tData.y = event.identifiers[0].coords.y - offsets.top;
|
|
1369
|
+
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1095
1370
|
}
|
|
1371
|
+
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1096
1372
|
}
|
|
1097
1373
|
}
|
|
1098
1374
|
},
|
|
@@ -1126,6 +1402,19 @@ export default {
|
|
|
1126
1402
|
this.$module.updateTime(normalizedTime);
|
|
1127
1403
|
}
|
|
1128
1404
|
},
|
|
1405
|
+
/**
|
|
1406
|
+
* Update primitive controls UI with the specified objects
|
|
1407
|
+
*
|
|
1408
|
+
* @arg objects objects to be set for the selected
|
|
1409
|
+
*/
|
|
1410
|
+
updatePrimitiveControls: function (objects) {
|
|
1411
|
+
this.selectedObjects = objects;
|
|
1412
|
+
if (this.selectedObjects && this.selectedObjects.length > 0) {
|
|
1413
|
+
this.$refs.primitiveControls.setObject(this.selectedObjects[0]);
|
|
1414
|
+
} else {
|
|
1415
|
+
this.$refs.primitiveControls.setObject(undefined);
|
|
1416
|
+
}
|
|
1417
|
+
},
|
|
1129
1418
|
/**
|
|
1130
1419
|
* A callback used by children components. Set the selected zinc object
|
|
1131
1420
|
*
|
|
@@ -1134,11 +1423,8 @@ export default {
|
|
|
1134
1423
|
* is made
|
|
1135
1424
|
*/
|
|
1136
1425
|
objectSelected: function (objects, propagate) {
|
|
1137
|
-
this.
|
|
1138
|
-
|
|
1139
|
-
this.$refs.primitiveControls.setObject(this.selectedObjects[0]);
|
|
1140
|
-
}
|
|
1141
|
-
this.$module.setSelectedByZincObjects(objects, undefined, propagate);
|
|
1426
|
+
this.updatePrimitiveControls(objects);
|
|
1427
|
+
this.$module.setSelectedByZincObjects(objects, undefined, {}, propagate);
|
|
1142
1428
|
},
|
|
1143
1429
|
/**
|
|
1144
1430
|
* A callback used by children components. Set the highlighted zinc object
|
|
@@ -1149,7 +1435,7 @@ export default {
|
|
|
1149
1435
|
*/
|
|
1150
1436
|
objectHovered: function (objects, propagate) {
|
|
1151
1437
|
this.hoveredObjects = objects;
|
|
1152
|
-
this.$module.setHighlightedByZincObjects(objects, undefined, propagate);
|
|
1438
|
+
this.$module.setHighlightedByZincObjects(objects, undefined, {}, propagate);
|
|
1153
1439
|
},
|
|
1154
1440
|
/**
|
|
1155
1441
|
* Set the selected by name.
|
|
@@ -1364,6 +1650,41 @@ export default {
|
|
|
1364
1650
|
this.hideRegionTooltip();
|
|
1365
1651
|
return false;
|
|
1366
1652
|
},
|
|
1653
|
+
/**
|
|
1654
|
+
* Callback on viewing mode change
|
|
1655
|
+
*/
|
|
1656
|
+
viewingModeChange: function () {
|
|
1657
|
+
if (this.$module) {
|
|
1658
|
+
if (this.viewingMode === "Annotation") {
|
|
1659
|
+
let authenticated = false;
|
|
1660
|
+
if (this.userInformation) {
|
|
1661
|
+
authenticated = true;
|
|
1662
|
+
}
|
|
1663
|
+
this.userInformation = undefined;
|
|
1664
|
+
this.annotator.authenticate(this.userToken).then((userData) => {
|
|
1665
|
+
if (userData.name && userData.email) {
|
|
1666
|
+
this.userInformation = userData;
|
|
1667
|
+
//Only draw annotations stored in the server on initial authentication
|
|
1668
|
+
if (!authenticated) {
|
|
1669
|
+
getDrawnAnnotations(this.annotator, this.userToken, this.url).then((payload) => {
|
|
1670
|
+
if (payload && payload.features) {
|
|
1671
|
+
annotationFeaturesToPrimitives(this.$module.scene, payload.features);
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
if ((this.viewingMode === "Exploration") ||
|
|
1679
|
+
(this.viewingMode === "Annotation") &&
|
|
1680
|
+
(this.createData.shape === "")) {
|
|
1681
|
+
this.$module.selectObjectOnPick = true;
|
|
1682
|
+
} else {
|
|
1683
|
+
this.$module.selectObjectOnPick = false;
|
|
1684
|
+
}
|
|
1685
|
+
this.cancelCreate();
|
|
1686
|
+
}
|
|
1687
|
+
},
|
|
1367
1688
|
/**
|
|
1368
1689
|
* @vuese
|
|
1369
1690
|
* Hide the tooltip
|
|
@@ -1525,6 +1846,8 @@ export default {
|
|
|
1525
1846
|
//Emit when all objects have been loaded
|
|
1526
1847
|
this.$emit("on-ready");
|
|
1527
1848
|
this.setMarkers();
|
|
1849
|
+
this._boundingBoxGeo = this.$module.scene.addBoundingBoxPrimitive(
|
|
1850
|
+
"_helper", "boundingBox", 0x40E0D0, 0.15);
|
|
1528
1851
|
this.isReady = true;
|
|
1529
1852
|
};
|
|
1530
1853
|
},
|
|
@@ -1609,6 +1932,7 @@ export default {
|
|
|
1609
1932
|
this._currentURL = newValue;
|
|
1610
1933
|
if (this.$refs.treeControls) this.$refs.treeControls.clear();
|
|
1611
1934
|
this.loading = true;
|
|
1935
|
+
this.timeVarying = false;
|
|
1612
1936
|
this.isReady = false;
|
|
1613
1937
|
this.$_searchIndex.removeAll();
|
|
1614
1938
|
this.hideRegionTooltip();
|
|
@@ -1862,6 +2186,17 @@ export default {
|
|
|
1862
2186
|
padding-left: 8px;
|
|
1863
2187
|
}
|
|
1864
2188
|
|
|
2189
|
+
.bottom-draw-control {
|
|
2190
|
+
background-color: var(--el-color-primary-light-9);
|
|
2191
|
+
padding: 4px 4px 2px 4px;
|
|
2192
|
+
border-style: solid;
|
|
2193
|
+
border-color: var(--el-color-primary-light-5);
|
|
2194
|
+
border-radius: 1rem;
|
|
2195
|
+
position: absolute;
|
|
2196
|
+
right: calc(50vw - 100px);;
|
|
2197
|
+
bottom: 16px;
|
|
2198
|
+
}
|
|
2199
|
+
|
|
1865
2200
|
:deep(.non-selectable) {
|
|
1866
2201
|
user-select: none;
|
|
1867
2202
|
}
|
|
@@ -1970,6 +2305,20 @@ export default {
|
|
|
1970
2305
|
&:hover {
|
|
1971
2306
|
cursor: pointer;
|
|
1972
2307
|
}
|
|
2308
|
+
|
|
2309
|
+
&:focus {
|
|
2310
|
+
border: none;
|
|
2311
|
+
outline: none;
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
&.shape {
|
|
2315
|
+
margin-left: 4px;
|
|
2316
|
+
margin-right: 4px;
|
|
2317
|
+
color: var(--el-color-primary-light-5);
|
|
2318
|
+
&.active {
|
|
2319
|
+
color: var(--el-color-primary);
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
1973
2322
|
}
|
|
1974
2323
|
|
|
1975
2324
|
.bottom-right-control {
|
|
@@ -2116,6 +2465,7 @@ export default {
|
|
|
2116
2465
|
<style lang="scss">
|
|
2117
2466
|
.scaffold-container {
|
|
2118
2467
|
--el-color-primary: #8300BF;
|
|
2468
|
+
--el-color-primary-light-5: #cd99e5;
|
|
2119
2469
|
--el-color-primary-light-7: #dab3ec;
|
|
2120
2470
|
--el-color-primary-light-8: #e6ccf2
|
|
2121
2471
|
--el-color-primary-light-9: #f3e6f9;
|