@abi-software/scaffoldvuer 1.21.1-beta.2 → 2.0.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/README.md +31 -12
- package/dist/index.html +9 -6
- package/dist/scaffoldvuer.js +14095 -13154
- package/dist/scaffoldvuer.umd.cjs +48 -48
- package/dist/style.css +1 -1
- package/eslint.config.js +37 -9
- package/package.json +10 -3
- package/public/index.html +9 -6
- package/src/App.vue +312 -279
- package/src/ScaffoldVuer-wc.js +4 -4
- package/src/app/DropZone.vue +11 -27
- package/src/app/ModelsInformation.js +22 -19
- package/src/app/ModelsTable.vue +42 -65
- package/src/app/TextureDemos.js +38 -64
- package/src/assets/_variables.scss +12 -10
- package/src/components/GlyphsControls.vue +3 -23
- package/src/components/LinesControls.vue +27 -66
- package/src/components/OpacityControls.vue +22 -26
- package/src/components/PointsControls.vue +20 -71
- package/src/components/PrimitiveControls.vue +35 -49
- package/src/components/ScaffoldOverlay.vue +63 -63
- package/src/components/ScaffoldTooltip.vue +36 -49
- package/src/components/ScaffoldTreeControls.vue +81 -129
- package/src/components/ScaffoldVuer.vue +509 -498
- package/src/components/TextureSlidesControls.vue +22 -64
- package/src/components/TransformationControls.vue +15 -42
- package/src/components/index.js +2 -2
- package/src/main.js +16 -18
- package/src/scripts/Annotation.js +3 -3
- package/src/scripts/BaseModule.js +26 -30
- package/src/scripts/EventNotifier.js +30 -36
- package/src/scripts/GraphicsHighlight.js +43 -50
- package/src/scripts/LocalFilesHelper.js +27 -26
- package/src/scripts/MappedNerves.js +2139 -697
- package/src/scripts/MappedOrgans.js +24 -25
- package/src/scripts/OrgansRenderer.js +445 -425
- package/src/scripts/RendererModule.js +133 -122
- package/src/scripts/Search.js +135 -151
- package/src/scripts/Utilities.js +129 -127
- package/src/scripts/WebGL.js +57 -91
- package/src/scripts/niftiHelper.js +3 -3
- package/src/store/index.js +7 -7
- package/vite.config.js +51 -50
- package/vite.static-build.js +7 -7
- package/vuese-generator.js +48 -56
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
<el-main class="slides-block">
|
|
4
4
|
<template v-if="isTubeLines && showTubeLinesControls">
|
|
5
5
|
<el-row>
|
|
6
|
-
<el-col :offset="0" :span="6">
|
|
7
|
-
Radius:
|
|
8
|
-
</el-col>
|
|
6
|
+
<el-col :offset="0" :span="6">Radius:</el-col>
|
|
9
7
|
<el-col :offset="0" :span="12">
|
|
10
8
|
<el-slider
|
|
11
9
|
v-model="radius"
|
|
@@ -30,9 +28,7 @@
|
|
|
30
28
|
</el-col>
|
|
31
29
|
</el-row>
|
|
32
30
|
<el-row>
|
|
33
|
-
<el-col :offset="0" :span="6">
|
|
34
|
-
Radial Segments:
|
|
35
|
-
</el-col>
|
|
31
|
+
<el-col :offset="0" :span="6">Radial Segments:</el-col>
|
|
36
32
|
<el-col :offset="0" :span="12">
|
|
37
33
|
<el-slider
|
|
38
34
|
v-model="radialSegments"
|
|
@@ -59,9 +55,7 @@
|
|
|
59
55
|
</template>
|
|
60
56
|
<template v-else-if="!isTubeLines">
|
|
61
57
|
<el-row>
|
|
62
|
-
<el-col :offset="0" :span="6">
|
|
63
|
-
Width:
|
|
64
|
-
</el-col>
|
|
58
|
+
<el-col :offset="0" :span="6">Width:</el-col>
|
|
65
59
|
<el-col :offset="0" :span="12">
|
|
66
60
|
<el-slider
|
|
67
61
|
v-model="width"
|
|
@@ -89,27 +83,19 @@
|
|
|
89
83
|
<el-row>
|
|
90
84
|
<el-col :offset="0" :span="4">
|
|
91
85
|
<el-button
|
|
92
|
-
size=
|
|
86
|
+
size="small"
|
|
93
87
|
:disabled="currentIndex === 0"
|
|
94
88
|
:icon="ElIconArrowLeft"
|
|
95
89
|
@click="changeIndex(false)"
|
|
96
90
|
/>
|
|
97
91
|
</el-col>
|
|
98
|
-
<el-col :offset="4" :span="9">
|
|
99
|
-
Editing Line {{ currentIndex + 1}}
|
|
100
|
-
</el-col>
|
|
92
|
+
<el-col :offset="4" :span="9">Editing Line {{ currentIndex + 1 }}</el-col>
|
|
101
93
|
<el-col :offset="2" :span="2">
|
|
102
|
-
<el-button
|
|
103
|
-
size='small'
|
|
104
|
-
:icon="ElIconArrowRight"
|
|
105
|
-
@click="changeIndex(true)"
|
|
106
|
-
/>
|
|
94
|
+
<el-button size="small" :icon="ElIconArrowRight" @click="changeIndex(true)" />
|
|
107
95
|
</el-col>
|
|
108
96
|
</el-row>
|
|
109
97
|
<el-row>
|
|
110
|
-
<el-col :offset="0" :span="6">
|
|
111
|
-
Move:
|
|
112
|
-
</el-col>
|
|
98
|
+
<el-col :offset="0" :span="6">Move:</el-col>
|
|
113
99
|
<el-col :offset="0" :span="16">
|
|
114
100
|
<el-slider
|
|
115
101
|
v-model="adjust"
|
|
@@ -123,9 +109,7 @@
|
|
|
123
109
|
</el-col>
|
|
124
110
|
</el-row>
|
|
125
111
|
<el-row>
|
|
126
|
-
<el-col :offset="0" :span="6">
|
|
127
|
-
Length:
|
|
128
|
-
</el-col>
|
|
112
|
+
<el-col :offset="0" :span="6">Length:</el-col>
|
|
129
113
|
<el-col :offset="0" :span="10">
|
|
130
114
|
<el-slider
|
|
131
115
|
v-model="lengthScale"
|
|
@@ -152,24 +136,11 @@
|
|
|
152
136
|
</template>
|
|
153
137
|
|
|
154
138
|
<script>
|
|
155
|
-
/* eslint-disable no-alert, no-console */
|
|
156
139
|
// This is not in use at this moment, due to
|
|
157
140
|
// limited support to line width
|
|
158
141
|
import { markRaw, shallowRef } from 'vue';
|
|
142
|
+
import { getLineDistance, moveAndExtendLine, NERVE_CONFIG } from '../scripts/Utilities.js';
|
|
159
143
|
import {
|
|
160
|
-
getLineDistance,
|
|
161
|
-
moveAndExtendLine,
|
|
162
|
-
NERVE_CONFIG
|
|
163
|
-
} from "../scripts/Utilities.js";
|
|
164
|
-
import {
|
|
165
|
-
ElButton as Button,
|
|
166
|
-
ElCol as Col,
|
|
167
|
-
ElContainer as Container,
|
|
168
|
-
ElInputNumber as InputNumber,
|
|
169
|
-
ElMain as Main,
|
|
170
|
-
ElSlider as Slider,
|
|
171
|
-
} from "element-plus";
|
|
172
|
-
import{
|
|
173
144
|
ArrowLeft as ElIconArrowLeft,
|
|
174
145
|
ArrowRight as ElIconArrowRight,
|
|
175
146
|
} from '@element-plus/icons-vue';
|
|
@@ -178,17 +149,7 @@ import{
|
|
|
178
149
|
* A component to control the opacity of the target object.
|
|
179
150
|
*/
|
|
180
151
|
export default {
|
|
181
|
-
name:
|
|
182
|
-
components: {
|
|
183
|
-
Button,
|
|
184
|
-
Col,
|
|
185
|
-
Container,
|
|
186
|
-
InputNumber,
|
|
187
|
-
Main,
|
|
188
|
-
Slider,
|
|
189
|
-
ElIconArrowLeft,
|
|
190
|
-
ElIconArrowRight,
|
|
191
|
-
},
|
|
152
|
+
name: 'LinesControls',
|
|
192
153
|
props: {
|
|
193
154
|
createData: {
|
|
194
155
|
type: Object,
|
|
@@ -203,7 +164,7 @@ export default {
|
|
|
203
164
|
pAdjust: 0,
|
|
204
165
|
lengthScale: 0,
|
|
205
166
|
distance: 0,
|
|
206
|
-
newDistance: 0,
|
|
167
|
+
newDistance: 0,
|
|
207
168
|
width: 1,
|
|
208
169
|
radius: NERVE_CONFIG.DEFAULT_RADIUS,
|
|
209
170
|
radialSegments: NERVE_CONFIG.DEFAULT_RADIAL_SEGMENTS,
|
|
@@ -221,7 +182,7 @@ export default {
|
|
|
221
182
|
},
|
|
222
183
|
},
|
|
223
184
|
watch: {
|
|
224
|
-
|
|
185
|
+
'createData.faceIndex': {
|
|
225
186
|
handler: function (value) {
|
|
226
187
|
if (this.zincObject?.isLines2) {
|
|
227
188
|
this.currentIndex = value;
|
|
@@ -232,7 +193,7 @@ export default {
|
|
|
232
193
|
},
|
|
233
194
|
},
|
|
234
195
|
methods: {
|
|
235
|
-
changeIndex: function(increment) {
|
|
196
|
+
changeIndex: function (increment) {
|
|
236
197
|
if (increment) {
|
|
237
198
|
const dist = getLineDistance(this.zincObject, this.currentIndex + 1);
|
|
238
199
|
if (dist > 0) {
|
|
@@ -244,34 +205,36 @@ export default {
|
|
|
244
205
|
this.reset();
|
|
245
206
|
}
|
|
246
207
|
},
|
|
247
|
-
onLengthInput: function() {
|
|
208
|
+
onLengthInput: function () {
|
|
248
209
|
if (this.newDistance !== 0) {
|
|
249
210
|
this.distance = this.newDistance;
|
|
250
|
-
this.edited =
|
|
251
|
-
this.zincObject, this.currentIndex, this.newDistance, true) ||
|
|
211
|
+
this.edited =
|
|
212
|
+
moveAndExtendLine(this.zincObject, this.currentIndex, this.newDistance, true) ||
|
|
213
|
+
this.edited;
|
|
252
214
|
} else {
|
|
253
215
|
this.newDistance = this.distance;
|
|
254
216
|
}
|
|
255
217
|
},
|
|
256
|
-
onLengthSliding: function() {
|
|
218
|
+
onLengthSliding: function () {
|
|
257
219
|
this.newDistance = Math.pow(10, this.lengthScale) * this.distance;
|
|
258
|
-
this.edited =
|
|
259
|
-
this.zincObject, this.currentIndex, this.newDistance, true) ||
|
|
220
|
+
this.edited =
|
|
221
|
+
moveAndExtendLine(this.zincObject, this.currentIndex, this.newDistance, true) ||
|
|
222
|
+
this.edited;
|
|
260
223
|
},
|
|
261
|
-
onMoveSliding: function() {
|
|
224
|
+
onMoveSliding: function () {
|
|
262
225
|
const diff = (this.adjust - this.pAdjust) * this.distance;
|
|
263
|
-
this.edited =
|
|
264
|
-
this.zincObject, this.currentIndex, diff, false) || this.edited;
|
|
226
|
+
this.edited =
|
|
227
|
+
moveAndExtendLine(this.zincObject, this.currentIndex, diff, false) || this.edited;
|
|
265
228
|
this.pAdjust = this.adjust;
|
|
266
229
|
},
|
|
267
|
-
reset: function() {
|
|
230
|
+
reset: function () {
|
|
268
231
|
this.adjust = 0;
|
|
269
232
|
this.pAdjust = 0;
|
|
270
233
|
this.lengthScale = 0;
|
|
271
234
|
this.distance = getLineDistance(this.zincObject, this.currentIndex);
|
|
272
235
|
this.newDistance = this.distance;
|
|
273
236
|
if (this.edited) {
|
|
274
|
-
this.$emit(
|
|
237
|
+
this.$emit('primitivesUpdated', this.zincObject);
|
|
275
238
|
this.edited = false;
|
|
276
239
|
}
|
|
277
240
|
},
|
|
@@ -306,7 +269,6 @@ export default {
|
|
|
306
269
|
|
|
307
270
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
308
271
|
<style scoped lang="scss">
|
|
309
|
-
|
|
310
272
|
.slides-block {
|
|
311
273
|
pointer-events: auto;
|
|
312
274
|
&.el-main {
|
|
@@ -362,7 +324,7 @@ export default {
|
|
|
362
324
|
padding-left: 4px;
|
|
363
325
|
padding-right: 8px;
|
|
364
326
|
border: none;
|
|
365
|
-
font-family:
|
|
327
|
+
font-family: 'Asap', sans-serif;
|
|
366
328
|
line-height: 22px;
|
|
367
329
|
}
|
|
368
330
|
|
|
@@ -371,5 +333,4 @@ export default {
|
|
|
371
333
|
line-height: 22px;
|
|
372
334
|
}
|
|
373
335
|
}
|
|
374
|
-
|
|
375
336
|
</style>
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
<div class="block">
|
|
4
4
|
<span class="display">{{ displayString }}</span>
|
|
5
5
|
<el-slider
|
|
6
|
-
|
|
6
|
+
:model-value="material.opacity"
|
|
7
|
+
@update:model-value="updateOpacity"
|
|
7
8
|
class="my-slider"
|
|
8
9
|
:step="0.01"
|
|
9
10
|
:min="0"
|
|
@@ -16,44 +17,41 @@
|
|
|
16
17
|
</template>
|
|
17
18
|
|
|
18
19
|
<script>
|
|
19
|
-
/* eslint-disable no-alert, no-console */
|
|
20
|
-
import {
|
|
21
|
-
ElContainer as Container,
|
|
22
|
-
ElHeader as Header,
|
|
23
|
-
ElMain as Main,
|
|
24
|
-
ElSlider as Slider
|
|
25
|
-
} from "element-plus";
|
|
26
|
-
|
|
27
20
|
/**
|
|
28
21
|
* A component to control the opacity of the target object.
|
|
29
22
|
*/
|
|
30
23
|
export default {
|
|
31
|
-
name:
|
|
32
|
-
components: {
|
|
33
|
-
Container,
|
|
34
|
-
Header,
|
|
35
|
-
Main,
|
|
36
|
-
Slider,
|
|
37
|
-
},
|
|
24
|
+
name: 'OpacityControls',
|
|
38
25
|
props: {
|
|
39
26
|
material: undefined,
|
|
40
27
|
zincObject: undefined,
|
|
41
28
|
},
|
|
42
|
-
data: function() {
|
|
29
|
+
data: function () {
|
|
43
30
|
return {
|
|
44
|
-
displayString:
|
|
31
|
+
displayString: '100%',
|
|
45
32
|
};
|
|
46
33
|
},
|
|
47
34
|
watch: {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
'material.opacity': {
|
|
36
|
+
immediate: true,
|
|
37
|
+
handler: function () {
|
|
38
|
+
if (!this.material) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.displayString = this.formatTooltip(this.material.opacity);
|
|
42
|
+
if (this.zincObject) {
|
|
43
|
+
this.zincObject.setAlpha(this.material.opacity);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
},
|
|
53
47
|
},
|
|
54
48
|
methods: {
|
|
49
|
+
updateOpacity(val) {
|
|
50
|
+
this.displayString = this.formatTooltip(val);
|
|
51
|
+
this.$emit('update:opacity', val);
|
|
52
|
+
},
|
|
55
53
|
formatTooltip(val) {
|
|
56
|
-
this.displayString = Math.floor(100 * val + 0.5) +
|
|
54
|
+
this.displayString = Math.floor(100 * val + 0.5) + '%';
|
|
57
55
|
return this.displayString;
|
|
58
56
|
},
|
|
59
57
|
},
|
|
@@ -62,7 +60,6 @@ export default {
|
|
|
62
60
|
|
|
63
61
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
64
62
|
<style scoped lang="scss">
|
|
65
|
-
|
|
66
63
|
.display {
|
|
67
64
|
width: 44px;
|
|
68
65
|
}
|
|
@@ -94,5 +91,4 @@ export default {
|
|
|
94
91
|
:deep(.el-slider__bar) {
|
|
95
92
|
background-color: $app-primary-color;
|
|
96
93
|
}
|
|
97
|
-
|
|
98
94
|
</style>
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
<el-container class="pointset-container">
|
|
3
3
|
<el-main class="slides-block">
|
|
4
4
|
<el-row>
|
|
5
|
-
<el-col :offset="0" :span="6">
|
|
6
|
-
Size:
|
|
7
|
-
</el-col>
|
|
5
|
+
<el-col :offset="0" :span="6">Size:</el-col>
|
|
8
6
|
<el-col :offset="0" :span="10">
|
|
9
7
|
<el-slider
|
|
10
8
|
v-model="size"
|
|
@@ -28,9 +26,7 @@
|
|
|
28
26
|
</el-col>
|
|
29
27
|
</el-row>
|
|
30
28
|
<el-row>
|
|
31
|
-
<el-col :offset="0" :span="16">
|
|
32
|
-
Size attenuation:
|
|
33
|
-
</el-col>
|
|
29
|
+
<el-col :offset="0" :span="16">Size attenuation:</el-col>
|
|
34
30
|
<el-col :offset="0" :span="5">
|
|
35
31
|
<el-select
|
|
36
32
|
:teleported="false"
|
|
@@ -53,27 +49,19 @@
|
|
|
53
49
|
<el-row>
|
|
54
50
|
<el-col :offset="0" :span="4">
|
|
55
51
|
<el-button
|
|
56
|
-
size=
|
|
52
|
+
size="small"
|
|
57
53
|
:disabled="currentIndex === 0"
|
|
58
54
|
:icon="ElIconArrowLeft"
|
|
59
55
|
@click="changeIndex(false)"
|
|
60
56
|
/>
|
|
61
57
|
</el-col>
|
|
62
|
-
<el-col :offset="4" :span="9">
|
|
63
|
-
Editing Point {{ currentIndex + 1}}
|
|
64
|
-
</el-col>
|
|
58
|
+
<el-col :offset="4" :span="9">Editing Point {{ currentIndex + 1 }}</el-col>
|
|
65
59
|
<el-col :offset="2" :span="2">
|
|
66
|
-
<el-button
|
|
67
|
-
size='small'
|
|
68
|
-
:icon="ElIconArrowRight"
|
|
69
|
-
@click="changeIndex(true)"
|
|
70
|
-
/>
|
|
60
|
+
<el-button size="small" :icon="ElIconArrowRight" @click="changeIndex(true)" />
|
|
71
61
|
</el-col>
|
|
72
62
|
</el-row>
|
|
73
63
|
<el-row>
|
|
74
|
-
<el-col :offset="0" :span="6">
|
|
75
|
-
x:
|
|
76
|
-
</el-col>
|
|
64
|
+
<el-col :offset="0" :span="6">x:</el-col>
|
|
77
65
|
<el-col :offset="0" :span="16">
|
|
78
66
|
<el-slider
|
|
79
67
|
v-model="translation[0]"
|
|
@@ -87,9 +75,7 @@
|
|
|
87
75
|
</el-col>
|
|
88
76
|
</el-row>
|
|
89
77
|
<el-row>
|
|
90
|
-
<el-col :offset="0" :span="6">
|
|
91
|
-
y:
|
|
92
|
-
</el-col>
|
|
78
|
+
<el-col :offset="0" :span="6">y:</el-col>
|
|
93
79
|
<el-col :offset="0" :span="16">
|
|
94
80
|
<el-slider
|
|
95
81
|
v-model="translation[1]"
|
|
@@ -103,9 +89,7 @@
|
|
|
103
89
|
</el-col>
|
|
104
90
|
</el-row>
|
|
105
91
|
<el-row>
|
|
106
|
-
<el-col :offset="0" :span="6">
|
|
107
|
-
z:
|
|
108
|
-
</el-col>
|
|
92
|
+
<el-col :offset="0" :span="6">z:</el-col>
|
|
109
93
|
<el-col :offset="0" :span="16">
|
|
110
94
|
<el-slider
|
|
111
95
|
v-model="translation[2]"
|
|
@@ -124,22 +108,9 @@
|
|
|
124
108
|
</template>
|
|
125
109
|
|
|
126
110
|
<script>
|
|
127
|
-
/* eslint-disable no-alert, no-console */
|
|
128
111
|
import { markRaw, shallowRef } from 'vue';
|
|
112
|
+
import { movePoint } from '../scripts/Utilities.js';
|
|
129
113
|
import {
|
|
130
|
-
movePoint,
|
|
131
|
-
} from "../scripts/Utilities.js";
|
|
132
|
-
import {
|
|
133
|
-
ElCol as Col,
|
|
134
|
-
ElContainer as Container,
|
|
135
|
-
ElInputNumber as InputNumber,
|
|
136
|
-
ElMain as Main,
|
|
137
|
-
ElRow as Row,
|
|
138
|
-
ElSelect as Select,
|
|
139
|
-
ElSlider as Slider,
|
|
140
|
-
ElOption as Option,
|
|
141
|
-
} from "element-plus";
|
|
142
|
-
import{
|
|
143
114
|
ArrowLeft as ElIconArrowLeft,
|
|
144
115
|
ArrowRight as ElIconArrowRight,
|
|
145
116
|
} from '@element-plus/icons-vue';
|
|
@@ -148,19 +119,7 @@ import{
|
|
|
148
119
|
* A component to control the opacity of the target object.
|
|
149
120
|
*/
|
|
150
121
|
export default {
|
|
151
|
-
name:
|
|
152
|
-
components: {
|
|
153
|
-
Col,
|
|
154
|
-
Container,
|
|
155
|
-
InputNumber,
|
|
156
|
-
Main,
|
|
157
|
-
Select,
|
|
158
|
-
Slider,
|
|
159
|
-
Row,
|
|
160
|
-
Option,
|
|
161
|
-
ElIconArrowLeft,
|
|
162
|
-
ElIconArrowRight,
|
|
163
|
-
},
|
|
122
|
+
name: 'PointsControls',
|
|
164
123
|
inject: ['boundingDims'],
|
|
165
124
|
data: function () {
|
|
166
125
|
return {
|
|
@@ -169,11 +128,11 @@ export default {
|
|
|
169
128
|
choices: [
|
|
170
129
|
{
|
|
171
130
|
value: true,
|
|
172
|
-
label:
|
|
131
|
+
label: 'On',
|
|
173
132
|
},
|
|
174
133
|
{
|
|
175
134
|
value: false,
|
|
176
|
-
label:
|
|
135
|
+
label: 'off',
|
|
177
136
|
},
|
|
178
137
|
],
|
|
179
138
|
min: [0, 0, 0],
|
|
@@ -191,23 +150,15 @@ export default {
|
|
|
191
150
|
boundingDims: {
|
|
192
151
|
handler: function (value) {
|
|
193
152
|
const size = value.size;
|
|
194
|
-
this.min = [
|
|
195
|
-
|
|
196
|
-
-size[1] / 2,
|
|
197
|
-
-size[2] / 2,
|
|
198
|
-
];
|
|
199
|
-
this.max = [
|
|
200
|
-
size[0] / 2,
|
|
201
|
-
size[1] / 2,
|
|
202
|
-
size[2] / 2,
|
|
203
|
-
];
|
|
153
|
+
this.min = [-size[0] / 2, -size[1] / 2, -size[2] / 2];
|
|
154
|
+
this.max = [size[0] / 2, size[1] / 2, size[2] / 2];
|
|
204
155
|
},
|
|
205
156
|
immediate: true,
|
|
206
157
|
deep: true,
|
|
207
158
|
},
|
|
208
159
|
},
|
|
209
160
|
methods: {
|
|
210
|
-
changeIndex: function(increment) {
|
|
161
|
+
changeIndex: function (increment) {
|
|
211
162
|
if (increment) {
|
|
212
163
|
if (this.zincObject.drawRange > this.currentIndex + 1) {
|
|
213
164
|
this.currentIndex++;
|
|
@@ -218,7 +169,7 @@ export default {
|
|
|
218
169
|
this.reset();
|
|
219
170
|
}
|
|
220
171
|
},
|
|
221
|
-
onMoveSliding: function() {
|
|
172
|
+
onMoveSliding: function () {
|
|
222
173
|
const diff = [
|
|
223
174
|
this.translation[0] - this.pTranslation[0],
|
|
224
175
|
this.translation[1] - this.pTranslation[1],
|
|
@@ -229,11 +180,11 @@ export default {
|
|
|
229
180
|
this.pTranslation[i] = this.translation[i];
|
|
230
181
|
}
|
|
231
182
|
},
|
|
232
|
-
reset: function() {
|
|
183
|
+
reset: function () {
|
|
233
184
|
this.translation = [0, 0, 0];
|
|
234
185
|
this.pTranslation = [0, 0, 0];
|
|
235
186
|
if (this.edited) {
|
|
236
|
-
this.$emit(
|
|
187
|
+
this.$emit('primitivesUpdated', this.zincObject);
|
|
237
188
|
this.edited = false;
|
|
238
189
|
}
|
|
239
190
|
},
|
|
@@ -254,7 +205,7 @@ export default {
|
|
|
254
205
|
this.attenuation = false;
|
|
255
206
|
}
|
|
256
207
|
},
|
|
257
|
-
modifyAttenuation: function(flag) {
|
|
208
|
+
modifyAttenuation: function (flag) {
|
|
258
209
|
this.attenuation = flag;
|
|
259
210
|
this.zincObject.setSizeAttenuation(flag);
|
|
260
211
|
},
|
|
@@ -267,7 +218,6 @@ export default {
|
|
|
267
218
|
|
|
268
219
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
269
220
|
<style scoped lang="scss">
|
|
270
|
-
|
|
271
221
|
.slides-block {
|
|
272
222
|
pointer-events: auto;
|
|
273
223
|
&.el-main {
|
|
@@ -324,7 +274,7 @@ export default {
|
|
|
324
274
|
padding-left: 4px;
|
|
325
275
|
padding-right: 8px;
|
|
326
276
|
border: none;
|
|
327
|
-
font-family:
|
|
277
|
+
font-family: 'Asap', sans-serif;
|
|
328
278
|
line-height: 22px;
|
|
329
279
|
}
|
|
330
280
|
|
|
@@ -333,5 +283,4 @@ export default {
|
|
|
333
283
|
line-height: 22px;
|
|
334
284
|
}
|
|
335
285
|
}
|
|
336
|
-
|
|
337
286
|
</style>
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-show="hasValidPrimitive" class="my-drawer">
|
|
3
3
|
<el-collapse class="collapse" v-model="activeName" accordion>
|
|
4
|
-
<el-collapse-item title="Opacity" name="oControls" v-show="!isTextureSlides"
|
|
4
|
+
<el-collapse-item title="Opacity" name="oControls" v-show="!isTextureSlides">
|
|
5
5
|
<opacity-controls
|
|
6
6
|
:material="material"
|
|
7
7
|
:zincObject="zincObject"
|
|
8
|
-
ref="opacityControls"
|
|
8
|
+
ref="opacityControls"
|
|
9
|
+
@update:opacity="material.opacity = $event"
|
|
10
|
+
/>
|
|
9
11
|
</el-collapse-item>
|
|
10
12
|
<el-collapse-item v-show="!isEditable" title="Transformation" name="trControls">
|
|
11
|
-
<transformation-controls
|
|
12
|
-
class="transformation-controls"
|
|
13
|
-
ref="transformationControls" />
|
|
13
|
+
<transformation-controls class="transformation-controls" ref="transformationControls" />
|
|
14
14
|
</el-collapse-item>
|
|
15
15
|
<el-collapse-item v-show="isTextureSlides" title="Texture Slides" name="tsControls">
|
|
16
|
-
<texture-slides-controls
|
|
17
|
-
class="texture-controls"
|
|
18
|
-
ref="tSlidesControls" />
|
|
16
|
+
<texture-slides-controls class="texture-controls" ref="tSlidesControls" />
|
|
19
17
|
</el-collapse-item>
|
|
20
18
|
<el-collapse-item v-show="isPointset" title="Points" name="pControls">
|
|
21
19
|
<points-controls
|
|
@@ -45,38 +43,27 @@
|
|
|
45
43
|
</template>
|
|
46
44
|
|
|
47
45
|
<script>
|
|
48
|
-
/* eslint-disable no-alert, no-console */
|
|
49
46
|
import { markRaw } from 'vue';
|
|
50
|
-
import {
|
|
51
|
-
ArrowRight as ElIconArrowRight,
|
|
52
|
-
} from '@element-plus/icons-vue';
|
|
53
|
-
import {
|
|
54
|
-
ElCollapse as Collapse,
|
|
55
|
-
ElCollapseItem as CollapseItem,
|
|
56
|
-
} from "element-plus";
|
|
57
47
|
|
|
58
|
-
import OpacityControls from
|
|
59
|
-
import PointsControls from
|
|
60
|
-
import LinesControls from
|
|
61
|
-
import GlyphsControls from
|
|
62
|
-
import TextureSlidesControls from
|
|
63
|
-
import TransformationControls from
|
|
48
|
+
import OpacityControls from './OpacityControls.vue';
|
|
49
|
+
import PointsControls from './PointsControls.vue';
|
|
50
|
+
import LinesControls from './LinesControls.vue';
|
|
51
|
+
import GlyphsControls from './GlyphsControls.vue';
|
|
52
|
+
import TextureSlidesControls from './TextureSlidesControls.vue';
|
|
53
|
+
import TransformationControls from './TransformationControls.vue';
|
|
64
54
|
|
|
65
55
|
/**
|
|
66
56
|
* A component to control the opacity of the target object.
|
|
67
57
|
*/
|
|
68
58
|
export default {
|
|
69
|
-
name:
|
|
59
|
+
name: 'PrimitiveControls',
|
|
70
60
|
components: {
|
|
71
|
-
Collapse,
|
|
72
|
-
CollapseItem,
|
|
73
61
|
GlyphsControls,
|
|
74
62
|
LinesControls,
|
|
75
63
|
OpacityControls,
|
|
76
64
|
PointsControls,
|
|
77
65
|
TextureSlidesControls,
|
|
78
66
|
TransformationControls,
|
|
79
|
-
ElIconArrowRight,
|
|
80
67
|
},
|
|
81
68
|
props: {
|
|
82
69
|
createData: {
|
|
@@ -84,15 +71,15 @@ export default {
|
|
|
84
71
|
},
|
|
85
72
|
viewingMode: {
|
|
86
73
|
type: String,
|
|
87
|
-
default:
|
|
74
|
+
default: 'Exploration',
|
|
88
75
|
},
|
|
89
76
|
usageConfig: {
|
|
90
77
|
type: Object,
|
|
91
|
-
}
|
|
78
|
+
},
|
|
92
79
|
},
|
|
93
|
-
data: function() {
|
|
80
|
+
data: function () {
|
|
94
81
|
return {
|
|
95
|
-
activeName:
|
|
82
|
+
activeName: 'oControls',
|
|
96
83
|
material: undefined,
|
|
97
84
|
isTextureSlides: false,
|
|
98
85
|
isPointset: false,
|
|
@@ -100,23 +87,23 @@ export default {
|
|
|
100
87
|
isGlyph: false,
|
|
101
88
|
zincObject: undefined,
|
|
102
89
|
isEditable: false,
|
|
103
|
-
displayString:
|
|
90
|
+
displayString: '100%',
|
|
104
91
|
};
|
|
105
92
|
},
|
|
106
93
|
computed: {
|
|
107
94
|
hasValidPrimitive: function () {
|
|
108
95
|
if (this.viewingMode === 'Exploration' || this.viewingMode === 'Annotation') {
|
|
109
|
-
return
|
|
96
|
+
return this.material !== undefined || this.isTextureSlides === true;
|
|
110
97
|
}
|
|
111
98
|
return false;
|
|
112
|
-
}
|
|
99
|
+
},
|
|
113
100
|
},
|
|
114
101
|
methods: {
|
|
115
|
-
formatTooltip: function(val) {
|
|
116
|
-
this.displayString = Math.floor(100 * val + 0.5) +
|
|
102
|
+
formatTooltip: function (val) {
|
|
103
|
+
this.displayString = Math.floor(100 * val + 0.5) + '%';
|
|
117
104
|
return this.displayString;
|
|
118
105
|
},
|
|
119
|
-
setObject: function(object) {
|
|
106
|
+
setObject: function (object) {
|
|
120
107
|
if (object) {
|
|
121
108
|
this.zincObject = markRaw(object);
|
|
122
109
|
} else {
|
|
@@ -126,27 +113,28 @@ export default {
|
|
|
126
113
|
this.isPointset = false;
|
|
127
114
|
this.isTextureSlides = false;
|
|
128
115
|
this.isLines = false;
|
|
129
|
-
this.isGlyph = false,
|
|
130
|
-
this.activeName = "trControls";
|
|
116
|
+
((this.isGlyph = false), (this.activeName = 'trControls'));
|
|
131
117
|
if (object) {
|
|
132
118
|
if (object.isTextureSlides) {
|
|
133
119
|
this.isTextureSlides = true;
|
|
134
120
|
this.$refs.tSlidesControls.setObject(object);
|
|
135
|
-
this.activeName =
|
|
121
|
+
this.activeName = 'tsControls';
|
|
136
122
|
} else if (object.isPointset) {
|
|
137
123
|
this.isPointset = true;
|
|
138
124
|
this.$refs.pointsetControls.setObject(object);
|
|
139
|
-
this.activeName =
|
|
140
|
-
} else if (
|
|
141
|
-
|
|
125
|
+
this.activeName = 'pControls';
|
|
126
|
+
} else if (
|
|
127
|
+
object.isLines2 ||
|
|
128
|
+
(object.isTubeLines && this.usageConfig?.showTubeLinesControls)
|
|
129
|
+
) {
|
|
142
130
|
this.isLines = true;
|
|
143
131
|
this.$refs.linesControls.setObject(object);
|
|
144
|
-
this.activeName =
|
|
132
|
+
this.activeName = 'lControls';
|
|
145
133
|
} else if (object.isGlyphset) {
|
|
146
134
|
if (object.canShowLabel()) {
|
|
147
135
|
this.isGlyph = true;
|
|
148
136
|
this.$refs.glyphControls.setObject(object);
|
|
149
|
-
this.activeName =
|
|
137
|
+
this.activeName = 'gControls';
|
|
150
138
|
}
|
|
151
139
|
}
|
|
152
140
|
this.$refs.transformationControls.setObject(object);
|
|
@@ -156,8 +144,8 @@ export default {
|
|
|
156
144
|
} else {
|
|
157
145
|
this.material = undefined;
|
|
158
146
|
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
147
|
+
},
|
|
148
|
+
},
|
|
161
149
|
};
|
|
162
150
|
</script>
|
|
163
151
|
|
|
@@ -170,13 +158,11 @@ export default {
|
|
|
170
158
|
}
|
|
171
159
|
|
|
172
160
|
:deep(.el-collapse-item__header) {
|
|
173
|
-
height:36px;
|
|
161
|
+
height: 36px;
|
|
174
162
|
}
|
|
175
163
|
|
|
176
164
|
:deep(.el-collapse-item__content) {
|
|
177
165
|
padding-bottom: 0px;
|
|
178
166
|
}
|
|
179
167
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
168
|
</style>
|