@abi-software/scaffoldvuer 1.13.1-beta.0 → 1.13.1-beta.11

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.
@@ -24,6 +24,8 @@
24
24
  @confirm-comment="confirmComment($event)"
25
25
  @confirm-delete="confirmDelete()"
26
26
  @tooltip-hide="onTooltipHide()"
27
+ @create-group-suggestions="$emit('create-group-suggestions', $event)"
28
+ @create-region-suggestions="$emit('create-region-suggestions', $event)"
27
29
  />
28
30
  <div
29
31
  id="organsDisplayArea"
@@ -108,7 +110,12 @@
108
110
  @object-selected="objectSelected"
109
111
  @object-hovered="objectHovered"
110
112
  @drawer-toggled="drawerToggled"
111
- />
113
+ @check-changed="$emit('check-changed', $event)"
114
+ >
115
+ <template v-slot:treeSlot>
116
+ <slot name="treeSlot"></slot>
117
+ </template>
118
+ </ScaffoldTreeControls>
112
119
  </template>
113
120
  </el-popover>
114
121
  <div class="primitive-controls-box">
@@ -302,66 +309,74 @@
302
309
  virtual-triggering
303
310
  >
304
311
  <div class="control-layer">
305
- <el-row class="backgroundText">Viewing Mode</el-row>
306
- <el-row class="backgroundControl">
307
- <div style="margin-bottom: 2px;">
308
- <template
309
- v-for="(value, key, index) in viewingModes"
310
- :key="key"
311
- >
312
- <template v-if="key === viewingMode">
313
- <span class="viewing-mode-title"><b >{{ key }}</b></span>
314
- </template>
315
- <template v-else>
316
- <span class="viewing-mode-unselected" @click="changeViewingMode(key)">{{ key }}</span>
317
- </template>
318
- </template>
319
- </div>
320
- <el-row class="viewing-mode-description">
321
- {{ modeDescription }}
312
+ <div class="viewing-mode-container">
313
+ <el-row class="backgroundText">Viewing Mode</el-row>
314
+ <el-row class="backgroundControl">
315
+ <div style="margin-bottom: 2px;">
316
+ <template
317
+ v-for="(value, key, index) in viewingModes"
318
+ :key="key"
319
+ >
320
+ <template v-if="key === viewingMode">
321
+ <span class="viewing-mode-title"><b >{{ key }}</b></span>
322
+ </template>
323
+ <template v-else>
324
+ <span class="viewing-mode-unselected" @click="changeViewingMode(key)">{{ key }}</span>
325
+ </template>
326
+ </template>
327
+ </div>
328
+ <el-row class="viewing-mode-description">
329
+ {{ modeDescription }}
330
+ </el-row>
331
+ <el-row v-if="viewingMode === 'Annotation' && offlineAnnotationEnabled" class="viewing-mode-description">
332
+ (Anonymous annotate)
333
+ </el-row>
322
334
  </el-row>
323
- <el-row v-if="viewingMode === 'Annotation' && offlineAnnotationEnabled" class="viewing-mode-description">
324
- (Anonymous annotate)
335
+ </div>
336
+ <div class="colour-radio-container">
337
+ <el-row class="backgroundSpacer"></el-row>
338
+ <el-row class="backgroundText">Organs display</el-row>
339
+ <el-row class="backgroundControl">
340
+ <el-radio-group
341
+ v-model="colourRadio"
342
+ class="scaffold-radio"
343
+ @change="setColour(colourRadio, true)"
344
+ >
345
+ <el-radio :value="true">Colour</el-radio>
346
+ <el-radio :value="false">Greyscale</el-radio>
347
+ </el-radio-group>
325
348
  </el-row>
