@abi-software/scaffoldvuer 1.13.1-beta.9 → 1.14.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.
@@ -106,27 +106,40 @@
106
106
  class="control-layer"
107
107
  ref="scaffoldTreeControls"
108
108
  :isReady="isReady"
109
+ :containerHeight="clientHeight"
109
110
  :show-colour-picker="enableColourPicker"
110
111
  @object-selected="objectSelected"
111
112
  @object-hovered="objectHovered"
112
113
  @drawer-toggled="drawerToggled"
114
+ @check-changed="$emit('check-changed', $event)"
113
115
  >
114
116
  <template v-slot:treeSlot>
115
117
  <slot name="treeSlot"></slot>
118
+ <primitive-controls
119
+ class="control-layer"
120
+ ref="primitiveControls"
121
+ :createData="createData"
122
+ :viewingMode="viewingMode"
123
+ :usageConfig="usageConfig"
124
+ @primitivesUpdated="primitivesUpdated"
125
+ />
116
126
  </template>
117
127
  </ScaffoldTreeControls>
118
128
  </template>
119
129
  </el-popover>
120
- <div class="primitive-controls-box">
121
- <primitive-controls
122
- class="control-layer"
123
- ref="primitiveControls"
124
- :createData="createData"
125
- :viewingMode="viewingMode"
126
- :usageConfig="usageConfig"
127
- @primitivesUpdated="primitivesUpdated"
128
- />
129
- </div>
130
+ <!--
131
+ <div class="primitive-controls-box">
132
+
133
+ <primitive-controls
134
+ class="control-layer"
135
+ ref="primitiveControls"
136
+ :createData="createData"
137
+ :viewingMode="viewingMode"
138
+ :usageConfig="usageConfig"
139
+ @primitivesUpdated="primitivesUpdated"
140
+ />
141
+ </div>
142
+ -->
130
143
  <el-popover
131
144
  v-if="timeVarying"
132
145
  ref="sliderPopover"
