@abi-software/scaffoldvuer 1.11.0-demo.3 → 1.11.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 +9899 -9551
- package/dist/scaffoldvuer.umd.cjs +173 -173
- package/dist/style.css +1 -1
- package/mapped_fma_nerves.json +10914 -0
- package/nerve_mapping.js +10917 -0
- package/package.json +3 -3
- package/src/App.vue +6 -2
- package/src/components/LinesControls.vue +105 -27
- package/src/components/PrimitiveControls.vue +19 -2
- package/src/components/ScaffoldTreeControls.vue +21 -5
- package/src/components/ScaffoldVuer.vue +104 -73
- package/src/scripts/GraphicsHighlight.js +38 -3
- package/src/scripts/MappedNerves.js +0 -1
- package/src/scripts/MappedOrgans.js +50 -0
- package/src/scripts/OrgansRenderer.js +12 -2
- package/src/scripts/RendererModule.js +3 -20
- package/src/scripts/Utilities.js +27 -0
- package/vite.web-component.js +36 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/scaffoldvuer",
|
|
3
|
-
"version": "1.11.0
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"*.js"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@abi-software/map-utilities": "^1.
|
|
44
|
+
"@abi-software/map-utilities": "^1.7.0",
|
|
45
45
|
"@abi-software/sparc-annotation": "^0.3.2",
|
|
46
46
|
"@abi-software/svg-sprite": "^1.0.1",
|
|
47
47
|
"@element-plus/icons-vue": "^2.3.1",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"vue": "^3.4.21",
|
|
55
55
|
"vue-router": "^4.2.5",
|
|
56
56
|
"vue3-component-svg-sprite": "^0.0.1",
|
|
57
|
-
"zincjs": "^1.
|
|
57
|
+
"zincjs": "^1.15.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@vitejs/plugin-vue": "^4.6.2",
|
package/src/App.vue
CHANGED
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
@timeChanged="updateCurrentTime"
|
|
37
37
|
@zinc-object-added="objectAdded"
|
|
38
38
|
@vue:mounted="viewerMounted"
|
|
39
|
+
:usageConfig="usageConfig"
|
|
39
40
|
/>
|
|
40
41
|
</drop-zone>
|
|
41
42
|
|
|
@@ -397,7 +398,7 @@ export default {
|
|
|
397
398
|
},
|
|
398
399
|
data: function () {
|
|
399
400
|
return {
|
|
400
|
-
consoleOn:
|
|
401
|
+
consoleOn: true,
|
|
401
402
|
createLinesWithNormal: false,
|
|
402
403
|
url: undefined,
|
|
403
404
|
input: undefined,
|
|
@@ -447,7 +448,10 @@ export default {
|
|
|
447
448
|
ElIconFolderOpened: shallowRef(ElIconFolderOpened),
|
|
448
449
|
auto: NaN,
|
|
449
450
|
annotator: markRaw(new AnnotationService(`https://mapcore-demo.org/devel/flatmap/v4/annotator`)),
|
|
450
|
-
fitBoundingBox: false
|
|
451
|
+
fitBoundingBox: false,
|
|
452
|
+
usageConfig: {
|
|
453
|
+
showTubeLinesControls: true
|
|
454
|
+
},
|
|
451
455
|
};
|
|
452
456
|
},
|
|
453
457
|
watch: {
|
|
@@ -1,32 +1,90 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-container class="lines-container">
|
|
3
3
|
<el-main class="slides-block">
|
|
4
|
-
<
|
|
5
|
-
<el-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<el-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<el-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
<template v-if="isTubeLines && showTubeLinesControls">
|
|
5
|
+
<el-row>
|
|
6
|
+
<el-col :offset="0" :span="6">
|
|
7
|
+
Radius:
|
|
8
|
+
</el-col>
|
|
9
|
+
<el-col :offset="0" :span="12">
|
|
10
|
+
<el-slider
|
|
11
|
+
v-model="radius"
|
|
12
|
+
class="my-slider"
|
|
13
|
+
:step="1"
|
|
14
|
+
:min="1"
|
|
15
|
+
:max="32"
|
|
16
|
+
:show-tooltip="false"
|
|
17
|
+
@input="modifyTubeLines"
|
|
18
|
+
/>
|
|
19
|
+
</el-col>
|
|
20
|
+
<el-col :offset="0" :span="4">
|
|
21
|
+
<el-input-number
|
|
22
|
+
v-model="radius"
|
|
23
|
+
:step="1"
|
|
24
|
+
:min="1"
|
|
25
|
+
:max="32"
|
|
26
|
+
:controls="false"
|
|
27
|
+
@change="modifyTubeLines"
|
|
28
|
+
class="input-box number-input"
|
|
29
|
+
/>
|
|
30
|
+
</el-col>
|
|
31
|
+
</el-row>
|
|
32
|
+
<el-row>
|
|
33
|
+
<el-col :offset="0" :span="6">
|
|
34
|
+
Radial Segments:
|
|
35
|
+
</el-col>
|
|
36
|
+
<el-col :offset="0" :span="12">
|
|
37
|
+
<el-slider
|
|
38
|
+
v-model="radialSegments"
|
|
39
|
+
class="my-slider"
|
|
40
|
+
:step="1"
|
|
41
|
+
:min="8"
|
|
42
|
+
:max="32"
|
|
43
|
+
:show-tooltip="false"
|
|
44
|
+
@input="modifyTubeLines"
|
|
45
|
+
/>
|
|
46
|
+
</el-col>
|
|
47
|
+
<el-col :offset="0" :span="4">
|
|
48
|
+
<el-input-number
|
|
49
|
+
v-model="radialSegments"
|
|
50
|
+
:step="1"
|
|
51
|
+
:min="8"
|
|
52
|
+
:max="32"
|
|
53
|
+
:controls="false"
|
|
54
|
+
@change="modifyTubeLines"
|
|
55
|
+
class="input-box number-input"
|
|
56
|
+
/>
|
|
57
|
+
</el-col>
|
|
58
|
+
</el-row>
|
|
59
|
+
</template>
|
|
60
|
+
<template v-else-if="!isTubeLines">
|
|
61
|
+
<el-row>
|
|
62
|
+
<el-col :offset="0" :span="6">
|
|
63
|
+
Width:
|
|
64
|
+
</el-col>
|
|
65
|
+
<el-col :offset="0" :span="12">
|
|
66
|
+
<el-slider
|
|
67
|
+
v-model="width"
|
|
68
|
+
class="my-slider"
|
|
69
|
+
:step="1"
|
|
70
|
+
:min="1"
|
|
71
|
+
:max="100"
|
|
72
|
+
:show-tooltip="false"
|
|
73
|
+
@input="modifyWidth"
|
|
74
|
+
/>
|
|
75
|
+
</el-col>
|
|
76
|
+
<el-col :offset="0" :span="4">
|
|
77
|
+
<el-input-number
|
|
78
|
+
v-model="width"
|
|
79
|
+
:step="1"
|
|
80
|
+
:min="1"
|
|
81
|
+
:max="100"
|
|
82
|
+
:controls="false"
|
|
83
|
+
class="input-box number-input"
|
|
84
|
+
/>
|
|
85
|
+
</el-col>
|
|
86
|
+
</el-row>
|
|
87
|
+
</template>
|
|
30
88
|
<template v-if="currentIndex > -1 && distance > 0">
|
|
31
89
|
<el-row>
|
|
32
90
|
<el-col :offset="0" :span="4">
|
|
@@ -101,6 +159,7 @@ import { markRaw, shallowRef } from 'vue';
|
|
|
101
159
|
import {
|
|
102
160
|
getLineDistance,
|
|
103
161
|
moveAndExtendLine,
|
|
162
|
+
NERVE_CONFIG
|
|
104
163
|
} from "../scripts/Utilities.js";
|
|
105
164
|
import {
|
|
106
165
|
ElButton as Button,
|
|
@@ -114,6 +173,7 @@ import{
|
|
|
114
173
|
ArrowLeft as ElIconArrowLeft,
|
|
115
174
|
ArrowRight as ElIconArrowRight,
|
|
116
175
|
} from '@element-plus/icons-vue';
|
|
176
|
+
|
|
117
177
|
/**
|
|
118
178
|
* A component to control the opacity of the target object.
|
|
119
179
|
*/
|
|
@@ -133,6 +193,9 @@ export default {
|
|
|
133
193
|
createData: {
|
|
134
194
|
type: Object,
|
|
135
195
|
},
|
|
196
|
+
usageConfig: {
|
|
197
|
+
type: Object,
|
|
198
|
+
},
|
|
136
199
|
},
|
|
137
200
|
data: function () {
|
|
138
201
|
return {
|
|
@@ -142,13 +205,21 @@ export default {
|
|
|
142
205
|
distance: 0,
|
|
143
206
|
newDistance: 0,
|
|
144
207
|
width: 1,
|
|
208
|
+
radius: NERVE_CONFIG.DEFAULT_RADIUS,
|
|
209
|
+
radialSegments: NERVE_CONFIG.DEFAULT_RADIAL_SEGMENTS,
|
|
145
210
|
currentIndex: 0,
|
|
146
211
|
ElIconArrowLeft: shallowRef(ElIconArrowLeft),
|
|
147
212
|
ElIconArrowRight: shallowRef(ElIconArrowRight),
|
|
148
213
|
edited: false,
|
|
149
214
|
zincObject: undefined,
|
|
215
|
+
isTubeLines: false,
|
|
150
216
|
};
|
|
151
217
|
},
|
|
218
|
+
computed: {
|
|
219
|
+
showTubeLinesControls() {
|
|
220
|
+
return this.usageConfig.showTubeLinesControls;
|
|
221
|
+
},
|
|
222
|
+
},
|
|
152
223
|
watch: {
|
|
153
224
|
"createData.faceIndex": {
|
|
154
225
|
handler: function (value) {
|
|
@@ -207,12 +278,16 @@ export default {
|
|
|
207
278
|
setObject: function (object) {
|
|
208
279
|
this.currentIndex = -1;
|
|
209
280
|
this.distance = 0;
|
|
210
|
-
if (object.isLines2) {
|
|
281
|
+
if (object.isLines2 || object.isTubeLines) {
|
|
211
282
|
this.zincObject = markRaw(object);
|
|
212
283
|
this.width = this.zincObject.getMorph().material.linewidth;
|
|
284
|
+
this.isTubeLines = object.isTubeLines;
|
|
213
285
|
if (object.isEditable) {
|
|
214
286
|
this.currentIndex = 0;
|
|
215
287
|
this.distance = getLineDistance(object, this.currentIndex);
|
|
288
|
+
} else if (object.userData?.isNerves) {
|
|
289
|
+
this.radius = NERVE_CONFIG.ZOOM_RADIUS;
|
|
290
|
+
this.radialSegments = NERVE_CONFIG.ZOOM_RADIAL_SEGMENTS;
|
|
216
291
|
}
|
|
217
292
|
} else {
|
|
218
293
|
this.zincObject = undefined;
|
|
@@ -222,6 +297,9 @@ export default {
|
|
|
222
297
|
modifyWidth: function () {
|
|
223
298
|
this.zincObject.setWidth(this.width);
|
|
224
299
|
},
|
|
300
|
+
modifyTubeLines: function () {
|
|
301
|
+
this.zincObject.setTubeLines(this.radius, this.radius * this.radialSegments);
|
|
302
|
+
},
|
|
225
303
|
},
|
|
226
304
|
};
|
|
227
305
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
v-show="
|
|
3
|
+
v-show="hasValidPrimitive"
|
|
4
4
|
class="primitive-controls"
|
|
5
5
|
:class="{ open: drawerOpen, close: !drawerOpen }"
|
|
6
6
|
>
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
class="lines-controls"
|
|
35
35
|
ref="linesControls"
|
|
36
36
|
:createData="createData"
|
|
37
|
+
:usageConfig="usageConfig"
|
|
37
38
|
@primitivesUpdated="$emit('primitivesUpdated', $event)"
|
|
38
39
|
/>
|
|
39
40
|
</el-collapse-item>
|
|
@@ -85,6 +86,13 @@ export default {
|
|
|
85
86
|
createData: {
|
|
86
87
|
type: Object,
|
|
87
88
|
},
|
|
89
|
+
viewingMode: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: "Exploration",
|
|
92
|
+
},
|
|
93
|
+
usageConfig: {
|
|
94
|
+
type: Object,
|
|
95
|
+
}
|
|
88
96
|
},
|
|
89
97
|
data: function() {
|
|
90
98
|
return {
|
|
@@ -99,6 +107,14 @@ export default {
|
|
|
99
107
|
displayString: "100%"
|
|
100
108
|
};
|
|
101
109
|
},
|
|
110
|
+
computed: {
|
|
111
|
+
hasValidPrimitive: function () {
|
|
112
|
+
if (this.viewingMode === 'Exploration' || this.viewingMode === 'Annotation') {
|
|
113
|
+
return (this.material !== undefined || this.isTextureSlides === true);
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
},
|
|
102
118
|
methods: {
|
|
103
119
|
formatTooltip: function(val) {
|
|
104
120
|
this.displayString = Math.floor(100 * val + 0.5) + "%";
|
|
@@ -127,7 +143,8 @@ export default {
|
|
|
127
143
|
this.isPointset = true;
|
|
128
144
|
this.$refs.pointsetControls.setObject(object);
|
|
129
145
|
this.activeName = "pControls";
|
|
130
|
-
} else if (object.isLines2
|
|
146
|
+
} else if (object.isLines2 || (object.isTubeLines &&
|
|
147
|
+
this.usageConfig?.showTubeLinesControls)) {
|
|
131
148
|
this.isLines = true;
|
|
132
149
|
this.$refs.linesControls.setObject(object);
|
|
133
150
|
this.activeName = "lControls";
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
@changeActive="changeActiveByNode"
|
|
15
15
|
@changeHover="changeHoverByNode"
|
|
16
16
|
ref="treeControls"
|
|
17
|
+
@mouseleave="removeHover(true)"
|
|
17
18
|
/>
|
|
18
19
|
</div>
|
|
19
20
|
<div
|
|
@@ -77,7 +78,7 @@ export default {
|
|
|
77
78
|
drawerOpen: true,
|
|
78
79
|
nodeNumbers: 0,
|
|
79
80
|
module: undefined,
|
|
80
|
-
checkedRegions: [],
|
|
81
|
+
//checkedRegions: [],
|
|
81
82
|
};
|
|
82
83
|
},
|
|
83
84
|
computed: {
|
|
@@ -93,18 +94,20 @@ export default {
|
|
|
93
94
|
// Updated colour when scaffold is ready
|
|
94
95
|
this.setColourField(data);
|
|
95
96
|
// _helper is unchecked by default
|
|
96
|
-
this.checkedRegions = data.filter(region => region.label !== '_helper');
|
|
97
|
+
//this.checkedRegions = data.filter(region => region.label !== '_helper');
|
|
97
98
|
}
|
|
98
99
|
},
|
|
99
100
|
},
|
|
101
|
+
/*
|
|
100
102
|
checkedRegions: {
|
|
101
103
|
deep: true,
|
|
102
104
|
handler: function (data) {
|
|
103
105
|
if (this.isReady) {
|
|
104
|
-
this.$emit('checked-regions', data)
|
|
106
|
+
this.$emit('checked-regions', data);
|
|
105
107
|
}
|
|
106
108
|
},
|
|
107
109
|
},
|
|
110
|
+
*/
|
|
108
111
|
},
|
|
109
112
|
methods: {
|
|
110
113
|
addTreeItem: function (parentContainer, item, object) {
|
|
@@ -234,10 +237,10 @@ export default {
|
|
|
234
237
|
if (isRegion) {
|
|
235
238
|
if (isChecked) {
|
|
236
239
|
region.showAllPrimitives();
|
|
237
|
-
this.checkedRegions.push(node);
|
|
240
|
+
//this.checkedRegions.push(node);
|
|
238
241
|
} else {
|
|
239
242
|
region.hideAllPrimitives();
|
|
240
|
-
this.checkedRegions = this.checkedRegions.filter(region => region.label !== node.label);
|
|
243
|
+
//this.checkedRegions = this.checkedRegions.filter(region => region.label !== node.label);
|
|
241
244
|
}
|
|
242
245
|
}
|
|
243
246
|
if (isPrimitives) {
|
|
@@ -366,6 +369,19 @@ export default {
|
|
|
366
369
|
}
|
|
367
370
|
return "#FFFFFF";
|
|
368
371
|
},
|
|
372
|
+
getNodeDataByRegionAndGroup: function (regin, group) {
|
|
373
|
+
for (const treeRegion of this.treeDataEntry) {
|
|
374
|
+
if (treeRegion.isRegion && treeRegion.label === regin) {
|
|
375
|
+
const treeGroups = treeRegion.children;
|
|
376
|
+
for (const treeGroup of treeGroups) {
|
|
377
|
+
if (treeGroup.isPrimitives && treeGroup.label === group) {
|
|
378
|
+
return treeGroup;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return undefined;
|
|
384
|
+
},
|
|
369
385
|
getZincObjectsFromNode: function (node, transverse) {
|
|
370
386
|
const rootRegion = this.module.scene.getRootRegion();
|
|
371
387
|
if (node.isPrimitives) {
|