326
- </el-row>
327
- <el-row class="backgroundSpacer"></el-row>
328
- <el-row class="backgroundText">Organs display</el-row>
329
- <el-row class="backgroundControl">
330
- <el-radio-group
331
- v-model="colourRadio"
332
- class="scaffold-radio"
333
- @change="setColour(colourRadio, true)"
334
- >
335
- <el-radio :value="true">Colour</el-radio>
336
- <el-radio :value="false">Greyscale</el-radio>
337
- </el-radio-group>
338
- </el-row>
339
- <el-row class="backgroundSpacer"></el-row>
340
- <el-row class="backgroundText">Outlines display</el-row>
341
- <el-row class="backgroundControl">
342
- <el-radio-group
343
- v-model="outlinesRadio"
344
- class="scaffold-radio"
345
- @change="setOutlines(outlinesRadio, true)"
346
- >
347
- <el-radio :value="true">Show</el-radio>
348
- <el-radio :value="false">Hide</el-radio>
349
- </el-radio-group>
350
- </el-row>
351
- <el-row class="backgroundSpacer"></el-row>
352
- <el-row class="backgroundText"> Change background </el-row>
353
- <el-row class="backgroundChooser">
354
- <div
355
- v-for="item in availableBackground"
356
- :key="item"
357
- :class="[
358
- 'backgroundChoice',
359
- item,
360
- item == currentBackground ? 'active' : '',
361
- ]"
362
- @click="backgroundChangeCallback(item)"
363
- />
364
- </el-row>
349
+ </div>
350
+ <div class="outlines-radio-container">
351
+ <el-row class="backgroundSpacer"></el-row>
352
+ <el-row class="backgroundText">Outlines display</el-row>
353
+ <el-row class="backgroundControl">
354
+ <el-radio-group
355
+ v-model="outlinesRadio"
356
+ class="scaffold-radio"
357
+ @change="setOutlines(outlinesRadio, true)"
358
+ >
359
+ <el-radio :value="true">Show</el-radio>
360
+ <el-radio :value="false">Hide</el-radio>
361
+ </el-radio-group>
362
+ </el-row>
363
+ </div>
364
+ <div class="background-colour-container">
365
+ <el-row class="backgroundSpacer"></el-row>
366
+ <el-row class="backgroundText"> Change background </el-row>
367
+ <el-row class="backgroundChooser">
368
+ <div
369
+ v-for="item in availableBackground"
370
+ :key="item"
371
+ :class="[
372
+ 'backgroundChoice',
373
+ item,
374
+ item == currentBackground ? 'active' : '',
375
+ ]"
376
+ @click="backgroundChangeCallback(item)"
377
+ />
378
+ </el-row>
379
+ </div>
365
380
  </div>
366
381
  </el-popover>
367
382
  <div