@@ -826,6 +839,7 @@ export default {
826
839
  data: function () {
827
840
  return {
828
841
  annotator: undefined,
842
+ clientHeight: 300,
829
843
  colourRadio: true,
830
844
  createData: {
831
845
  drawingBox: false,
@@ -1059,6 +1073,7 @@ export default {
1059
1073
  this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved);
1060
1074
  this.$module.initialiseRenderer(this.$refs.display);
1061
1075
  this.toggleRendering(this.render);
1076
+ this.clientHeight = this.$refs.scaffoldContainer.$el.clientHeight;
1062
1077
  this.ro = new ResizeObserver(this.adjustLayout).observe(
1063
1078
  this.$refs.scaffoldContainer.$el
1064
1079
  );
@@ -1442,6 +1457,9 @@ export default {
1442
1457
  this.renameAnnotations(payload.region, payload.group,
1443
1458
  this._editingZincObject, oldGroupName);
1444
1459
  }
1460
+ else if (payload.deleting) {
1461
+ this.confirmDelete();
1462
+ }
1445
1463
  if (object) {
1446
1464
  this.addAndEditAnnotations(payload.region, payload.group, object.zincObject, "Create");
1447
1465
  object.zincObject.isEditable = true;
@@ -1520,6 +1538,12 @@ export default {
1520
1538
  this.offlineAnnotations = this.offlineAnnotations.filter(offline => offline.item.id !== annotation.item.id);
1521
1539
  sessionStorage.setItem('anonymous-annotation', JSON.stringify(this.offlineAnnotations));
1522
1540
  }
1541
+ this.$emit('userPrimitivesUpdated', {
1542
+ region: this._editingZincObject.region,
1543
+ group,
1544
+ zincObject: this._editingZincObject,
1545
+ deleted: true
1546
+ });
1523
1547
  }
1524
1548
  }
1525
1549
  this.cancelCreate();
@@ -1825,6 +1849,21 @@ export default {
1825
1849
  setTimeout(this.stopFreeSpin, 4000);
1826
1850
  }
1827
1851
  },
1852
+ activateDeleteMode: function(eventIdentifiers) {
1853
+ const zincObject = getDeletableObjects(eventIdentifiers);
1854
+ if (zincObject) {
1855
+ this._editingZincObject = zincObject;
1856
+ this.createData.faceIndex = -1;
1857
+ this.createData.editingIndex = -1;
1858
+ this.createData.renaming = false;
1859
+ this.createData.tempGroupName = this._editingZincObject.groupName;
1860
+ this.createData.regionPrefix = this._editingZincObject.region.getFullPath();
1861
+ this.createData.toBeConfirmed = true;
1862
+ this.createData.toBeDeleted = true;
1863
+ this.tData.x = 50;
1864
+ this.tData.y = 200;
1865
+ }
1866
+ },
1828
1867
  activateEditingMode: function(eventIdentifiers) {
1829
1868
  let editing = getEditablePoint(eventIdentifiers);
1830
1869
  if (editing) {
@@ -1851,6 +1890,7 @@ export default {
1851
1890
  this.createData.tempGroupName = this._editingZincObject.groupName;
1852
1891
  this.createData.regionPrefix = this._editingZincObject.region.getFullPath();
1853
1892
  this.createData.toBeConfirmed = true;
1893
+ this.createData.toBeDeleted = false;
1854
1894
  this.showRegionTooltipWithAnnotations(eventIdentifiers, false, false);
1855
1895
  this.tData.x = 50;
1856
1896
  this.tData.y = 200;
@@ -1871,11 +1911,7 @@ export default {
1871
1911
  if (this.activeDrawMode === "Edit") {
1872
1912
  this.activateEditingMode(event.identifiers);
1873
1913
  } else if (this.activeDrawMode === "Delete") {
1874
- const zincObject = getDeletableObjects(event);
1875
- if (zincObject) {
1876
- this.createData.toBeDeleted = true;
1877
- this._editingZincObject = zincObject;
1878
- }
1914
+ this.activateDeleteMode(event.identifiers);
1879
1915
  }
1880
1916
  if (this.activeDrawMode !== "Point" && this.activeDrawMode !== "LineString") {
1881
1917
  this.showRegionTooltipWithAnnotations(event.identifiers, true, false);
@@ -1891,6 +1927,7 @@ export default {
1891
1927
  this._editingZincObject = zincObject;
1892
1928
  this.createData.faceIndex = -1;
1893
1929
  this.createData.renaming = false;
1930
+ this.createData.toBeDeleted = false;
1894
1931
  this.createData.editingIndex = index;
1895
1932
  this.createData.regionPrefix = this._editingZincObject.region.getFullPath();
1896
1933
  this.createData.tempGroupName = this._editingZincObject.groupName;
@@ -1900,6 +1937,7 @@ export default {
1900
1937
  this._editingZincObject = zincObject;
1901
1938
  this.createData.faceIndex = faceIndex;
1902
1939
  this.createData.renaming = false;
1940
+ this.createData.toBeDeleted = false;
1903
1941
  this.createData.editingIndex = vertexIndex;
1904
1942
  this.createData.regionPrefix = this._editingZincObject.region.getFullPath();
1905
1943
  this.createData.tempGroupName = this._editingZincObject.groupName;
@@ -2144,9 +2182,10 @@ export default {
2144
2182
  *
2145
2183
  * @arg region Region to set the disable/enable checkbox
2146
2184
  * @arg flag Disable the checkbox when true and enable when false
2185
+ * @arg childrenOnly Only disable/enable any child graphics/regions
2147
2186
  */
2148
- setRegionCheckboxDisabled: function(region, flag) {
2149
- this.$refs.scaffoldTreeControls.setRegionCheckboxDisabled(region, flag);
2187
+ setRegionCheckboxDisabled: function(region, flag, childrenOnly = true) {
2188
+ this.$refs.scaffoldTreeControls.setRegionCheckboxDisabled(region, flag, childrenOnly);
2150
2189
  },
2151
2190
  /**
2152
2191
  * @public
@@ -3008,6 +3047,7 @@ export default {
3008
3047
  adjustLayout: function () {
3009
3048
  if (this.$refs.scaffoldContainer?.$el) {
3010
3049
  let width = this.$refs.scaffoldContainer.$el.clientWidth;
3050
+ this.clientHeight = this.$refs.scaffoldContainer.$el.clientHeight;
3011
3051
  this.minimisedSlider = width < 812;
3012
3052
  if (this.minimisedSlider) {
3013
3053
  this.sliderPosition = this.drawerOpen ? "right" : "left";
@@ -3274,7 +3314,7 @@ export default {
3274
3314
  transition: all 1s ease;
3275
3315
 
3276
3316
  &.open {
3277
- left: 322px;
3317
+ left: 302px;
3278
3318
  }
3279
3319
 
3280
3320
  &.close {
@@ -1,6 +1,13 @@
1
1
  <template>
2
2
  <el-container class="t-slides-container">
3
3
  <el-main class="slides-block">
4
+ <el-row class="slide-row">
5
+ <el-checkbox
6
+ v-model="discardAlpha"
7
+ >
8
+ Discard Translucent Pixel
9
+ </el-checkbox>
10
+ </el-row>
4
11
  <el-row class="slide-row">
5
12
  <el-col :offset="0" :span="8">
6
13
  Brightness
@@ -74,7 +81,7 @@
74
81
  <el-slider
75
82
  v-model="slide.value"
76
83
  class="my-slider"
77
- :step="0.005"
84
+ :step="0.001"
78
85
  :min="0"
79
86
  :max="1"
80
87
  :show-tooltip="false"
@@ -84,7 +91,8 @@
84
91
  <el-col :offset="0" :span="6">
85
92
  <el-input-number
86
93
  v-model="slide.value"
87
- :step="0.01"
94
+ @change="modifySlide(slide)"
95
+ :step="0.001"
88
96
  :min="0"
89
97
  :max="1"
90
98
  :controls="false"
@@ -119,6 +127,7 @@ import {
119
127
  Plus as ElIconPlus,
120
128
  } from '@element-plus/icons-vue'
121
129
  import {
130
+ ElCheckbox as Checkbox,
122
131
  ElCol as Col,
123
132
  ElContainer as Container,
124
133
  ElDivider as Divider,
@@ -139,6 +148,7 @@ import { markRaw } from 'vue';
139
148
  export default {
140
149
  name: "TextureSlidesControls",
141
150
  components: {
151
+ Checkbox,
142
152
  Col,
143
153
  Container,
144
154
  Divider,
@@ -157,6 +167,7 @@ export default {
157
167
  return {
158
168
  brightness: 0.0,
159
169
  contrast: 1.0,
170
+ discardAlpha: true,
160
171
  settings: [],
161
172
  directions: [
162
173
  {
@@ -191,6 +202,14 @@ export default {
191
202
  }
192
203
  },
193
204
  immediate: false,
205
+ },
206
+ discardAlpha: {
207
+ handler: function (value) {
208
+ if (this.zincObject) {
209
+ this.zincObject.discardAlphaPixel(value);
210
+ }
211
+ },
212
+ immediate: false,
194
213
  }
195
214
  },
196
215
  methods: {
@@ -200,11 +219,13 @@ export default {
200
219
  this.settings = this.zincObject.getTextureSettings();
201
220
  this.brightness = this.zincObject.getBrightness();
202
221
  this.contrast = this.zincObject.getContrast();
222
+ this.discardAlpha = this.zincObject.isAlphaPixelDiscarded();
203
223
  } else {
204
224
  this.zincObject = undefined;
205
225
  this.settings = [];
206
226
  this.brightness = 0.0;
207
227
  this.contrast = 1.0;
228
+ this.discardAlpha = true;
208
229
  }
209
230
  },
210
231
  addNewSlide: function () {
@@ -276,7 +297,7 @@ export default {
276
297
 
277
298
  .t-slides-container {
278
299
  width: 250px;
279
- height: 218px;
300
+ height: 250px;
280
301
  overflow-y: auto;
281
302
  }
282
303
 
@@ -159,6 +159,7 @@ export default {
159
159
  calculateMinAndMax: function() {
160
160
  if (this.zincObject) {
161
161
  const originalPos = this.zincObject?.userData?.originalPos;
162
+ const morph = this.zincObject.getGroup();
162
163
  if (originalPos && this.boundingDims) {
163
164
  this.min = [
164
165
  originalPos[0] - this.boundingDims.size[0],
@@ -215,7 +216,8 @@ export default {
215
216
  .slides-block {
216
217
  pointer-events: auto;
217
218
  &.el-main {
218
- padding: 5px;
219
+ padding: 0px 4px 8px 4px;
220
+ overflow: unset;
219
221
  &::-webkit-scrollbar {
220
222
  width: 10px;
221
223
  }
@@ -263,7 +265,7 @@ export default {
263
265
  .tool-row {
264
266
  align-items:center;
265
267
  text-align: center;
266
- padding-top:8px;
268
+ padding-top:4px;
267
269
  }
268
270
 
269
271
  </style>
@@ -8,6 +8,7 @@ export {}
8
8
  declare module 'vue' {
9
9
  export interface GlobalComponents {
10
10
  ElButton: typeof import('element-plus/es')['ElButton']
11
+ ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
11
12
  ElCol: typeof import('element-plus/es')['ElCol']
12
13
  ElCollapse: typeof import('element-plus/es')['ElCollapse']
13
14
  ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
@@ -16,7 +17,6 @@ declare module 'vue' {
16
17
  ElFooter: typeof import('element-plus/es')['ElFooter']
17
18
  ElIcon: typeof import('element-plus/es')['ElIcon']
18
19
  ElIconArrowLeft: typeof import('@element-plus/icons-vue')['ArrowLeft']
19
- ElIconArrowRight: typeof import('@element-plus/icons-vue')['ArrowRight']
20
20
  ElIconDelete: typeof import('@element-plus/icons-vue')['Delete']
21
21
  ElIconPlus: typeof import('@element-plus/icons-vue')['Plus']
22
22
  ElIconWarningFilled: typeof import('@element-plus/icons-vue')['WarningFilled']
@@ -50,6 +50,16 @@ export const getEditablePoint = (eventIdentifiers) => {
50
50
  return undefined;
51
51
  }
52
52
 
53
+ export const getDeletableObjects = (eventIdentifiers) => {
54
+ const zincObject = eventIdentifiers[0].data?.zincObject;
55
+ if (zincObject) {
56
+ if (zincObject.isEditable) {
57
+ return zincObject;
58
+ }
59
+ }
60
+ return undefined;
61
+ }
62
+
53
63
  export const getEditableLines = (eventIdentifiers) => {
54
64
  const zincObject = eventIdentifiers[0].data?.zincObject;
55
65
  if (zincObject) {
@@ -82,17 +92,6 @@ export const getClickedObjects = (event) => {
82
92
  return undefined;
83
93
  }
84
94
 
85
- export const getDeletableObjects = (event) => {
86
- const zincObjects = event.zincObjects;
87
- if (zincObjects.length > 0 && zincObjects[0]) {
88
- const zincObject = zincObjects[0];
89
- if (zincObject.isEditable) {
90
- return zincObject;
91
- }
92
- }
93
- return undefined;
94
- }
95
-
96
95
  export const movePoint = (zincObject, index, diff) => {
97
96
  if (zincObject?.isEditable && zincObject?.isPointset) {
98
97
  let found = false;