@abi-software/scaffoldvuer 1.4.1 → 1.5.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 +11076 -10949
- package/dist/scaffoldvuer.umd.cjs +176 -176
- package/dist/style.css +1 -1
- package/package.json +6 -9
- package/src/components/ScaffoldTooltip.vue +3 -3
- package/src/components/ScaffoldVuer.vue +107 -71
- package/src/scripts/Utilities.js +3 -3
- package/vuese-generator.js +75 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/scaffoldvuer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,18 +41,17 @@
|
|
|
41
41
|
"*.js"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@abi-software/map-utilities": "^1.1.
|
|
44
|
+
"@abi-software/map-utilities": "^1.1.2",
|
|
45
45
|
"@abi-software/sparc-annotation": "^0.3.1",
|
|
46
|
-
"@abi-software/svg-sprite": "^1.0.
|
|
46
|
+
"@abi-software/svg-sprite": "^1.0.1",
|
|
47
47
|
"@element-plus/icons-vue": "^2.3.1",
|
|
48
|
-
"@vue/compat": "^3.4.15",
|
|
49
48
|
"core-js": "^3.22.5",
|
|
50
|
-
"element-plus": "
|
|
49
|
+
"element-plus": "2.8.4",
|
|
51
50
|
"minisearch": "^6.0.1",
|
|
52
51
|
"pinia": "^2.1.7",
|
|
53
52
|
"simple-dropzone": "^0.8.3",
|
|
54
53
|
"unplugin-vue-components": "^0.26.0",
|
|
55
|
-
"vue": "^3.4.
|
|
54
|
+
"vue": "^3.4.21",
|
|
56
55
|
"vue-router": "^4.2.5",
|
|
57
56
|
"vue3-component-svg-sprite": "^0.0.1",
|
|
58
57
|
"zincjs": "^1.11.4"
|
|
@@ -60,11 +59,9 @@
|
|
|
60
59
|
"devDependencies": {
|
|
61
60
|
"@vitejs/plugin-vue": "^4.6.2",
|
|
62
61
|
"@vuese/markdown-render": "^2.11.3",
|
|
63
|
-
"@vuese/parser": "^2.10.3",
|
|
64
62
|
"auto-changelog": "^2.4.0",
|
|
65
63
|
"babel-eslint": "^10.1.0",
|
|
66
64
|
"babel-plugin-component": "^1.1.1",
|
|
67
|
-
"base64-inline-loader": "^2.0.1",
|
|
68
65
|
"chokidar": "^3.6.0",
|
|
69
66
|
"concurrently": "^8.2.2",
|
|
70
67
|
"eslint": "^8.56.0",
|
|
@@ -73,7 +70,7 @@
|
|
|
73
70
|
"vite": "^5.0.10",
|
|
74
71
|
"vite-plugin-node-polyfills": "^0.21.0",
|
|
75
72
|
"vitepress": "^1.0.0-rc.42",
|
|
76
|
-
"
|
|
73
|
+
"vue-docgen-api": "^4.79.2"
|
|
77
74
|
},
|
|
78
75
|
"eslintConfig": {
|
|
79
76
|
"root": true,
|
|
@@ -153,9 +153,9 @@ export default {
|
|
|
153
153
|
if (this.annotationDisplay) {
|
|
154
154
|
const region = this.region ? this.region +"/" : "";
|
|
155
155
|
this.annotationEntry = {
|
|
156
|
-
"featureId":
|
|
157
|
-
"resourceId":
|
|
158
|
-
"resource":
|
|
156
|
+
"featureId": region + this.label,
|
|
157
|
+
"resourceId": this.scaffoldUrl,
|
|
158
|
+
"resource": this.scaffoldUrl,
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -570,12 +570,12 @@ export default {
|
|
|
570
570
|
* GroupName to value pair.
|
|
571
571
|
* The value can be a single number or and object in the following
|
|
572
572
|
* form:
|
|
573
|
-
*
|
|
573
|
+
*
|
|
574
574
|
* {
|
|
575
575
|
* number: Number,
|
|
576
576
|
* imgURL: String
|
|
577
577
|
* }
|
|
578
|
-
*
|
|
578
|
+
*
|
|
579
579
|
* When imgURL is specified, scaffoldvuer will attempt to render
|
|
580
580
|
* the image in imgURL as marker instead.
|
|
581
581
|
*
|
|
@@ -870,8 +870,10 @@ export default {
|
|
|
870
870
|
},
|
|
871
871
|
currentTime: {
|
|
872
872
|
handler: function () {
|
|
873
|
-
|
|
874
|
-
|
|
873
|
+
/**
|
|
874
|
+
* Emit when time in the current scene has changed
|
|
875
|
+
* @arg {String} "Current time in scene"
|
|
876
|
+
*/
|
|
875
877
|
this.$emit("timeChanged", this.currentTime);
|
|
876
878
|
},
|
|
877
879
|
},
|
|
@@ -940,15 +942,15 @@ export default {
|
|
|
940
942
|
...mapState(useMainStore, ['userToken']),
|
|
941
943
|
annotationDisplay: function() {
|
|
942
944
|
return this.viewingMode === 'Annotation' && this.tData.active === true &&
|
|
943
|
-
(this.activeDrawMode
|
|
945
|
+
(this.activeDrawMode !== "Point" && this.activeDrawMode !== 'LineString');
|
|
944
946
|
}
|
|
945
947
|
},
|
|
946
948
|
methods: {
|
|
947
949
|
/**
|
|
948
|
-
* @
|
|
950
|
+
* @public
|
|
949
951
|
* Call this to manually add a zinc object into the current scene.
|
|
950
952
|
* This will subsequently trigger a zincObjectAdded
|
|
951
|
-
* @arg ZincObject object to be added
|
|
953
|
+
* @arg {Object} "ZincObject object to be added"
|
|
952
954
|
*/
|
|
953
955
|
addZincObject: function (zincObject) {
|
|
954
956
|
if (this.$module.scene) {
|
|
@@ -966,8 +968,10 @@ export default {
|
|
|
966
968
|
if (this.timeVarying === false && zincObject.isTimeVarying()) {
|
|
967
969
|
this.timeVarying = true;
|
|
968
970
|
}
|
|
969
|
-
|
|
970
|
-
|
|
971
|
+
/**
|
|
972
|
+
* Emit when a new object is added to the scene
|
|
973
|
+
* @arg {Object} "The object added to the sceene"
|
|
974
|
+
*/
|
|
971
975
|
this.$emit("zinc-object-added", zincObject);
|
|
972
976
|
},
|
|
973
977
|
/**
|
|
@@ -1048,10 +1052,10 @@ export default {
|
|
|
1048
1052
|
hrefElement.remove();
|
|
1049
1053
|
},
|
|
1050
1054
|
/**
|
|
1051
|
-
* @
|
|
1055
|
+
* @public
|
|
1052
1056
|
* Function for capturing a screenshot of the current rendering.
|
|
1053
1057
|
*
|
|
1054
|
-
* @arg filename given to the screenshot.
|
|
1058
|
+
* @arg {String} "filename given to the screenshot."
|
|
1055
1059
|
*/
|
|
1056
1060
|
captureScreenshot: function (filename) {
|
|
1057
1061
|
this.captureFilename = filename;
|
|
@@ -1060,7 +1064,7 @@ export default {
|
|
|
1060
1064
|
);
|
|
1061
1065
|
},
|
|
1062
1066
|
/**
|
|
1063
|
-
* @
|
|
1067
|
+
* @public
|
|
1064
1068
|
* Function to clear current scene, the tree controls and the search index.
|
|
1065
1069
|
*/
|
|
1066
1070
|
clearScene: function () {
|
|
@@ -1069,15 +1073,19 @@ export default {
|
|
|
1069
1073
|
if (this.$module.scene) this.$module.scene.clearAll();
|
|
1070
1074
|
},
|
|
1071
1075
|
/**
|
|
1072
|
-
* @
|
|
1076
|
+
* @public
|
|
1073
1077
|
* Add and edit local annotations
|
|
1078
|
+
* @arg `region`,
|
|
1079
|
+
* @arg `group`,
|
|
1080
|
+
* @arg `zincObject`,
|
|
1081
|
+
* @arg `comment`
|
|
1074
1082
|
*/
|
|
1075
1083
|
addAndEditAnnotations: function (region, group, zincObject, comment) {
|
|
1076
1084
|
const annotation = addUserAnnotationWithFeature(this.annotator, this.userToken, zincObject,
|
|
1077
1085
|
region, group, this.url, comment);
|
|
1078
1086
|
if (this.enableLocalAnnotations) {
|
|
1079
1087
|
annotation.group = group;
|
|
1080
|
-
let regionPath = region;
|
|
1088
|
+
let regionPath = region;
|
|
1081
1089
|
if (regionPath.slice(-1) === "/") {
|
|
1082
1090
|
regionPath = regionPath.slice(0, -1);
|
|
1083
1091
|
}
|
|
@@ -1089,9 +1097,10 @@ export default {
|
|
|
1089
1097
|
this.$emit('userPrimitivesUpdated', {region, group, zincObject});
|
|
1090
1098
|
},
|
|
1091
1099
|
/**
|
|
1092
|
-
* @
|
|
1100
|
+
* @public
|
|
1093
1101
|
* Callback for when primitives have been update using primitive controls.
|
|
1094
1102
|
* This is only called from callback.
|
|
1103
|
+
* @arg `object`
|
|
1095
1104
|
*/
|
|
1096
1105
|
primitivesUpdated: function(object) {
|
|
1097
1106
|
if (object.isZincObject && object.isEditable) {
|
|
@@ -1101,8 +1110,9 @@ export default {
|
|
|
1101
1110
|
}
|
|
1102
1111
|
},
|
|
1103
1112
|
/**
|
|
1104
|
-
* @
|
|
1113
|
+
* @public
|
|
1105
1114
|
* Confirm creation of new primitive. This is only called from callback.
|
|
1115
|
+
* @arg `payload`
|
|
1106
1116
|
*/
|
|
1107
1117
|
confirmCreate: function(payload) {
|
|
1108
1118
|
if (payload) {
|
|
@@ -1180,7 +1190,7 @@ export default {
|
|
|
1180
1190
|
}
|
|
1181
1191
|
}
|
|
1182
1192
|
this.cancelCreate();
|
|
1183
|
-
},
|
|
1193
|
+
},
|
|
1184
1194
|
formatTooltip(val) {
|
|
1185
1195
|
if (this.timeMax >= 1000) {
|
|
1186
1196
|
if (val) {
|
|
@@ -1192,7 +1202,7 @@ export default {
|
|
|
1192
1202
|
return val ? val.toFixed(2) + " ms" : "0 ms";
|
|
1193
1203
|
},
|
|
1194
1204
|
/**
|
|
1195
|
-
* @
|
|
1205
|
+
* @public
|
|
1196
1206
|
* Function to reset the view to default.
|
|
1197
1207
|
* Also called when the associated button is pressed.
|
|
1198
1208
|
*/
|
|
@@ -1214,7 +1224,7 @@ export default {
|
|
|
1214
1224
|
}
|
|
1215
1225
|
},
|
|
1216
1226
|
/**
|
|
1217
|
-
* @
|
|
1227
|
+
* @public
|
|
1218
1228
|
* Function to zoom in.
|
|
1219
1229
|
* Also called when the associated button is pressed.
|
|
1220
1230
|
*/
|
|
@@ -1227,7 +1237,7 @@ export default {
|
|
|
1227
1237
|
* Function to zoom out.
|
|
1228
1238
|
* Also called when the associated button is pressed.
|
|
1229
1239
|
*
|
|
1230
|
-
* @
|
|
1240
|
+
* @public
|
|
1231
1241
|
*/
|
|
1232
1242
|
zoomOut: function () {
|
|
1233
1243
|
if (this.$module.scene) {
|
|
@@ -1237,7 +1247,8 @@ export default {
|
|
|
1237
1247
|
/**
|
|
1238
1248
|
* Function to change the current play speed.
|
|
1239
1249
|
*
|
|
1240
|
-
* @
|
|
1250
|
+
* @public
|
|
1251
|
+
* @arg `speed`
|
|
1241
1252
|
*/
|
|
1242
1253
|
speedChanged: function (speed) {
|
|
1243
1254
|
this.currentSpeed = speed;
|
|
@@ -1246,7 +1257,7 @@ export default {
|
|
|
1246
1257
|
/**
|
|
1247
1258
|
* Function used to stop the free spin
|
|
1248
1259
|
*
|
|
1249
|
-
* @
|
|
1260
|
+
* @public
|
|
1250
1261
|
*/
|
|
1251
1262
|
stopFreeSpin: function () {
|
|
1252
1263
|
let cameracontrol = this.$module.scene.getZincCameraControls();
|
|
@@ -1255,9 +1266,9 @@ export default {
|
|
|
1255
1266
|
},
|
|
1256
1267
|
/**
|
|
1257
1268
|
* Return a list of obejcts with the provided name.
|
|
1258
|
-
* @arg Group name to search.
|
|
1269
|
+
* @arg "Group name to search."
|
|
1259
1270
|
*
|
|
1260
|
-
* @
|
|
1271
|
+
* @public
|
|
1261
1272
|
*/
|
|
1262
1273
|
findObjectsWithGroupName: function (name) {
|
|
1263
1274
|
let objects = [];
|
|
@@ -1267,10 +1278,10 @@ export default {
|
|
|
1267
1278
|
return objects;
|
|
1268
1279
|
},
|
|
1269
1280
|
/**
|
|
1270
|
-
*
|
|
1271
|
-
*
|
|
1272
|
-
*
|
|
1273
|
-
* @
|
|
1281
|
+
* @public
|
|
1282
|
+
* Switch active drawing type
|
|
1283
|
+
* @arg {String} `type`
|
|
1284
|
+
* @arg {String} `icon`
|
|
1274
1285
|
*/
|
|
1275
1286
|
toggleDrawing: function (type, icon) {
|
|
1276
1287
|
this.createData.toBeDeleted = false;
|
|
@@ -1287,16 +1298,16 @@ export default {
|
|
|
1287
1298
|
/**
|
|
1288
1299
|
* Toggle the drawing box which aid the drawing
|
|
1289
1300
|
*
|
|
1290
|
-
* @
|
|
1301
|
+
* @public
|
|
1291
1302
|
*/
|
|
1292
1303
|
toggleDrawingBox: function () {
|
|
1293
1304
|
this.createData.drawingBox = !this.createData.drawingBox;
|
|
1294
1305
|
},
|
|
1295
1306
|
/**
|
|
1296
1307
|
* Find and and zoom into objects with the provided list of names.
|
|
1297
|
-
* @arg List of names
|
|
1308
|
+
* @arg "List of names"
|
|
1298
1309
|
*
|
|
1299
|
-
* @
|
|
1310
|
+
* @public
|
|
1300
1311
|
*/
|
|
1301
1312
|
viewRegion: function (names) {
|
|
1302
1313
|
const rootRegion = this.$module.scene.getRootRegion();
|
|
@@ -1340,10 +1351,14 @@ export default {
|
|
|
1340
1351
|
}
|
|
1341
1352
|
}
|
|
1342
1353
|
},
|
|
1343
|
-
createEditTemporaryLines: function(
|
|
1354
|
+
createEditTemporaryLines: function(identifiers) {
|
|
1355
|
+
const worldCoords = identifiers[0].extraData.worldCoords;
|
|
1344
1356
|
if (worldCoords) {
|
|
1345
1357
|
if (this.createData.shape === "LineString" || this.createData.editingIndex > -1) {
|
|
1346
1358
|
if (this.createData.points.length === 1) {
|
|
1359
|
+
this.showRegionTooltipWithAnnotations(identifiers, true, false);
|
|
1360
|
+
this.tData.x = 50;
|
|
1361
|
+
this.tData.y = 200;
|
|
1347
1362
|
if (this._tempLine) {
|
|
1348
1363
|
const positionAttribute = this._tempLine.geometry.getAttribute( 'position' );
|
|
1349
1364
|
positionAttribute.setXYZ(1, worldCoords[0], worldCoords[1], worldCoords[2]);
|
|
@@ -1392,11 +1407,11 @@ export default {
|
|
|
1392
1407
|
this.createData.points.push(coords);
|
|
1393
1408
|
}
|
|
1394
1409
|
}
|
|
1395
|
-
},
|
|
1410
|
+
},
|
|
1396
1411
|
/**
|
|
1397
1412
|
* Return renderer information
|
|
1398
1413
|
*
|
|
1399
|
-
* @
|
|
1414
|
+
* @public
|
|
1400
1415
|
*/
|
|
1401
1416
|
getRendererInfo: function () {
|
|
1402
1417
|
if (this.$module.zincRenderer) {
|
|
@@ -1408,7 +1423,7 @@ export default {
|
|
|
1408
1423
|
* Function used to rotate the scene.
|
|
1409
1424
|
* Also called when the associated button is pressed.
|
|
1410
1425
|
*
|
|
1411
|
-
* @
|
|
1426
|
+
* @public
|
|
1412
1427
|
*/
|
|
1413
1428
|
freeSpin: function () {
|
|
1414
1429
|
if (this.$module.scene) {
|
|
@@ -1446,7 +1461,7 @@ export default {
|
|
|
1446
1461
|
this._editingZincObject = zincObject;
|
|
1447
1462
|
}
|
|
1448
1463
|
}
|
|
1449
|
-
if (this.activeDrawMode
|
|
1464
|
+
if (this.activeDrawMode !== "Point" && this.activeDrawMode !== "LineString") {
|
|
1450
1465
|
this.showRegionTooltipWithAnnotations(event.identifiers, true, false);
|
|
1451
1466
|
this.tData.x = 50;
|
|
1452
1467
|
this.tData.y = 200;
|
|
@@ -1503,8 +1518,10 @@ export default {
|
|
|
1503
1518
|
this.$refs.scaffoldTreeControls.removeActive(false);
|
|
1504
1519
|
}
|
|
1505
1520
|
}
|
|
1506
|
-
|
|
1507
|
-
|
|
1521
|
+
/**
|
|
1522
|
+
* Emit when an object is selected
|
|
1523
|
+
* @arg {Object} "Identifier of selected objects"
|
|
1524
|
+
*/
|
|
1508
1525
|
this.$emit("scaffold-selected", event.identifiers);
|
|
1509
1526
|
}
|
|
1510
1527
|
} else if (event.eventType == 2) {
|
|
@@ -1535,11 +1552,13 @@ export default {
|
|
|
1535
1552
|
}
|
|
1536
1553
|
this.tData.x = event.identifiers[0].coords.x;
|
|
1537
1554
|
this.tData.y = event.identifiers[0].coords.y;
|
|
1538
|
-
this.createEditTemporaryLines(event.identifiers
|
|
1555
|
+
this.createEditTemporaryLines(event.identifiers);
|
|
1539
1556
|
}
|
|
1540
1557
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1558
|
+
/**
|
|
1559
|
+
* Emit when an object is highlighted
|
|
1560
|
+
* @arg {Object} "Identifier of selected objects"
|
|
1561
|
+
*/
|
|
1543
1562
|
this.$emit("scaffold-highlighted", event.identifiers);
|
|
1544
1563
|
}
|
|
1545
1564
|
} else if (event.eventType == 3) {
|
|
@@ -1550,9 +1569,8 @@ export default {
|
|
|
1550
1569
|
this.$refs.scaffoldContainer.getBoundingClientRect();
|
|
1551
1570
|
this.tData.x = event.identifiers[0].coords.x - offsets.left;
|
|
1552
1571
|
this.tData.y = event.identifiers[0].coords.y - offsets.top;
|
|
1553
|
-
this.createEditTemporaryLines(event.identifiers[0].extraData.worldCoords);
|
|
1554
1572
|
}
|
|
1555
|
-
this.createEditTemporaryLines(event.identifiers
|
|
1573
|
+
this.createEditTemporaryLines(event.identifiers);
|
|
1556
1574
|
}
|
|
1557
1575
|
}
|
|
1558
1576
|
}
|
|
@@ -1560,7 +1578,7 @@ export default {
|
|
|
1560
1578
|
/**
|
|
1561
1579
|
* Get the coordinates of the current selected region.
|
|
1562
1580
|
*
|
|
1563
|
-
* @
|
|
1581
|
+
* @public
|
|
1564
1582
|
*/
|
|
1565
1583
|
getCoordinatesOfSelected: function () {
|
|
1566
1584
|
if (this.selectedObjects && this.selectedObjects.length > 0) {
|
|
@@ -1573,7 +1591,7 @@ export default {
|
|
|
1573
1591
|
* current selected region which will be updated after each render
|
|
1574
1592
|
* loop.
|
|
1575
1593
|
*
|
|
1576
|
-
* @
|
|
1594
|
+
* @public
|
|
1577
1595
|
*/
|
|
1578
1596
|
getDynamicSelectedCoordinates: function () {
|
|
1579
1597
|
return this.$module.selectedScreenCoordinates;
|
|
@@ -1653,10 +1671,10 @@ export default {
|
|
|
1653
1671
|
}
|
|
1654
1672
|
},
|
|
1655
1673
|
/**
|
|
1656
|
-
* @
|
|
1674
|
+
* @public
|
|
1657
1675
|
* Start the animation.
|
|
1658
1676
|
*
|
|
1659
|
-
* @arg flag to turn the animation on/off
|
|
1677
|
+
* @arg "flag to turn the animation on/off"
|
|
1660
1678
|
*/
|
|
1661
1679
|
play: function (flag) {
|
|
1662
1680
|
this.$module.playAnimation(flag);
|
|
@@ -1665,7 +1683,7 @@ export default {
|
|
|
1665
1683
|
//this.hideRegionTooltip();
|
|
1666
1684
|
},
|
|
1667
1685
|
/**
|
|
1668
|
-
* @
|
|
1686
|
+
* @public
|
|
1669
1687
|
* Function to toggle on/off overlay help.
|
|
1670
1688
|
*/
|
|
1671
1689
|
setHelpMode: function (helpMode) {
|
|
@@ -1893,7 +1911,7 @@ export default {
|
|
|
1893
1911
|
}
|
|
1894
1912
|
this.userInformation = undefined;
|
|
1895
1913
|
this.annotator.authenticate(this.userToken).then((userData) => {
|
|
1896
|
-
if (userData.name && userData.email) {
|
|
1914
|
+
if (userData.name && userData.email && userData.canUpdate) {
|
|
1897
1915
|
this.userInformation = userData;
|
|
1898
1916
|
//Only draw annotations stored in the server on initial authentication
|
|
1899
1917
|
if (!authenticated) {
|
|
@@ -1902,6 +1920,12 @@ export default {
|
|
|
1902
1920
|
annotationFeaturesToPrimitives(this.$module.scene, payload.features);
|
|
1903
1921
|
}
|
|
1904
1922
|
});
|
|
1923
|
+
//Support previously supported encoded resource
|
|
1924
|
+
getDrawnAnnotations(this.annotator, this.userToken, encodeURIComponent(this.url)).then((payload) => {
|
|
1925
|
+
if (payload && payload.features) {
|
|
1926
|
+
annotationFeaturesToPrimitives(this.$module.scene, payload.features);
|
|
1927
|
+
}
|
|
1928
|
+
});
|
|
1905
1929
|
}
|
|
1906
1930
|
}
|
|
1907
1931
|
});
|
|
@@ -1921,7 +1945,7 @@ export default {
|
|
|
1921
1945
|
}
|
|
1922
1946
|
},
|
|
1923
1947
|
/**
|
|
1924
|
-
* @
|
|
1948
|
+
* @public
|
|
1925
1949
|
* Hide the tooltip
|
|
1926
1950
|
*/
|
|
1927
1951
|
hideRegionTooltip: function () {
|
|
@@ -1939,7 +1963,7 @@ export default {
|
|
|
1939
1963
|
/**
|
|
1940
1964
|
* Set the marker modes for objects with the provided name, mode can
|
|
1941
1965
|
* be "on", "off" or "inherited".
|
|
1942
|
-
* Value can either be number or an object containing number and
|
|
1966
|
+
* Value can either be number or an object containing number and
|
|
1943
1967
|
* imgURL.
|
|
1944
1968
|
*/
|
|
1945
1969
|
setMarkerModeForObjectsWithName: function (name, value, mode) {
|
|
@@ -1955,8 +1979,10 @@ export default {
|
|
|
1955
1979
|
}
|
|
1956
1980
|
},
|
|
1957
1981
|
/**
|
|
1958
|
-
* @
|
|
1982
|
+
* @public
|
|
1959
1983
|
* Set the marker modes for objects specified by the list of annotations
|
|
1984
|
+
* @arg `annotations`
|
|
1985
|
+
* @arg `mode`
|
|
1960
1986
|
*/
|
|
1961
1987
|
setMarkerModeWithAnnotations: function (annotations, mode) {
|
|
1962
1988
|
if (this.$module.scene) {
|
|
@@ -1994,11 +2020,11 @@ export default {
|
|
|
1994
2020
|
}
|
|
1995
2021
|
},
|
|
1996
2022
|
/**
|
|
1997
|
-
* @
|
|
2023
|
+
* @public
|
|
1998
2024
|
*
|
|
1999
2025
|
* Search a object and display the tooltip
|
|
2000
|
-
* @arg text to search across
|
|
2001
|
-
* @arg toggle the tooltip if this is set
|
|
2026
|
+
* @arg "text to search across"
|
|
2027
|
+
* @arg "toggle the tooltip if this is set"
|
|
2002
2028
|
*/
|
|
2003
2029
|
search: function (text, displayLabel) {
|
|
2004
2030
|
if (this.$_searchIndex) {
|
|
@@ -2034,10 +2060,11 @@ export default {
|
|
|
2034
2060
|
return false;
|
|
2035
2061
|
},
|
|
2036
2062
|
/**
|
|
2037
|
-
* @
|
|
2063
|
+
* @public
|
|
2038
2064
|
*
|
|
2039
2065
|
* Get the list of suggested terms based on the provided term.
|
|
2040
2066
|
* This can be used for autocomplete.
|
|
2067
|
+
* @arg `term`
|
|
2041
2068
|
*/
|
|
2042
2069
|
fetchSuggestions: function (term) {
|
|
2043
2070
|
if (this.$_searchIndex === undefined) return [];
|
|
@@ -2092,7 +2119,9 @@ export default {
|
|
|
2092
2119
|
this.$module.updateTime(0);
|
|
2093
2120
|
this.$module.unsetFinishDownloadCallback();
|
|
2094
2121
|
this.addRegionsToSearchIndex();
|
|
2095
|
-
|
|
2122
|
+
/**
|
|
2123
|
+
* Emit when all objects have been loaded
|
|
2124
|
+
*/
|
|
2096
2125
|
this.$emit("on-ready");
|
|
2097
2126
|
this.setMarkers();
|
|
2098
2127
|
//Create a bounding box.
|
|
@@ -2112,7 +2141,7 @@ export default {
|
|
|
2112
2141
|
* Function used for getting the current states of the scene. This exported states
|
|
2113
2142
|
* can be imported using the importStates method.
|
|
2114
2143
|
*
|
|
2115
|
-
* @
|
|
2144
|
+
* @public
|
|
2116
2145
|
*/
|
|
2117
2146
|
getState: function () {
|
|
2118
2147
|
let state = {
|
|
@@ -2133,7 +2162,8 @@ export default {
|
|
|
2133
2162
|
* Function used for importing the states of the scene. This exported states
|
|
2134
2163
|
* can be imported using the read states method.
|
|
2135
2164
|
*
|
|
2136
|
-
* @
|
|
2165
|
+
* @public
|
|
2166
|
+
* @arg `state`
|
|
2137
2167
|
*/
|
|
2138
2168
|
setState: function (state) {
|
|
2139
2169
|
if (state) {
|
|
@@ -2166,9 +2196,9 @@ export default {
|
|
|
2166
2196
|
},
|
|
2167
2197
|
/**
|
|
2168
2198
|
* export current scene in GLTF.
|
|
2169
|
-
* @arg Return in binary form when set to true
|
|
2199
|
+
* @arg "Return in binary form when set to true"
|
|
2170
2200
|
*
|
|
2171
|
-
* @
|
|
2201
|
+
* @public
|
|
2172
2202
|
*/
|
|
2173
2203
|
exportGLTF: function (binary) {
|
|
2174
2204
|
return this.$module.scene.exportGLTF(binary);
|
|
@@ -2178,7 +2208,7 @@ export default {
|
|
|
2178
2208
|
* This list is used for storing user created annotation
|
|
2179
2209
|
* when enableLocalAnnotations is set to true.
|
|
2180
2210
|
*
|
|
2181
|
-
* @
|
|
2211
|
+
* @public
|
|
2182
2212
|
*/
|
|
2183
2213
|
getLocalAnnotations: function () {
|
|
2184
2214
|
return [...this.localAnnotationsList];
|
|
@@ -2188,7 +2218,8 @@ export default {
|
|
|
2188
2218
|
* be imported when enableLocalAnnotations is set to
|
|
2189
2219
|
* true;
|
|
2190
2220
|
*
|
|
2191
|
-
* @
|
|
2221
|
+
* @public
|
|
2222
|
+
* @arg {Array} `annotationsList`
|
|
2192
2223
|
*/
|
|
2193
2224
|
importLocalAnnotations: function (annotationsList) {
|
|
2194
2225
|
if (this.enableLocalAnnotations) {
|
|
@@ -2198,9 +2229,9 @@ export default {
|
|
|
2198
2229
|
const region = annotation.region;
|
|
2199
2230
|
let fullName = region.slice(-1) === "/" ? region : region + "/";
|
|
2200
2231
|
const noSlash = fullName.slice(0, -1);
|
|
2201
|
-
annotation.region = noSlash;
|
|
2232
|
+
annotation.region = noSlash;
|
|
2202
2233
|
fullName = fullName + group;
|
|
2203
|
-
const featureID =
|
|
2234
|
+
const featureID = fullName;
|
|
2204
2235
|
annotation.item.id = featureID;
|
|
2205
2236
|
annotation.feature.id = featureID;
|
|
2206
2237
|
});
|
|
@@ -2217,7 +2248,9 @@ export default {
|
|
|
2217
2248
|
* viewport. This function will ignore the state prop and
|
|
2218
2249
|
* read in the new url.
|
|
2219
2250
|
*
|
|
2220
|
-
* @
|
|
2251
|
+
* @public
|
|
2252
|
+
* @arg `newValue`
|
|
2253
|
+
* @arg `state`
|
|
2221
2254
|
*/
|
|
2222
2255
|
setURLAndState: function (newValue, state) {
|
|
2223
2256
|
if (newValue != this._currentURL) {
|
|
@@ -2264,7 +2297,8 @@ export default {
|
|
|
2264
2297
|
* Function used for reading in new scaffold metadata. This function will ignore
|
|
2265
2298
|
* the state prop and read in the new url.
|
|
2266
2299
|
*
|
|
2267
|
-
* @
|
|
2300
|
+
* @public
|
|
2301
|
+
* @arg `newValue`
|
|
2268
2302
|
*/
|
|
2269
2303
|
setURL: function (newValue) {
|
|
2270
2304
|
this.setURLAndState(newValue, undefined);
|
|
@@ -2300,7 +2334,7 @@ export default {
|
|
|
2300
2334
|
}
|
|
2301
2335
|
},
|
|
2302
2336
|
/**
|
|
2303
|
-
* @
|
|
2337
|
+
* @public
|
|
2304
2338
|
*
|
|
2305
2339
|
* Force the renderer to resize
|
|
2306
2340
|
*/
|
|
@@ -2314,9 +2348,11 @@ export default {
|
|
|
2314
2348
|
if (this.tData.visible) {
|
|
2315
2349
|
this.showRegionTooltip(this.tData.label, true, true);
|
|
2316
2350
|
}
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2351
|
+
/**
|
|
2352
|
+
* Emit when the scene has been transformed due to navigation,
|
|
2353
|
+
* only triggered during syncControl mode
|
|
2354
|
+
* @arg {Object} "Information on the navigation"
|
|
2355
|
+
*/
|
|
2320
2356
|
this.$emit("scaffold-navigated", payload);
|
|
2321
2357
|
},
|
|
2322
2358
|
/**
|
package/src/scripts/Utilities.js
CHANGED
|
@@ -301,9 +301,9 @@ const createNewAnnotationsWithFeatures = (zincObject, region, group, scaffoldUrl
|
|
|
301
301
|
//Check if region ends with a slash
|
|
302
302
|
let fullName = region.slice(-1) === "/" ? region : region + "/";
|
|
303
303
|
fullName = fullName + group;
|
|
304
|
-
const featureID =
|
|
304
|
+
const featureID = fullName;
|
|
305
305
|
const userAnnotation = {
|
|
306
|
-
resource:
|
|
306
|
+
resource: scaffoldUrl,
|
|
307
307
|
item: {
|
|
308
308
|
"id": featureID,
|
|
309
309
|
},
|
|
@@ -359,7 +359,7 @@ export const addUserAnnotationWithFeature = (service, userToken, zincObject,
|
|
|
359
359
|
* Get the drawn annotation stored on the annotation server
|
|
360
360
|
*/
|
|
361
361
|
export const getDrawnAnnotations = async (service, userToken, scaffoldUrl) => {
|
|
362
|
-
const resource =
|
|
362
|
+
const resource = scaffoldUrl;
|
|
363
363
|
return await service.drawnFeatures(userToken, resource);
|
|
364
364
|
}
|
|
365
365
|
|