@@ -440,6 +455,7 @@ import {
440
455
  getClickedObjects,
441
456
  getDeletableObjects,
442
457
  getDrawnAnnotations,
458
+ getEditablePoint,
443
459
  getEditableLines,
444
460
  getObjectsFromAnnotations,
445
461
  findObjectsWithNames,
@@ -814,14 +830,17 @@ export default {
814
830
  colourRadio: true,
815
831
  createData: {
816
832
  drawingBox: false,
833
+ renaming: false,
817
834
  toBeConfirmed: false,
818
835
  points: [],
836
+ tempGroupName: undefined,
819
837
  shape: "",
820
838
  x: 0,
821
839
  y: 0,
822
840
  editingIndex: -1,
823
841
  faceIndex: -1,
824
842
  toBeDeleted: false,
843
+ regionPrefix: "__annotation"
825
844
  },
826
845
  currentTime: 0.0,
827
846
  timeVarying: false,
@@ -1176,12 +1195,7 @@ export default {
1176
1195
  }
1177
1196
  }
1178
1197
  //Recalculate the following if module is ready
1179
- if (this.isReady) {
1180
- const {centre, size} = this.$module.getCentreAndSize();
1181
- this.boundingDims.centre = centre;
1182
- this.boundingDims.size = size;
1183
- }
1184
-
1198
+ this.calculateBoundingBox();
1185
1199
 
1186
1200
  /**
1187
1201
  * Emit when a new object is added to the scene
@@ -1204,6 +1218,18 @@ export default {
1204
1218
  }
1205
1219
  }
1206
1220
  },
1221
+ /**
1222
+ * Rename Zinc Object
1223
+ */
1224
+ renameZincObject: function (zincObject, newName) {
1225
+ if (this.$module.scene) {
1226
+ const scaffoldTreeControls = this.$refs.scaffoldTreeControls;
1227
+ const oldName = zincObject.groupName;
1228
+ zincObject.setName(newName);
1229
+ scaffoldTreeControls.zincObjectRenamed(zincObject, oldName);
1230
+ this.$_searchIndex.updateZincObject(zincObject, zincObject.uuid);
1231
+ }
1232
+ },
1207
1233
  /**
1208
1234
  * Internal only.
1209
1235
  * This is called when a zinc object is removed.
@@ -1306,11 +1332,59 @@ export default {
1306
1332
  }
1307
1333
  annotation.region = regionPath;
1308
1334
  this.offlineAnnotations = JSON.parse(sessionStorage.getItem('anonymous-annotation')) || [];
1309
- this.offlineAnnotations.push(annotation);
1335
+ const found = this.offlineAnnotations.find((element) => {
1336
+ return element.group === annotation.group &&
1337
+ element.region === annotation.region &&
1338
+ element.resource === annotation.resource &&
1339
+ element.feature.geometry.type === annotation.feature.geometry.type;
1340
+ });
1341
+ if (found) {
1342
+ Object.assign(found, annotation);
1343
+ } else {
1344
+ this.offlineAnnotations.push(annotation);
1345
+ }
1310
1346
  sessionStorage.setItem('anonymous-annotation', JSON.stringify(this.offlineAnnotations));
1311
1347
  }
1312
1348
  this.$emit('userPrimitivesUpdated', {region, group, zincObject});
1313
1349
  },
1350
+ /**
1351
+ * @public
1352
+ * Rename group in annotations, only support local annotations at this moment.
1353
+ * @arg `region`,
1354
+ * @arg `group`,
1355
+ * @arg `zincObject`,
1356
+ * @arg `oldName`
1357
+ */
1358
+ renameAnnotations: function (region, group, zincObject, oldName) {
1359
+ //Pending support for online annotation
1360
+ let regionPath = region.slice(-1) === "/" ? region : region + "/";
1361
+ const oldFeatureID = regionPath + oldName;
1362
+ const annotation = addUserAnnotationWithFeature(this.annotator, this.userToken, zincObject,
1363
+ region, group, this.url, `Rename from ${oldFeatureID}`);
1364
+ this.existDrawnFeatures = markRaw(this.existDrawnFeatures.filter(feature => feature.id !== oldFeatureID));
1365
+ this.existDrawnFeatures.push(annotation.feature);
1366
+ if (this.offlineAnnotationEnabled) {
1367
+ annotation.group = group;
1368
+ regionPath = region;
1369
+ if (regionPath.slice(-1) === "/") {
1370
+ regionPath = regionPath.slice(0, -1);
1371
+ }
1372
+ annotation.region = regionPath;
1373
+ this.offlineAnnotations = JSON.parse(sessionStorage.getItem('anonymous-annotation')) || [];
1374
+ const found = this.offlineAnnotations.find((element) => {
1375
+ return element.group === oldName &&
1376
+ element.region === annotation.region &&
1377
+ element.resource === annotation.resource &&
1378
+ element.feature.geometry.type === annotation.feature.geometry.type;
1379
+ });
1380
+ if (found) {
1381
+ //console.log('found', found)
1382
+ Object.assign(found, annotation);
1383
+ }
1384
+ sessionStorage.setItem('anonymous-annotation', JSON.stringify(this.offlineAnnotations));
1385
+ }
1386
+ this.$emit('userPrimitivesUpdated', {region, group, zincObject, renamedFrom: oldName});
1387
+ },
1314
1388
  /**
1315
1389
  * @public
1316
1390
  * Callback for when primitives have been update using primitive controls.
@@ -1349,12 +1423,25 @@ export default {
1349
1423
  );
1350
1424
  } else if (payload.editingIndex > -1) {
1351
1425
  if (this._editingZincObject) {
1352
- this._editingZincObject.editVertices([this.createData.points[1]],
1426
+ let editedPoint = undefined;
1427
+ if (payload.editingIndex > -1) {
1428
+ if (this.createData.faceIndex > -1) {
1429
+ editedPoint = this.createData.points[1];
1430
+ } else {
1431
+ editedPoint = this.createData.points[0];
1432
+ }
1433
+ }
1434
+ this._editingZincObject.editVertices([editedPoint],
1353
1435
  payload.editingIndex);
1354
1436
  const region = this._editingZincObject.region.getFullPath() + "/";
1355
1437
  const group = this._editingZincObject.groupName;
1356
1438
  this.addAndEditAnnotations(region, group, this._editingZincObject, "Position Updated");
1357
1439
  }
1440
+ } else if (payload.renaming) {
1441
+ const oldGroupName = this._editingZincObject.groupName;
1442
+ this.renameZincObject(this._editingZincObject, payload.group);
1443
+ this.renameAnnotations(payload.region, payload.group,
1444
+ this._editingZincObject, oldGroupName);
1358
1445
  }
1359
1446
  if (object) {
1360
1447
  this.addAndEditAnnotations(payload.region, payload.group, object.zincObject, "Create");
@@ -1371,11 +1458,14 @@ export default {
1371
1458
  * Cancel create workflows. Reset all relevant UIs and data.
1372
1459
  */
1373
1460
  cancelCreate: function() {
1461
+ this.changeActiveByName(undefined);
1374
1462
  this.createData.points.length = 0;
1463
+ this.createData.renaming = false;
1375
1464
  this.createData.toBeConfirmed = false;
1376
1465
  this._editingZincObject = undefined;
1377
1466
  this.createData.editingIndex = -1;
1378
1467
  this.createData.faceIndex = -1;
1468
+ this.createData.tempGroupName = undefined;
1379
1469
  this.tData.visible = false;
1380
1470
  this.createData.toBeDeleted = false;
1381
1471
  if (this._tempLine) {
@@ -1545,6 +1635,7 @@ export default {
1545
1635
  this.$module.selectObjectOnPick = true;
1546
1636
  } else if (type === 'tool') {
1547
1637
  this.activeDrawTool = icon;
1638
+ this.createData.renaming = false;
1548
1639
  this.createData.shape = this.activeDrawTool ? this.activeDrawTool : '';
1549
1640
  this.$module.selectObjectOnPick = false;
1550
1641
  }
@@ -1611,14 +1702,35 @@ export default {
1611
1702
  }
1612
1703
  }
1613
1704
  },
1614
- createEditTemporaryLines: function(identifiers) {
1705
+ createEditTemporaryPoint: function(identifiers) {
1615
1706
  const worldCoords = identifiers[0].extraData.worldCoords;
1616
1707
  if (worldCoords) {
1617
- if (this.createData.shape === "LineString" || this.createData.editingIndex > -1) {
1618
- if (this.createData.points.length === 1) {
1619
- this.showRegionTooltipWithAnnotations(identifiers, true, false);
1708
+ if (this.createData.shape === "Point" || this.createData.editingIndex > -1) {
1709
+ if (this.createData.points.length === 0) {
1710
+ this.showRegionTooltipWithAnnotations(identifiers, false, false);
1620
1711
  this.tData.x = 50;
1621
1712
  this.tData.y = 200;
1713
+ if (this._tempPoint) {
1714
+ const positionAttribute = this._tempPoint.geometry.getAttribute( 'position' );
1715
+ positionAttribute.setXYZ(0, worldCoords[0], worldCoords[1], worldCoords[2]);
1716
+ positionAttribute.needsUpdate = true;
1717
+ } else {
1718
+ this._tempPoint = this.$module.scene.addTemporaryPoints(
1719
+ [worldCoords], 0x00ffff);
1720
+ }
1721
+ }
1722
+ }
1723
+ }
1724
+ },
1725
+ createEditTemporaryLines: function(identifiers) {
1726
+ const worldCoords = identifiers[0].extraData.worldCoords;
1727
+ if (worldCoords) {
1728
+ if (this.createData.shape === "LineString" ||
1729
+ (this.createData.editingIndex > -1 && this.createData.faceIndex > -1)) {
1730
+ if (this.createData.points.length === 1) {
1731
+ this.showRegionTooltipWithAnnotations(identifiers, false, false);
1732
+ //this.tData.x = 50;
1733
+ //this.tData.y = 200;
1622
1734
  if (this._tempLine) {
1623
1735
  const positionAttribute = this._tempLine.geometry.getAttribute( 'position' );
1624
1736
  positionAttribute.setXYZ(1, worldCoords[0], worldCoords[1], worldCoords[2]);
@@ -1631,14 +1743,26 @@ export default {
1631
1743
  }
1632
1744
  }
1633
1745
  },
1746
+ createEditTemporaryPrimitive: function(identifiers) {
1747
+ if (this.createData.shape === "LineString" ||
1748
+ (this.createData.editingIndex > -1 &&
1749
+ this.createData.faceIndex > -1)) {
1750
+ this.createEditTemporaryLines(identifiers);
1751
+ } else {
1752
+ if (this.createData.shape === "Point" || this.createData.editingIndex > -1) {
1753
+ this.createEditTemporaryPoint(identifiers);
1754
+ }
1755
+ }
1756
+ },
1634
1757
  draw: function(data) {
1635
1758
  if (data && data.length > 0 && data[0].data.group) {
1636
1759
  if (data[0].extraData.worldCoords) {
1637
- if (this.createData.shape === "Point") {
1638
- this.drawPoint(data[0].extraData.worldCoords, data);
1639
- } else if (this.createData.shape === "LineString" ||
1640
- this.createData.editingIndex > -1) {
1760
+ if (this.createData.shape === "LineString" ||
1761
+ (this.createData.editingIndex > -1 && this.createData.faceIndex > -1)) {
1641
1762
  this.drawLine(data[0].extraData.worldCoords, data);
1763
+ } else if (this.createData.shape === "Point" ||
1764
+ (this.createData.editingIndex > -1 && this.createData.faceIndex === -1)) {
1765
+ this.drawPoint(data[0].extraData.worldCoords, data);
1642
1766
  }
1643
1767
  }
1644
1768
  }
@@ -1647,19 +1771,27 @@ export default {
1647
1771
  if (this.createData.toBeConfirmed === false) {
1648
1772
  this.createData.points.length = 0;
1649
1773
  this.createData.points.push(coords);
1774
+ if (this.createData.editingIndex === -1 && !this.createData.renaming) {
1775
+ this.createData.tempGroupName = undefined;
1776
+ }
1650
1777
  this.createData.toBeConfirmed = true;
1651
- this.showRegionTooltipWithAnnotations(data, true, false);
1778
+ this.showRegionTooltipWithAnnotations(data, false, false);
1652
1779
  this.tData.x = 50;
1653
1780
  this.tData.y = 200;
1654
- this._tempPoint = this.$module.scene.addTemporaryPoints([coords], 0xffff00);
1781
+ if (!this._tempPoint) {
1782
+ this._tempPoint = this.$module.scene.addTemporaryPoints([coords], 0xffff00);
1783
+ }
1655
1784
  }
1656
1785
  },
1657
1786
  drawLine: function(coords, data) {
1658
1787
  if (this.createData.toBeConfirmed === false) {
1659
1788
  if (this.createData.points.length === 1) {
1660
1789
  this.createData.points.push(coords);
1790
+ if (this.createData.editingIndex === -1 && !this.createData.renaming) {
1791
+ this.createData.tempGroupName = undefined;
1792
+ }
1661
1793
  this.createData.toBeConfirmed = true;
1662
- this.showRegionTooltipWithAnnotations(data, true, false);
1794
+ this.showRegionTooltipWithAnnotations(data, false, false);
1663
1795
  this.tData.x = 50;
1664
1796
  this.tData.y = 200;
1665
1797
  } else {
@@ -1694,6 +1826,37 @@ export default {
1694
1826
  setTimeout(this.stopFreeSpin, 4000);
1695
1827
  }
1696
1828
  },
1829
+ activateEditingMode: function(eventIdentifiers) {
1830
+ let editing = getEditablePoint(eventIdentifiers);
1831
+ if (editing) {
1832
+ this.activatePointEditingMode(editing.zincObject, editing.index,
1833
+ editing.point);
1834
+ } else {
1835
+ editing = getEditableLines(eventIdentifiers);
1836
+ if (editing) {
1837
+ this.activateLineEditingMode(editing.zincObject, editing.faceIndex,
1838
+ editing.vertexIndex, editing.point);
1839
+ }
1840
+ }
1841
+ },
1842
+ activateRenamingMode: function(eventIdentifiers) {
1843
+ let editing = getEditablePoint(eventIdentifiers);
1844
+ if (!editing) {
1845
+ editing = getEditableLines(eventIdentifiers);
1846
+ }
1847
+ if (editing) {
1848
+ this._editingZincObject = editing.zincObject;
1849
+ this.createData.faceIndex = -1;
1850
+ this.createData.editingIndex = -1;
1851
+ this.createData.renaming = true;
1852
+ this.createData.tempGroupName = this._editingZincObject.groupName;
1853
+ this.createData.regionPrefix = this._editingZincObject.region.getFullPath();
1854
+ this.createData.toBeConfirmed = true;
1855
+ this.showRegionTooltipWithAnnotations(eventIdentifiers, false, false);
1856
+ this.tData.x = 50;
1857
+ this.tData.y = 200;
1858
+ }
1859
+ },
1697
1860
  activateAnnotationMode: function(names, event) {
1698
1861
  if (this.authorisedUser || this.offlineAnnotationEnabled) {
1699
1862
  this.createData.toBeDeleted = false;
@@ -1701,19 +1864,13 @@ export default {
1701
1864
  // Create new shape bsaed on current settings
1702
1865
  if (names.length > 0) {
1703
1866
  if (event.identifiers[0].coords) {
1704
- this.createData.x = event.identifiers[0].coords.x;
1705
- this.createData.y = event.identifiers[0].coords.y;
1706
1867
  this.draw(event.identifiers);
1707
1868
  }
1708
1869
  }
1709
1870
  } else {
1710
1871
  //Make sure the tooltip is displayed with annotaion mode
1711
1872
  if (this.activeDrawMode === "Edit") {
1712
- const editing = getEditableLines(event);
1713
- if (editing) {
1714
- this.activateEditingMode(editing.zincObject, editing.faceIndex,
1715
- editing.vertexIndex, editing.point);
1716
- }
1873
+ this.activateEditingMode(event.identifiers);
1717
1874
  } else if (this.activeDrawMode === "Delete") {
1718
1875
  const zincObject = getDeletableObjects(event);
1719
1876
  if (zincObject) {
@@ -1731,10 +1888,22 @@ export default {
1731
1888
  this.showRegionTooltipWithAnnotations(event.identifiers, true, true);
1732
1889
  }
1733
1890
  },
1734
- activateEditingMode: function(zincObject, faceIndex, vertexIndex, point) {
1891
+ activatePointEditingMode: function(zincObject, index, point) {
1892
+ this._editingZincObject = zincObject;
1893
+ this.createData.faceIndex = -1;
1894
+ this.createData.renaming = false;
1895
+ this.createData.editingIndex = index;
1896
+ this.createData.regionPrefix = this._editingZincObject.region.getFullPath();
1897
+ this.createData.tempGroupName = this._editingZincObject.groupName;
1898
+ //this.drawPoint(point, undefined);
1899
+ },
1900
+ activateLineEditingMode: function(zincObject, faceIndex, vertexIndex, point) {
1735
1901
  this._editingZincObject = zincObject;
1736
1902
  this.createData.faceIndex = faceIndex;
1903
+ this.createData.renaming = false;
1737
1904
  this.createData.editingIndex = vertexIndex;
1905
+ this.createData.regionPrefix = this._editingZincObject.region.getFullPath();
1906
+ this.createData.tempGroupName = this._editingZincObject.groupName;
1738
1907
  this.drawLine(point, undefined);
1739
1908
  },
1740
1909
  /**
@@ -1777,7 +1946,9 @@ export default {
1777
1946
  this.tData.label = id;
1778
1947
  this.tData.region = regionPath;
1779
1948
  const zincObject = getClickedObjects(event);
1780
- this._editingZincObject = zincObject;
1949
+ if (this.createData.editingIndex === -1 ) {
1950
+ this._editingZincObject = zincObject;
1951
+ }
1781
1952
  if (zincObject) {
1782
1953
  const regionPath = this._editingZincObject.region.getFullPath() + "/";
1783
1954
  const group = this._editingZincObject.groupName;
@@ -1836,7 +2007,7 @@ export default {
1836
2007
  this.tData.region = regionPath;
1837
2008
  this.tData.x = event.identifiers[0].coords.x;
1838
2009
  this.tData.y = event.identifiers[0].coords.y;
1839
- this.createEditTemporaryLines(event.identifiers);
2010
+ this.createEditTemporaryPrimitive(event.identifiers);
1840
2011
  }
1841
2012
  }
1842
2013
  /**
@@ -1853,7 +2024,7 @@ export default {
1853
2024
  this.tData.x = event.identifiers[0].coords.x - offsets.left;
1854
2025
  this.tData.y = event.identifiers[0].coords.y - offsets.top;
1855
2026
  }
1856
- this.createEditTemporaryLines(event.identifiers);
2027
+ this.createEditTemporaryPrimitive(event.identifiers);
1857
2028
  }
1858
2029
  }
1859
2030
  }
@@ -1968,6 +2139,17 @@ export default {
1968
2139
  //Hide tooltip as location may
1969
2140
  //this.hideRegionTooltip();
1970
2141
  },
2142
+ /**
2143
+ * @public
2144
+ * Disable/enable target region and its children checkbox
2145
+ *
2146
+ * @arg region Region to set the disable/enable checkbox
2147
+ * @arg flag Disable the checkbox when true and enable when false
2148
+ * @arg childrenOnly Only disable/enable any child graphics/regions
2149
+ */
2150
+ setRegionCheckboxDisabled: function(region, flag, childrenOnly = true) {
2151
+ this.$refs.scaffoldTreeControls.setRegionCheckboxDisabled(region, flag, childrenOnly);
2152
+ },
1971
2153
  /**
1972
2154
  * @public
1973
2155
  * Function to toggle on/off overlay help.
@@ -2061,8 +2243,8 @@ export default {
2061
2243
  if (coords) {
2062
2244
  //The coords is not in view, view all if resetView flag is true
2063
2245
  if (!coords.inView) {
2064
- this.hideRegionTooltip();
2065
2246
  if (resetView) {
2247
+ this.hideRegionTooltip();
2066
2248
  this.$module.scene.viewAll();
2067
2249
  //Use the post render callback to make sure the scene has been updated
2068
2250
  //before getting the position of the tooltip.
@@ -2070,6 +2252,7 @@ export default {
2070
2252
  this.$module.zincRenderer.removePostRenderCallbackFunction(
2071
2253
  this.$_regionTooltipCallback
2072
2254
  );
2255
+ this.$module.$_regionTooltipCallback = undefined;
2073
2256
  }
2074
2257
  this.$_regionTooltipCallback =
2075
2258
  this.$module.zincRenderer.addPostRenderCallbackFunction(
@@ -2097,6 +2280,7 @@ export default {
2097
2280
  this.$module.zincRenderer.removePostRenderCallbackFunction(
2098
2281
  this.$_liveCoordinatesUpdated
2099
2282
  );
2283
+ this.$_liveCoordinatesUpdated = undefined;
2100
2284
  }
2101
2285
  if (liveUpdates) {
2102
2286
  this.$module.setupLiveCoordinates(objects);
@@ -2168,6 +2352,10 @@ export default {
2168
2352
  showRegionTooltipWithAnnotations: function (annotations, resetView, liveUpdates) {
2169
2353
  if (this.$module.scene) {
2170
2354
  const result = getObjectsFromAnnotations(this.$module.scene, annotations);
2355
+ if (this._editingZincObject) {
2356
+ result.regionPath = this._editingZincObject.region.getFullPath() + "/";
2357
+ result.label = this._editingZincObject.groupName;
2358
+ }
2171
2359
  if (result && result.objects.length > 0) {
2172
2360
  if (!this.annotationSidebar) {
2173
2361
  return this.showRegionTooltipWithObjects(
@@ -2308,6 +2496,7 @@ export default {
2308
2496
  );
2309
2497
  //Unset the tracking
2310
2498
  this.$module.setupLiveCoordinates(undefined);
2499
+ this.$_liveCoordinatesUpdated = undefined;
2311
2500
  }
2312
2501
  this.tData.active = false;
2313
2502
  this.tData.visible = false;
@@ -2568,6 +2757,13 @@ export default {
2568
2757
  }
2569
2758
  }
2570
2759
  },
2760
+ calculateBoundingBox: function() {
2761
+ if (this.isReady) {
2762
+ const {centre, size} = this.$module.getCentreAndSize();
2763
+ this.boundingDims.centre = centre;
2764
+ this.boundingDims.size = size;
2765
+ }
2766
+ },
2571
2767
  downloadErrorCallback: function() {
2572
2768
  return (error) => {
2573
2769
  this.$emit('on-error', error);
@@ -2592,9 +2788,7 @@ export default {
2592
2788
  this._slides = this.$module.scene.addSlicesPrimitive(
2593
2789
  "_helper", ["x-plane", "y-plane", "z-plane"], [0xFF5555, 0x55FF55, 0x5555FF],
2594
2790
  0.5);
2595
- const {centre, size} = this.$module.getCentreAndSize();
2596
- this.boundingDims.centre = centre;
2597
- this.boundingDims.size = size;
2791
+ this.calculateBoundingBox();
2598
2792
  //this.$module.scene.createAxisDisplay(false);
2599
2793
  //this.$module.scene.enableAxisDisplay(true, true);
2600
2794
  this.isReady = true;