@abi-software/scaffoldvuer 1.0.1 → 1.1.0-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.js +18736 -17157
- 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 +391 -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
|
|
@@ -584,12 +668,24 @@ export default {
|
|
|
584
668
|
return {
|
|
585
669
|
flatmapAPI: this.flatmapAPI,
|
|
586
670
|
scaffoldUrl: this.url,
|
|
671
|
+
$annotator: this.annotator,
|
|
587
672
|
};
|
|
588
673
|
},
|
|
589
674
|
data: function () {
|
|
590
675
|
return {
|
|
676
|
+
annotator: undefined,
|
|
677
|
+
createData: {
|
|
678
|
+
drawingBox: false,
|
|
679
|
+
toBeConfirmed: false,
|
|
680
|
+
points: [],
|
|
681
|
+
shape: "",
|
|
682
|
+
x: 0,
|
|
683
|
+
y: 0,
|
|
684
|
+
editingIndex: -1,
|
|
685
|
+
faceIndex: -1,
|
|
686
|
+
},
|
|
591
687
|
currentTime: 0.0,
|
|
592
|
-
timeVarying:
|
|
688
|
+
timeVarying: false,
|
|
593
689
|
isPlaying: false,
|
|
594
690
|
isReady: false,
|
|
595
691
|
/**
|
|
@@ -607,6 +703,9 @@ export default {
|
|
|
607
703
|
{ value: false },
|
|
608
704
|
{ value: false },
|
|
609
705
|
{ value: false },
|
|
706
|
+
{ value: false },
|
|
707
|
+
{ value: false },
|
|
708
|
+
{ value: false },
|
|
610
709
|
],
|
|
611
710
|
inHelp: false,
|
|
612
711
|
loading: false,
|
|
@@ -665,6 +764,7 @@ export default {
|
|
|
665
764
|
],
|
|
666
765
|
openMapRef: undefined,
|
|
667
766
|
backgroundIconRef: undefined,
|
|
767
|
+
userInformation: undefined,
|
|
668
768
|
};
|
|
669
769
|
},
|
|
670
770
|
watch: {
|
|
@@ -736,7 +836,7 @@ export default {
|
|
|
736
836
|
this.setMarkerModeForObjectsWithName(l, "on");
|
|
737
837
|
})
|
|
738
838
|
this.previousMarkerLabels = labels;
|
|
739
|
-
}
|
|
839
|
+
},
|
|
740
840
|
},
|
|
741
841
|
beforeCreate: function () {
|
|
742
842
|
this.$module = new OrgansViewer();
|
|
@@ -747,9 +847,6 @@ export default {
|
|
|
747
847
|
this.availableBackground = ["white", "black", "lightskyblue"];
|
|
748
848
|
this.$_searchIndex = new SearchIndex();
|
|
749
849
|
},
|
|
750
|
-
created: function() {
|
|
751
|
-
this.timeVarying = toRef(this.$module.sceneData, 'timeVarying');
|
|
752
|
-
},
|
|
753
850
|
mounted: function () {
|
|
754
851
|
this.openMapRef = shallowRef(this.$refs.openMapRef);
|
|
755
852
|
this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef);
|
|
@@ -773,17 +870,20 @@ export default {
|
|
|
773
870
|
this.$module.destroy();
|
|
774
871
|
this.$module = undefined;
|
|
775
872
|
},
|
|
873
|
+
computed: {
|
|
874
|
+
...mapState(useMainStore, ['userToken']),
|
|
875
|
+
},
|
|
776
876
|
methods: {
|
|
777
877
|
/**
|
|
778
878
|
* @vuese
|
|
779
|
-
* Call this to manually add a zinc object into the current scene
|
|
780
|
-
*
|
|
879
|
+
* Call this to manually add a zinc object into the current scene.
|
|
880
|
+
* This will subsequently trigger a zincObjectAdded
|
|
881
|
+
* @arg ZincObject object to be added
|
|
781
882
|
*/
|
|
782
883
|
addZincObject: function (zincObject) {
|
|
783
884
|
if (this.$module.scene) {
|
|
885
|
+
// zincObjectAdded will be alled in sequential callback
|
|
784
886
|
this.$module.scene.addZincObject(zincObject);
|
|
785
|
-
this.zincObjectAdded(zincObject);
|
|
786
|
-
if (this.$refs.treeControls) this.$refs.treeControls.zincObjectAdded(zincObject);
|
|
787
887
|
}
|
|
788
888
|
},
|
|
789
889
|
/**
|
|
@@ -793,6 +893,9 @@ export default {
|
|
|
793
893
|
zincObjectAdded: function (zincObject) {
|
|
794
894
|
this.loading = false;
|
|
795
895
|
this.$_searchIndex.addZincObject(zincObject, zincObject.uuid);
|
|
896
|
+
if (this.timeVarying === false && zincObject.isTimeVarying()) {
|
|
897
|
+
this.timeVarying = true;
|
|
898
|
+
}
|
|
796
899
|
//Emit when a new object is added to the scene
|
|
797
900
|
//@arg The object added to the sceene
|
|
798
901
|
this.$emit("zinc-object-added", zincObject);
|
|
@@ -863,6 +966,65 @@ export default {
|
|
|
863
966
|
if (this.$_searchIndex) this.$_searchIndex.removeAll();
|
|
864
967
|
if (this.$module.scene) this.$module.scene.clearAll();
|
|
865
968
|
},
|
|
969
|
+
/**
|
|
970
|
+
* @vuese
|
|
971
|
+
* Confirm creation of new primitive. This is only called from callback.
|
|
972
|
+
*/
|
|
973
|
+
confirmCreate: function(payload) {
|
|
974
|
+
if (payload) {
|
|
975
|
+
let object = undefined;
|
|
976
|
+
if (payload.shape === "Point") {
|
|
977
|
+
object = this.$module.scene.createPoints(
|
|
978
|
+
payload.region,
|
|
979
|
+
payload.group,
|
|
980
|
+
this.createData.points,
|
|
981
|
+
undefined,
|
|
982
|
+
0x0022ee,
|
|
983
|
+
);
|
|
984
|
+
} else if (payload.shape === "Line") {
|
|
985
|
+
object = this.$module.scene.createLines(
|
|
986
|
+
payload.region,
|
|
987
|
+
payload.group,
|
|
988
|
+
[this.createData.points[0], this.createData.points[1]],
|
|
989
|
+
0x00ee22,
|
|
990
|
+
);
|
|
991
|
+
} else if (payload.editingIndex > -1) {
|
|
992
|
+
if (this._editingZincObject) {
|
|
993
|
+
this._editingZincObject.editVertice([this.createData.points[1]],
|
|
994
|
+
payload.editingIndex);
|
|
995
|
+
const region = this._editingZincObject.region.getFullPath() + "/";
|
|
996
|
+
const group = this._editingZincObject.groupName;
|
|
997
|
+
addUserAnnotationWithFeature(this.annotator, this.userToken, this._editingZincObject,
|
|
998
|
+
region, group, this.url, "Position Updated");
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
if (object) {
|
|
1002
|
+
addUserAnnotationWithFeature(this.annotator, this.userToken, object.zincObject,
|
|
1003
|
+
payload.region, payload.group, this.url, "Create");
|
|
1004
|
+
object.zincObject.isEditable = true;
|
|
1005
|
+
this.tData.region = payload.region;
|
|
1006
|
+
this.tData.label = payload.group;
|
|
1007
|
+
this.changeActiveByName([payload.group], payload.region, false);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
this.cancelCreate();
|
|
1011
|
+
},
|
|
1012
|
+
cancelCreate: function() {
|
|
1013
|
+
this.createData.points.length = 0;
|
|
1014
|
+
this.createData.toBeConfirmed = false;
|
|
1015
|
+
this._editingZincObject = undefined;
|
|
1016
|
+
this.createData.editingIndex = -1;
|
|
1017
|
+
this.createData.faceIndex = -1;
|
|
1018
|
+
this.tData.visible = false;
|
|
1019
|
+
if (this._tempLine) {
|
|
1020
|
+
this.$module.scene.removeTemporaryPrimitive(this._tempLine);
|
|
1021
|
+
this._tempLine = undefined;
|
|
1022
|
+
}
|
|
1023
|
+
if (this._tempPoint) {
|
|
1024
|
+
this.$module.scene.removeTemporaryPrimitive(this._tempPoint);
|
|
1025
|
+
this._tempPoint = undefined;
|
|
1026
|
+
}
|
|
1027
|
+
},
|
|
866
1028
|
formatTooltip(val) {
|
|
867
1029
|
if (this.timeMax >= 1000) {
|
|
868
1030
|
if (val) {
|
|
@@ -880,7 +1042,19 @@ export default {
|
|
|
880
1042
|
*/
|
|
881
1043
|
fitWindow: function () {
|
|
882
1044
|
if (this.$module.scene) {
|
|
1045
|
+
//We do not want the bounding box to affect the
|
|
1046
|
+
//bounding box calculation.
|
|
1047
|
+
let vis = false;
|
|
1048
|
+
if (this._boundingBoxGeo) {
|
|
1049
|
+
vis = this._boundingBoxGeo.getVisibility();
|
|
1050
|
+
this._boundingBoxGeo.setVisibility(false);
|
|
1051
|
+
}
|
|
883
1052
|
this.$module.scene.viewAll();
|
|
1053
|
+
if (this._boundingBoxGeo) {
|
|
1054
|
+
updateBoundingBox(this._boundingBoxGeo, this.$module.scene);
|
|
1055
|
+
//Resume the bounding box visibility
|
|
1056
|
+
this._boundingBoxGeo.setVisibility(vis);
|
|
1057
|
+
}
|
|
884
1058
|
}
|
|
885
1059
|
},
|
|
886
1060
|
/**
|
|
@@ -936,6 +1110,29 @@ export default {
|
|
|
936
1110
|
}
|
|
937
1111
|
return objects;
|
|
938
1112
|
},
|
|
1113
|
+
/**
|
|
1114
|
+
* Switch active drawing type
|
|
1115
|
+
* @arg shapeName shape to toggle
|
|
1116
|
+
*
|
|
1117
|
+
* @vuese
|
|
1118
|
+
*/
|
|
1119
|
+
toggleDrawing: function (shapeName) {
|
|
1120
|
+
if (shapeName === this.createData.shape) {
|
|
1121
|
+
this.createData.shape = "";
|
|
1122
|
+
this.$module.selectObjectOnPick = true;
|
|
1123
|
+
} else {
|
|
1124
|
+
this.createData.shape = shapeName;
|
|
1125
|
+
this.$module.selectObjectOnPick = false;
|
|
1126
|
+
}
|
|
1127
|
+
},
|
|
1128
|
+
/**
|
|
1129
|
+
* Toggle the drawing box which aid the drawing
|
|
1130
|
+
*
|
|
1131
|
+
* @vuese
|
|
1132
|
+
*/
|
|
1133
|
+
toggleDrawingBox: function () {
|
|
1134
|
+
this.createData.drawingBox = !this.createData.drawingBox;
|
|
1135
|
+
},
|
|
939
1136
|
/**
|
|
940
1137
|
* Find and and zoom into objects with the provided list of names.
|
|
941
1138
|
* @arg List of names
|
|
@@ -984,6 +1181,50 @@ export default {
|
|
|
984
1181
|
}
|
|
985
1182
|
}
|
|
986
1183
|
},
|
|
1184
|
+
createEditTemporaryLines: function(worldCoords) {
|
|
1185
|
+
if (worldCoords) {
|
|
1186
|
+
if (this.createData.shape === "Line" || this.createData.editingIndex > -1) {
|
|
1187
|
+
if (this.createData.points.length === 1) {
|
|
1188
|
+
if (this._tempLine) {
|
|
1189
|
+
const positionAttribute = this._tempLine.geometry.getAttribute( 'position' );
|
|
1190
|
+
positionAttribute.setXYZ(1, worldCoords[0], worldCoords[1], worldCoords[2]);
|
|
1191
|
+
positionAttribute.needsUpdate = true;
|
|
1192
|
+
} else {
|
|
1193
|
+
this._tempLine = this.$module.scene.addTemporaryLines(
|
|
1194
|
+
[this.createData.points[0], worldCoords], 0x00ffff);
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
draw: function(data) {
|
|
1201
|
+
if (data && data.length > 0 && data[0].data.group) {
|
|
1202
|
+
if (data[0].extraData.worldCoords) {
|
|
1203
|
+
if (this.createData.shape === "Point") {
|
|
1204
|
+
this.drawPoint(data[0].extraData.worldCoords, data);
|
|
1205
|
+
} else if (this.createData.shape === "Line" ||
|
|
1206
|
+
this.createData.editingIndex > -1) {
|
|
1207
|
+
this.drawLine(data[0].extraData.worldCoords, data);
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
},
|
|
1212
|
+
drawPoint: function(coords, data) {
|
|
1213
|
+
this.createData.points.length = 0;
|
|
1214
|
+
this.createData.points.push(coords);
|
|
1215
|
+
this.showRegionTooltipWithAnnotations(data, true, true);
|
|
1216
|
+
this.createData.toBeConfirmed = true;
|
|
1217
|
+
},
|
|
1218
|
+
drawLine: function(coords, data) {
|
|
1219
|
+
if (this.createData.points.length === 1) {
|
|
1220
|
+
this.createData.points.push(coords);
|
|
1221
|
+
this.showRegionTooltipWithAnnotations(data, true, true);
|
|
1222
|
+
this.createData.toBeConfirmed = true;
|
|
1223
|
+
} else {
|
|
1224
|
+
this._tempPoint = this.$module.scene.addTemporaryPoints([coords], 0xffff00);
|
|
1225
|
+
this.createData.points.push(coords);
|
|
1226
|
+
}
|
|
1227
|
+
},
|
|
987
1228
|
/**
|
|
988
1229
|
* Return renderer information
|
|
989
1230
|
*
|
|
@@ -1010,6 +1251,36 @@ export default {
|
|
|
1010
1251
|
setTimeout(this.stopFreeSpin, 4000);
|
|
1011
1252
|
}
|
|
1012
1253
|
},
|
|
1254
|
+
activateAnnotationMode: function(names, event) {
|
|
1255
|
+
if (this.userInformation) {
|
|
1256
|
+
if ((this.createData.shape !== "") || (this.createData.editingIndex > -1)) {
|
|
1257
|
+
// Create new shape bsaed on current settings
|
|
1258
|
+
if (names.length > 0) {
|
|
1259
|
+
if (event.identifiers[0].coords) {
|
|
1260
|
+
this.createData.x = event.identifiers[0].coords.x;
|
|
1261
|
+
this.createData.y = event.identifiers[0].coords.y;
|
|
1262
|
+
this.draw(event.identifiers);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
} else {
|
|
1266
|
+
//Make sure the tooltip is displayed with annotation mode
|
|
1267
|
+
const editing = getEditableLines(event);
|
|
1268
|
+
if (editing) {
|
|
1269
|
+
this.activateEditingMode(editing.zincObject, editing.faceIndex,
|
|
1270
|
+
editing.vertexIndex, editing.point);
|
|
1271
|
+
}
|
|
1272
|
+
this.showRegionTooltipWithAnnotations(event.identifiers, true, true);
|
|
1273
|
+
}
|
|
1274
|
+
} else {
|
|
1275
|
+
this.showRegionTooltipWithAnnotations(event.identifiers, true, true);
|
|
1276
|
+
}
|
|
1277
|
+
},
|
|
1278
|
+
activateEditingMode: function(zincObject, faceIndex, vertexIndex, point) {
|
|
1279
|
+
this._editingZincObject = zincObject;
|
|
1280
|
+
this.createData.faceIndex = faceIndex;
|
|
1281
|
+
this.createData.editingIndex = vertexIndex;
|
|
1282
|
+
this.drawLine(point, undefined);
|
|
1283
|
+
},
|
|
1013
1284
|
/**
|
|
1014
1285
|
* Callback when a region is selected/highlighted.
|
|
1015
1286
|
* It will also update other controls.
|
|
@@ -1018,7 +1289,6 @@ export default {
|
|
|
1018
1289
|
eventNotifierCallback: function (event) {
|
|
1019
1290
|
const names = [];
|
|
1020
1291
|
let zincObjects = [];
|
|
1021
|
-
const region = undefined;
|
|
1022
1292
|
if (event.eventType == 1 || event.eventType == 2) {
|
|
1023
1293
|
event.identifiers.forEach((identifier) => {
|
|
1024
1294
|
if (identifier) {
|
|
@@ -1033,26 +1303,27 @@ export default {
|
|
|
1033
1303
|
/*
|
|
1034
1304
|
* Event Type 1: Selected
|
|
1035
1305
|
* Event Type 2: Highlighted
|
|
1036
|
-
* Event Type
|
|
1306
|
+
* Event Type 3: Move
|
|
1037
1307
|
*/
|
|
1038
1308
|
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
1309
|
if (this.viewingMode === 'Annotation') {
|
|
1050
|
-
|
|
1051
|
-
|
|
1310
|
+
this.activateAnnotationMode(names, event);
|
|
1311
|
+
|
|
1312
|
+
} else {
|
|
1313
|
+
if (this.$refs.treeControls) {
|
|
1314
|
+
if (names.length > 0) {
|
|
1315
|
+
//this.$refs.treeControls.changeActiveByNames(names, region, false);
|
|
1316
|
+
this.$refs.treeControls.updateActiveUI(zincObjects);
|
|
1317
|
+
this.updatePrimitiveControls(zincObjects);
|
|
1318
|
+
} else {
|
|
1319
|
+
this.hideRegionTooltip();
|
|
1320
|
+
this.$refs.treeControls.removeActive(false);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
//Emit when an object is selected
|
|
1324
|
+
//@arg Identifier of selected objects
|
|
1325
|
+
this.$emit("scaffold-selected", event.identifiers);
|
|
1052
1326
|
}
|
|
1053
|
-
//Emit when an object is selected
|
|
1054
|
-
//@arg Identifier of selected objects
|
|
1055
|
-
this.$emit("scaffold-selected", event.identifiers);
|
|
1056
1327
|
} else if (event.eventType == 2) {
|
|
1057
1328
|
if (this.selectedObjects.length === 0) {
|
|
1058
1329
|
this.hideRegionTooltip();
|
|
@@ -1073,11 +1344,15 @@ export default {
|
|
|
1073
1344
|
this.tData.active = false;
|
|
1074
1345
|
this.tData.visible = true;
|
|
1075
1346
|
this.tData.label = id;
|
|
1076
|
-
if (event.identifiers[0].data.region)
|
|
1347
|
+
if (event.identifiers[0].data.region) {
|
|
1077
1348
|
this.tData.region = event.identifiers[0].data.region;
|
|
1078
|
-
|
|
1349
|
+
}
|
|
1350
|
+
else {
|
|
1351
|
+
this.tData.region = undefined;
|
|
1352
|
+
}
|
|
1079
1353
|
this.tData.x = event.identifiers[0].coords.x;
|
|
1080
1354
|
this.tData.y = event.identifiers[0].coords.y;
|
|
1355
|
+
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1081
1356
|
}
|
|
1082
1357
|
}
|
|
1083
1358
|
//Emit when an object is highlighted
|
|
@@ -1092,7 +1367,9 @@ export default {
|
|
|
1092
1367
|
this.$refs.scaffoldContainer.getBoundingClientRect();
|
|
1093
1368
|
this.tData.x = event.identifiers[0].coords.x - offsets.left;
|
|
1094
1369
|
this.tData.y = event.identifiers[0].coords.y - offsets.top;
|
|
1370
|
+
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1095
1371
|
}
|
|
1372
|
+
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1096
1373
|
}
|
|
1097
1374
|
}
|
|
1098
1375
|
},
|
|
@@ -1126,6 +1403,19 @@ export default {
|
|
|
1126
1403
|
this.$module.updateTime(normalizedTime);
|
|
1127
1404
|
}
|
|
1128
1405
|
},
|
|
1406
|
+
/**
|
|
1407
|
+
* Update primitive controls UI with the specified objects
|
|
1408
|
+
*
|
|
1409
|
+
* @arg objects objects to be set for the selected
|
|
1410
|
+
*/
|
|
1411
|
+
updatePrimitiveControls: function (objects) {
|
|
1412
|
+
this.selectedObjects = objects;
|
|
1413
|
+
if (this.selectedObjects && this.selectedObjects.length > 0) {
|
|
1414
|
+
this.$refs.primitiveControls.setObject(this.selectedObjects[0]);
|
|
1415
|
+
} else {
|
|
1416
|
+
this.$refs.primitiveControls.setObject(undefined);
|
|
1417
|
+
}
|
|
1418
|
+
},
|
|
1129
1419
|
/**
|
|
1130
1420
|
* A callback used by children components. Set the selected zinc object
|
|
1131
1421
|
*
|
|
@@ -1134,11 +1424,8 @@ export default {
|
|
|
1134
1424
|
* is made
|
|
1135
1425
|
*/
|
|
1136
1426
|
objectSelected: function (objects, propagate) {
|
|
1137
|
-
this.
|
|
1138
|
-
|
|
1139
|
-
this.$refs.primitiveControls.setObject(this.selectedObjects[0]);
|
|
1140
|
-
}
|
|
1141
|
-
this.$module.setSelectedByZincObjects(objects, undefined, propagate);
|
|
1427
|
+
this.updatePrimitiveControls(objects);
|
|
1428
|
+
this.$module.setSelectedByZincObjects(objects, undefined, {}, propagate);
|
|
1142
1429
|
},
|
|
1143
1430
|
/**
|
|
1144
1431
|
* A callback used by children components. Set the highlighted zinc object
|
|
@@ -1149,7 +1436,7 @@ export default {
|
|
|
1149
1436
|
*/
|
|
1150
1437
|
objectHovered: function (objects, propagate) {
|
|
1151
1438
|
this.hoveredObjects = objects;
|
|
1152
|
-
this.$module.setHighlightedByZincObjects(objects, undefined, propagate);
|
|
1439
|
+
this.$module.setHighlightedByZincObjects(objects, undefined, {}, propagate);
|
|
1153
1440
|
},
|
|
1154
1441
|
/**
|
|
1155
1442
|
* Set the selected by name.
|
|
@@ -1364,6 +1651,41 @@ export default {
|
|
|
1364
1651
|
this.hideRegionTooltip();
|
|
1365
1652
|
return false;
|
|
1366
1653
|
},
|
|
1654
|
+
/**
|
|
1655
|
+
* Callback on viewing mode change
|
|
1656
|
+
*/
|
|
1657
|
+
viewingModeChange: function () {
|
|
1658
|
+
if (this.$module) {
|
|
1659
|
+
if (this.viewingMode === "Annotation") {
|
|
1660
|
+
let authenticated = false;
|
|
1661
|
+
if (this.userInformation) {
|
|
1662
|
+
authenticated = true;
|
|
1663
|
+
}
|
|
1664
|
+
this.userInformation = undefined;
|
|
1665
|
+
this.annotator.authenticate(this.userToken).then((userData) => {
|
|
1666
|
+
if (userData.name && userData.email) {
|
|
1667
|
+
this.userInformation = userData;
|
|
1668
|
+
//Only draw annotations stored in the server on initial authentication
|
|
1669
|
+
if (!authenticated) {
|
|
1670
|
+
getDrawnAnnotations(this.annotator, this.userToken, this.url).then((payload) => {
|
|
1671
|
+
if (payload && payload.features) {
|
|
1672
|
+
annotationFeaturesToPrimitives(this.$module.scene, payload.features);
|
|
1673
|
+
}
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
});
|
|
1678
|
+
}
|
|
1679
|
+
if ((this.viewingMode === "Exploration") ||
|
|
1680
|
+
(this.viewingMode === "Annotation") &&
|
|
1681
|
+
(this.createData.shape === "")) {
|
|
1682
|
+
this.$module.selectObjectOnPick = true;
|
|
1683
|
+
} else {
|
|
1684
|
+
this.$module.selectObjectOnPick = false;
|
|
1685
|
+
}
|
|
1686
|
+
this.cancelCreate();
|
|
1687
|
+
}
|
|
1688
|
+
},
|
|
1367
1689
|
/**
|
|
1368
1690
|
* @vuese
|
|
1369
1691
|
* Hide the tooltip
|
|
@@ -1525,6 +1847,8 @@ export default {
|
|
|
1525
1847
|
//Emit when all objects have been loaded
|
|
1526
1848
|
this.$emit("on-ready");
|
|
1527
1849
|
this.setMarkers();
|
|
1850
|
+
this._boundingBoxGeo = this.$module.scene.addBoundingBoxPrimitive(
|
|
1851
|
+
"_helper", "boundingBox", 0x40E0D0, 0.15);
|
|
1528
1852
|
this.isReady = true;
|
|
1529
1853
|
};
|
|
1530
1854
|
},
|
|
@@ -1609,6 +1933,7 @@ export default {
|
|
|
1609
1933
|
this._currentURL = newValue;
|
|
1610
1934
|
if (this.$refs.treeControls) this.$refs.treeControls.clear();
|
|
1611
1935
|
this.loading = true;
|
|
1936
|
+
this.timeVarying = false;
|
|
1612
1937
|
this.isReady = false;
|
|
1613
1938
|
this.$_searchIndex.removeAll();
|
|
1614
1939
|
this.hideRegionTooltip();
|
|
@@ -1862,6 +2187,17 @@ export default {
|
|
|
1862
2187
|
padding-left: 8px;
|
|
1863
2188
|
}
|
|
1864
2189
|
|
|
2190
|
+
.bottom-draw-control {
|
|
2191
|
+
background-color: var(--el-color-primary-light-9);
|
|
2192
|
+
padding: 4px 4px 2px 4px;
|
|
2193
|
+
border-style: solid;
|
|
2194
|
+
border-color: var(--el-color-primary-light-5);
|
|
2195
|
+
border-radius: 1rem;
|
|
2196
|
+
position: absolute;
|
|
2197
|
+
right: calc(50vw - 100px);;
|
|
2198
|
+
bottom: 16px;
|
|
2199
|
+
}
|
|
2200
|
+
|
|
1865
2201
|
:deep(.non-selectable) {
|
|
1866
2202
|
user-select: none;
|
|
1867
2203
|
}
|
|
@@ -1970,6 +2306,20 @@ export default {
|
|
|
1970
2306
|
&:hover {
|
|
1971
2307
|
cursor: pointer;
|
|
1972
2308
|
}
|
|
2309
|
+
|
|
2310
|
+
&:focus {
|
|
2311
|
+
border: none;
|
|
2312
|
+
outline: none;
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
&.shape {
|
|
2316
|
+
margin-left: 4px;
|
|
2317
|
+
margin-right: 4px;
|
|
2318
|
+
color: var(--el-color-primary-light-5);
|
|
2319
|
+
&.active {
|
|
2320
|
+
color: var(--el-color-primary);
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
1973
2323
|
}
|
|
1974
2324
|
|
|
1975
2325
|
.bottom-right-control {
|
|
@@ -2116,6 +2466,7 @@ export default {
|
|
|
2116
2466
|
<style lang="scss">
|
|
2117
2467
|
.scaffold-container {
|
|
2118
2468
|
--el-color-primary: #8300BF;
|
|
2469
|
+
--el-color-primary-light-5: #cd99e5;
|
|
2119
2470
|
--el-color-primary-light-7: #dab3ec;
|
|
2120
2471
|
--el-color-primary-light-8: #e6ccf2
|
|
2121
2472
|
--el-color-primary-light-9: #f3e6f9;
|