@abi-software/scaffoldvuer 1.0.0 → 1.1.0-beta.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 +18734 -17156
- package/dist/scaffoldvuer.umd.cjs +181 -181
- package/dist/style.css +1 -1
- package/package.json +4 -3
- package/src/App.vue +37 -2
- package/src/components/CreateTooltipContent.vue +201 -0
- package/src/components/LinesControls.vue +196 -0
- package/src/components/OpacityControls.vue +14 -32
- package/src/components/PointsControls.vue +194 -0
- package/src/components/PrimitiveControls.vue +86 -16
- package/src/components/ScaffoldTooltip.vue +26 -2
- package/src/components/ScaffoldVuer.vue +390 -40
- package/src/components/TextureSlidesControls.vue +7 -19
- package/src/components/TransformationControls.vue +194 -0
- package/src/components/TreeControls.vue +11 -11
- package/src/components.d.ts +7 -0
- package/src/scripts/GraphicsHighlight.js +1 -2
- package/src/scripts/OrgansRenderer.js +30 -12
- package/src/scripts/RendererModule.js +32 -16
- package/src/scripts/Utilities.js +192 -0
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-container
|
|
3
|
-
<el-header height="30px" class="header">
|
|
4
|
-
<div>Texture Slides Settings</div>
|
|
5
|
-
</el-header>
|
|
2
|
+
<el-container class="t-slides-container">
|
|
6
3
|
<el-main class="slides-block">
|
|
7
4
|
<el-row v-for="(slide, index) in settings" :key="slide.id" class="slide-row">
|
|
8
5
|
<el-col :offset="0" :span="6">
|
|
@@ -74,12 +71,13 @@ import {
|
|
|
74
71
|
ElCol as Col,
|
|
75
72
|
ElContainer as Container,
|
|
76
73
|
ElFooter as Footer,
|
|
77
|
-
ElHeader as Header,
|
|
78
74
|
ElIcon as Icon,
|
|
79
75
|
ElInputNumber as InputNumber,
|
|
80
76
|
ElMain as Main,
|
|
81
77
|
ElRow as Row,
|
|
78
|
+
ElSelect as Select,
|
|
82
79
|
ElSlider as Slider,
|
|
80
|
+
ElOption as Option,
|
|
83
81
|
} from "element-plus";
|
|
84
82
|
|
|
85
83
|
/**
|
|
@@ -91,12 +89,13 @@ export default {
|
|
|
91
89
|
Col,
|
|
92
90
|
Container,
|
|
93
91
|
Footer,
|
|
94
|
-
Header,
|
|
95
92
|
Icon,
|
|
96
93
|
InputNumber,
|
|
97
94
|
Main,
|
|
98
95
|
Row,
|
|
96
|
+
Select,
|
|
99
97
|
Slider,
|
|
98
|
+
Option,
|
|
100
99
|
ElIconDelete,
|
|
101
100
|
ElIconPlus,
|
|
102
101
|
},
|
|
@@ -144,7 +143,6 @@ export default {
|
|
|
144
143
|
}
|
|
145
144
|
},
|
|
146
145
|
modifySlide: function (slide) {
|
|
147
|
-
console.log(slide.value)
|
|
148
146
|
if (slide) {
|
|
149
147
|
this._zincObject.modifySlideSettings(slide);
|
|
150
148
|
}
|
|
@@ -159,13 +157,6 @@ export default {
|
|
|
159
157
|
|
|
160
158
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
161
159
|
<style scoped lang="scss">
|
|
162
|
-
.header {
|
|
163
|
-
color: #606266;
|
|
164
|
-
line-height: 1;
|
|
165
|
-
padding: 8px 17px 1px 15px;
|
|
166
|
-
border-bottom: 1px solid #ebeef5;
|
|
167
|
-
font-size: 14px;
|
|
168
|
-
}
|
|
169
160
|
|
|
170
161
|
.add-slides-text {
|
|
171
162
|
color: $app-primary-color;
|
|
@@ -205,11 +196,8 @@ export default {
|
|
|
205
196
|
|
|
206
197
|
.t-slides-container {
|
|
207
198
|
width: 250px;
|
|
208
|
-
height:
|
|
209
|
-
|
|
210
|
-
border: solid 1px #d8dce6;
|
|
211
|
-
background-color: #fff;
|
|
212
|
-
overflow-y: none;
|
|
199
|
+
height: 150px;
|
|
200
|
+
overflow-y: auto;
|
|
213
201
|
}
|
|
214
202
|
|
|
215
203
|
.input-box {
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-container class="transformation-container">
|
|
3
|
+
<el-main class="slides-block">
|
|
4
|
+
<el-row>
|
|
5
|
+
<el-col :offset="0" :span="8">
|
|
6
|
+
Position:
|
|
7
|
+
</el-col>
|
|
8
|
+
</el-row>
|
|
9
|
+
<el-row class="">
|
|
10
|
+
<el-col :offset="3" :span="1">
|
|
11
|
+
x:
|
|
12
|
+
</el-col>
|
|
13
|
+
<el-col :span="3">
|
|
14
|
+
<el-input-number
|
|
15
|
+
v-model="x"
|
|
16
|
+
:step="1"
|
|
17
|
+
:controls="false"
|
|
18
|
+
class="input-box number-input"
|
|
19
|
+
@change="modifyPosition"
|
|
20
|
+
/>
|
|
21
|
+
</el-col>
|
|
22
|
+
<el-col :offset="3" :span="1">
|
|
23
|
+
y:
|
|
24
|
+
</el-col>
|
|
25
|
+
<el-col :span="3">
|
|
26
|
+
<el-input-number
|
|
27
|
+
v-model="y"
|
|
28
|
+
:step="1"
|
|
29
|
+
:controls="false"
|
|
30
|
+
class="input-box number-input"
|
|
31
|
+
@change="modifyPosition"
|
|
32
|
+
/>
|
|
33
|
+
</el-col>
|
|
34
|
+
<el-col :offset="3" :span="1">
|
|
35
|
+
z:
|
|
36
|
+
</el-col>
|
|
37
|
+
<el-col :span="3">
|
|
38
|
+
<el-input-number
|
|
39
|
+
v-model="z"
|
|
40
|
+
:step="1"
|
|
41
|
+
:controls="false"
|
|
42
|
+
class="input-box number-input"
|
|
43
|
+
@change="modifyPosition"
|
|
44
|
+
/>
|
|
45
|
+
</el-col>
|
|
46
|
+
</el-row>
|
|
47
|
+
<el-row class="tool-row">
|
|
48
|
+
<el-col :offset="0" :span="6">
|
|
49
|
+
Scale:
|
|
50
|
+
</el-col>
|
|
51
|
+
<el-col :offset="0" :span="10">
|
|
52
|
+
<el-slider
|
|
53
|
+
v-model="scale"
|
|
54
|
+
:step="0.01"
|
|
55
|
+
:min="0"
|
|
56
|
+
:max="5"
|
|
57
|
+
:show-tooltip="false"
|
|
58
|
+
@input="modifyScale()"
|
|
59
|
+
/>
|
|
60
|
+
</el-col>
|
|
61
|
+
<el-col :offset="0" :span="6">
|
|
62
|
+
<el-input-number
|
|
63
|
+
v-model="scale"
|
|
64
|
+
:step="0.01"
|
|
65
|
+
:min="0"
|
|
66
|
+
:max="5"
|
|
67
|
+
:controls="false"
|
|
68
|
+
class="input-box number-input"
|
|
69
|
+
@change="modifyScale()"
|
|
70
|
+
/>
|
|
71
|
+
</el-col>
|
|
72
|
+
</el-row>
|
|
73
|
+
</el-main>
|
|
74
|
+
</el-container>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script>
|
|
78
|
+
/* eslint-disable no-alert, no-console */
|
|
79
|
+
|
|
80
|
+
import {
|
|
81
|
+
ElCol as Col,
|
|
82
|
+
ElContainer as Container,
|
|
83
|
+
ElInputNumber as InputNumber,
|
|
84
|
+
ElMain as Main,
|
|
85
|
+
} from "element-plus";
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* A component to control the opacity of the target object.
|
|
89
|
+
*/
|
|
90
|
+
export default {
|
|
91
|
+
name: "TransformationControls",
|
|
92
|
+
components: {
|
|
93
|
+
Col,
|
|
94
|
+
Container,
|
|
95
|
+
InputNumber,
|
|
96
|
+
Main,
|
|
97
|
+
},
|
|
98
|
+
data: function () {
|
|
99
|
+
return {
|
|
100
|
+
x: 0,
|
|
101
|
+
y: 0,
|
|
102
|
+
z: 0,
|
|
103
|
+
scale: 1,
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
mounted: function () {
|
|
107
|
+
this._zincObject = undefined;
|
|
108
|
+
},
|
|
109
|
+
methods: {
|
|
110
|
+
setObject: function (object) {
|
|
111
|
+
if (object.isZincObject) {
|
|
112
|
+
this._zincObject = object;
|
|
113
|
+
const morph = this._zincObject.getGroup();
|
|
114
|
+
if (morph && morph.position) {
|
|
115
|
+
this.x = morph.position.x;
|
|
116
|
+
this.y = morph.position.y;
|
|
117
|
+
this.z = morph.position.z;
|
|
118
|
+
this.scale = morph.scale.x;
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
this._zincObject = undefined;
|
|
122
|
+
this.x = 0;
|
|
123
|
+
this.y = 0;
|
|
124
|
+
this.z = 0;
|
|
125
|
+
this.scale = 1;
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
modifyPosition: function() {
|
|
129
|
+
this._zincObject.setPosition(this.x, this.y, this.z);
|
|
130
|
+
},
|
|
131
|
+
modifyScale: function() {
|
|
132
|
+
this._zincObject.setScaleAll(this.scale);
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
</script>
|
|
137
|
+
|
|
138
|
+
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
139
|
+
<style scoped lang="scss">
|
|
140
|
+
.slides-block {
|
|
141
|
+
pointer-events: auto;
|
|
142
|
+
&.el-main {
|
|
143
|
+
padding: 5px;
|
|
144
|
+
&::-webkit-scrollbar {
|
|
145
|
+
width: 10px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&::-webkit-scrollbar-thumb {
|
|
149
|
+
border-radius: 10px;
|
|
150
|
+
box-shadow: inset 0 0 6px #c0c4cc;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.transformation-container {
|
|
156
|
+
width: 250px;
|
|
157
|
+
height: auto;
|
|
158
|
+
background-color: #fff;
|
|
159
|
+
overflow-y: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.input-box {
|
|
163
|
+
width: 42px;
|
|
164
|
+
border-radius: 4px;
|
|
165
|
+
border: 1px solid rgb(144, 147, 153);
|
|
166
|
+
background-color: var(--white);
|
|
167
|
+
font-weight: 500;
|
|
168
|
+
color: rgb(48, 49, 51);
|
|
169
|
+
margin-left: 8px;
|
|
170
|
+
height: 24px;
|
|
171
|
+
|
|
172
|
+
&.number-input {
|
|
173
|
+
width: 42px;
|
|
174
|
+
:deep(.el-input__wrapper) {
|
|
175
|
+
padding-left: 0px;
|
|
176
|
+
padding-right: 0px;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.my-slider {
|
|
182
|
+
position: absolute;
|
|
183
|
+
width: 135px;
|
|
184
|
+
left: 50px;
|
|
185
|
+
pointer-events: auto;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.tool-row {
|
|
189
|
+
align-items:center;
|
|
190
|
+
text-align: center;
|
|
191
|
+
padding-top:8px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
</style>
|
|
@@ -136,7 +136,7 @@ export default {
|
|
|
136
136
|
this.sortedPrimitiveGroups = undefined;
|
|
137
137
|
},
|
|
138
138
|
methods: {
|
|
139
|
-
addTreeItem: function (parentContainer, item) {
|
|
139
|
+
addTreeItem: function (parentContainer, item, object) {
|
|
140
140
|
//The following block prevent duplicate graphics with the same name
|
|
141
141
|
if (parentContainer.some(child => child.label === item.label)) {
|
|
142
142
|
return;
|
|
@@ -147,7 +147,10 @@ export default {
|
|
|
147
147
|
});
|
|
148
148
|
this.__nodeNumbers++;
|
|
149
149
|
this.$nextTick(() => {
|
|
150
|
-
this.$refs.regionTree.
|
|
150
|
+
const checked = this.$refs.regionTree.getCheckedKeys();
|
|
151
|
+
if (!checked.includes(item.id) && object.getVisibility()) {
|
|
152
|
+
this.$refs.regionTree.setChecked(item.id, true);
|
|
153
|
+
}
|
|
151
154
|
});
|
|
152
155
|
},
|
|
153
156
|
// find or create new region, region id is always prefixed with
|
|
@@ -164,23 +167,23 @@ export default {
|
|
|
164
167
|
}
|
|
165
168
|
if (paths.length > 0) {
|
|
166
169
|
const _paths = [...paths];
|
|
167
|
-
let
|
|
170
|
+
let childRegionItem = data.children.find(
|
|
168
171
|
(child) => child.label == _paths[0]
|
|
169
172
|
);
|
|
170
173
|
const path = prefix + "/" + paths[0];
|
|
171
174
|
const region = this.$module.scene.getRootRegion().findChildFromPath(path);
|
|
172
|
-
if (!
|
|
173
|
-
|
|
175
|
+
if (!childRegionItem) {
|
|
176
|
+
childRegionItem = {
|
|
174
177
|
label: _paths[0],
|
|
175
178
|
id: region.uuid,
|
|
176
179
|
children: [],
|
|
177
180
|
regionPath: path,
|
|
178
181
|
isRegion: true,
|
|
179
182
|
};
|
|
180
|
-
this.addTreeItem(data.children,
|
|
183
|
+
this.addTreeItem(data.children, childRegionItem, region);
|
|
181
184
|
}
|
|
182
185
|
_paths.shift();
|
|
183
|
-
return this.findOrCreateRegion(
|
|
186
|
+
return this.findOrCreateRegion(childRegionItem, _paths, path);
|
|
184
187
|
} else {
|
|
185
188
|
return data;
|
|
186
189
|
}
|
|
@@ -209,7 +212,7 @@ export default {
|
|
|
209
212
|
regionPath: zincObject.region.getFullPath(),
|
|
210
213
|
isTextureSlides: zincObject.isTextureSlides ? true : false,
|
|
211
214
|
};
|
|
212
|
-
this.addTreeItem(regionData.children, child);
|
|
215
|
+
this.addTreeItem(regionData.children, child, zincObject);
|
|
213
216
|
}
|
|
214
217
|
}
|
|
215
218
|
}
|
|
@@ -372,9 +375,6 @@ export default {
|
|
|
372
375
|
});
|
|
373
376
|
}
|
|
374
377
|
},
|
|
375
|
-
viewAll: function () {
|
|
376
|
-
this.$module.viewAll();
|
|
377
|
-
},
|
|
378
378
|
visibilityToggle: function (item, event) {
|
|
379
379
|
this.$module.changeOrganPartsVisibility(item, event);
|
|
380
380
|
if (event == false) {
|
package/src/components.d.ts
CHANGED
|
@@ -7,8 +7,11 @@ export {}
|
|
|
7
7
|
|
|
8
8
|
declare module 'vue' {
|
|
9
9
|
export interface GlobalComponents {
|
|
10
|
+
CreateTooltipContent: typeof import('./components/CreateTooltipContent.vue')['default']
|
|
10
11
|
ElButton: typeof import('element-plus/es')['ElButton']
|
|
11
12
|
ElCol: typeof import('element-plus/es')['ElCol']
|
|
13
|
+
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
|
14
|
+
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
|
12
15
|
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
|
|
13
16
|
ElContainer: typeof import('element-plus/es')['ElContainer']
|
|
14
17
|
ElFooter: typeof import('element-plus/es')['ElFooter']
|
|
@@ -19,6 +22,7 @@ declare module 'vue' {
|
|
|
19
22
|
ElIconDelete: typeof import('@element-plus/icons-vue')['Delete']
|
|
20
23
|
ElIconPlus: typeof import('@element-plus/icons-vue')['Plus']
|
|
21
24
|
ElIconWarningFilled: typeof import('@element-plus/icons-vue')['WarningFilled']
|
|
25
|
+
ElInput: typeof import('element-plus/es')['ElInput']
|
|
22
26
|
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
|
23
27
|
ElMain: typeof import('element-plus/es')['ElMain']
|
|
24
28
|
ElOption: typeof import('element-plus/es')['ElOption']
|
|
@@ -29,13 +33,16 @@ declare module 'vue' {
|
|
|
29
33
|
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
|
30
34
|
ElTabs: typeof import('element-plus/es')['ElTabs']
|
|
31
35
|
ElTree: typeof import('element-plus/es')['ElTree']
|
|
36
|
+
LinesControls: typeof import('./components/LinesControls.vue')['default']
|
|
32
37
|
OpacityControls: typeof import('./components/OpacityControls.vue')['default']
|
|
38
|
+
PointsControls: typeof import('./components/PointsControls.vue')['default']
|
|
33
39
|
PrimitiveControls: typeof import('./components/PrimitiveControls.vue')['default']
|
|
34
40
|
RouterLink: typeof import('vue-router')['RouterLink']
|
|
35
41
|
RouterView: typeof import('vue-router')['RouterView']
|
|
36
42
|
ScaffoldTooltip: typeof import('./components/ScaffoldTooltip.vue')['default']
|
|
37
43
|
ScaffoldVuer: typeof import('./components/ScaffoldVuer.vue')['default']
|
|
38
44
|
TextureSlidesControls: typeof import('./components/TextureSlidesControls.vue')['default']
|
|
45
|
+
TransformationControls: typeof import('./components/TransformationControls.vue')['default']
|
|
39
46
|
TreeControls: typeof import('./components/TreeControls.vue')['default']
|
|
40
47
|
}
|
|
41
48
|
export interface ComponentCustomProperties {
|
|
@@ -116,7 +116,6 @@ const GraphicsHighlight = function() {
|
|
|
116
116
|
}
|
|
117
117
|
*/
|
|
118
118
|
|
|
119
|
-
|
|
120
119
|
this.setHighlighted = function(objects) {
|
|
121
120
|
const previousHighlightedObjects = [...currentHighlightedObjects];
|
|
122
121
|
_this.resetHighlighted();
|
|
@@ -131,7 +130,7 @@ const GraphicsHighlight = function() {
|
|
|
131
130
|
this.setSelected = function(objects) {
|
|
132
131
|
// first find highlighted object that are not selected
|
|
133
132
|
const previousHSelectedObjects = [...currentSelectedObjects];
|
|
134
|
-
const array = getUnmatchingObjects(currentHighlightedObjects, objects);
|
|
133
|
+
//const array = getUnmatchingObjects(currentHighlightedObjects, objects);
|
|
135
134
|
_this.resetHighlighted();
|
|
136
135
|
_this.resetSelected();
|
|
137
136
|
const fullList = getFullListOfObjects(objects);
|
|
@@ -234,20 +234,30 @@ const OrgansSceneData = function() {
|
|
|
234
234
|
return function(intersects, window_x, window_y) {
|
|
235
235
|
const intersected = _this.getIntersectedObject(intersects);
|
|
236
236
|
const idObject = getIdObjectFromIntersect(intersected);
|
|
237
|
+
const extraData = {
|
|
238
|
+
worldCoords: [
|
|
239
|
+
intersected ? intersected.point.x : 0,
|
|
240
|
+
intersected ? intersected.point.y : 0,
|
|
241
|
+
intersected ? intersected.point.z : 0,
|
|
242
|
+
],
|
|
243
|
+
intersected,
|
|
244
|
+
};
|
|
237
245
|
const coords = { x: window_x, y: window_y };
|
|
238
246
|
if (idObject.id) {
|
|
239
247
|
if (idObject.object.userData.isGlyph) {
|
|
240
|
-
if (idObject.object.name)
|
|
241
|
-
_this.setSelectedByObjects([idObject.object], coords,
|
|
242
|
-
|
|
248
|
+
if (idObject.object.name) {
|
|
249
|
+
_this.setSelectedByObjects([idObject.object], coords,
|
|
250
|
+
extraData, true);
|
|
251
|
+
} else {
|
|
243
252
|
_this.setSelectedByZincObjects(idObject.object.userData.getGlyphset(),
|
|
244
|
-
|
|
253
|
+
coords, extraData, true);
|
|
254
|
+
}
|
|
245
255
|
} else {
|
|
246
|
-
_this.setSelectedByObjects([idObject.object], coords, true);
|
|
256
|
+
_this.setSelectedByObjects([idObject.object], coords, extraData, true);
|
|
247
257
|
}
|
|
248
258
|
return;
|
|
249
259
|
} else {
|
|
250
|
-
_this.setSelectedByObjects([], coords, true);
|
|
260
|
+
_this.setSelectedByObjects([], coords, extraData, true);
|
|
251
261
|
}
|
|
252
262
|
}
|
|
253
263
|
};
|
|
@@ -261,15 +271,22 @@ const OrgansSceneData = function() {
|
|
|
261
271
|
return function(intersects, window_x, window_y) {
|
|
262
272
|
const intersected = _this.getIntersectedObject(intersects);
|
|
263
273
|
const idObject = getIdObjectFromIntersect(intersected);
|
|
274
|
+
const extraData = {
|
|
275
|
+
worldCoords: [
|
|
276
|
+
intersected ? intersected.point.x : 0,
|
|
277
|
+
intersected ? intersected.point.y : 0,
|
|
278
|
+
intersected ? intersected.point.z : 0,
|
|
279
|
+
],
|
|
280
|
+
}
|
|
264
281
|
const coords = { x: window_x, y: window_y };
|
|
265
282
|
if (idObject.id) {
|
|
266
283
|
_this.displayArea.style.cursor = "pointer";
|
|
267
|
-
_this.setHighlightedByObjects([idObject.object], coords, true);
|
|
284
|
+
_this.setHighlightedByObjects([idObject.object], coords, extraData, true);
|
|
268
285
|
return;
|
|
269
286
|
}
|
|
270
287
|
else {
|
|
271
288
|
_this.displayArea.style.cursor = "auto";
|
|
272
|
-
_this.setHighlightedByObjects([], coords, true);
|
|
289
|
+
_this.setHighlightedByObjects([], coords, extraData, true);
|
|
273
290
|
}
|
|
274
291
|
}
|
|
275
292
|
};
|
|
@@ -483,6 +500,7 @@ const OrgansSceneData = function() {
|
|
|
483
500
|
} else {
|
|
484
501
|
organScene = _this.zincRenderer.createScene(name);
|
|
485
502
|
}
|
|
503
|
+
_this.selectObjectOnPick = true;
|
|
486
504
|
for (let i = 0; i < sceneChangedCallbacks.length;i++) {
|
|
487
505
|
sceneChangedCallbacks[i](_this.sceneData);
|
|
488
506
|
}
|
|
@@ -493,8 +511,8 @@ const OrgansSceneData = function() {
|
|
|
493
511
|
_this.sceneData.viewURL = undefined;
|
|
494
512
|
}
|
|
495
513
|
_this.sceneData.metaURL = url;
|
|
496
|
-
|
|
497
|
-
|
|
514
|
+
organScene.addZincObjectAddedCallbacks(_addOrganPartCallback(systemName, partName, false));
|
|
515
|
+
organScene.loadMetadataURL(url, undefined, downloadCompletedCallback());
|
|
498
516
|
_this.scene = organScene;
|
|
499
517
|
_this.zincRenderer.setCurrentScene(organScene);
|
|
500
518
|
_this.graphicsHighlight.reset();
|
|
@@ -523,8 +541,8 @@ const OrgansSceneData = function() {
|
|
|
523
541
|
}
|
|
524
542
|
_this.sceneData.viewURL = undefined;
|
|
525
543
|
_this.sceneData.metaURL = url;
|
|
526
|
-
|
|
527
|
-
|
|
544
|
+
organScene.addZincObjectAddedCallbacks(_addOrganPartCallback(undefined, partName, false));
|
|
545
|
+
organScene.loadGLTF(url, undefined, undefined, downloadCompletedCallback());
|
|
528
546
|
_this.scene = organScene;
|
|
529
547
|
_this.zincRenderer.setCurrentScene(organScene);
|
|
530
548
|
_this.graphicsHighlight.reset();
|
|
@@ -32,6 +32,7 @@ const RendererModule = function() {
|
|
|
32
32
|
this.rendererContainer = undefined;
|
|
33
33
|
this.displayArea = undefined;
|
|
34
34
|
this.graphicsHighlight = new GraphicsHighlight();
|
|
35
|
+
this.selectObjectOnPick = true;
|
|
35
36
|
this.zincRenderer = null;
|
|
36
37
|
this.selectedScreenCoordinates = new THREE.Vector3();
|
|
37
38
|
this.selectedCenter = undefined;
|
|
@@ -93,7 +94,7 @@ RendererModule.prototype.getAnnotationsFromObjects = function(objects) {
|
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
RendererModule.prototype.setHighlightedByObjects = function(
|
|
96
|
-
objects, coords, propagateChanges) {
|
|
97
|
+
objects, coords, extraData, propagateChanges) {
|
|
97
98
|
const changed = this.graphicsHighlight.setHighlighted(objects);
|
|
98
99
|
const zincObjects = this.objectsToZincObjects(objects);
|
|
99
100
|
if (propagateChanges) {
|
|
@@ -101,8 +102,10 @@ RendererModule.prototype.setHighlightedByObjects = function(
|
|
|
101
102
|
if (changed)
|
|
102
103
|
eventType = EVENT_TYPE.HIGHLIGHTED;
|
|
103
104
|
const annotations = this.getAnnotationsFromObjects(objects);
|
|
104
|
-
if (annotations.length > 0)
|
|
105
|
+
if (annotations.length > 0) {
|
|
105
106
|
annotations[0].coords = coords;
|
|
107
|
+
annotations[0].extraData = extraData;
|
|
108
|
+
}
|
|
106
109
|
this.publishChanges(annotations, eventType, zincObjects);
|
|
107
110
|
}
|
|
108
111
|
return changed;
|
|
@@ -110,7 +113,7 @@ RendererModule.prototype.setHighlightedByObjects = function(
|
|
|
110
113
|
|
|
111
114
|
|
|
112
115
|
RendererModule.prototype.setHighlightedByZincObjects = function(
|
|
113
|
-
zincObjects, coords, propagateChanges) {
|
|
116
|
+
zincObjects, coords, extraData, propagateChanges) {
|
|
114
117
|
let morphs = [];
|
|
115
118
|
if (zincObjects) {
|
|
116
119
|
zincObjects.forEach(zincObject => {
|
|
@@ -119,7 +122,7 @@ RendererModule.prototype.setHighlightedByZincObjects = function(
|
|
|
119
122
|
});
|
|
120
123
|
}
|
|
121
124
|
|
|
122
|
-
return this.setHighlightedByObjects(morphs, coords,propagateChanges);
|
|
125
|
+
return this.setHighlightedByObjects(morphs, coords, extraData, propagateChanges);
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
RendererModule.prototype.setupLiveCoordinates = function(zincObjects) {
|
|
@@ -127,11 +130,15 @@ RendererModule.prototype.setupLiveCoordinates = function(zincObjects) {
|
|
|
127
130
|
if (zincObjects && (zincObjects.length > 0)) {
|
|
128
131
|
const boundingBox = this.scene.getBoundingBoxOfZincObjects(zincObjects);
|
|
129
132
|
let newSelectedCenter = new THREE.Vector3();
|
|
130
|
-
boundingBox
|
|
131
|
-
|
|
132
|
-
this.selectedCenter
|
|
133
|
+
if (boundingBox) {
|
|
134
|
+
boundingBox.getCenter(newSelectedCenter);
|
|
135
|
+
if (this.selectedCenter == undefined) {
|
|
136
|
+
this.selectedCenter = newSelectedCenter;
|
|
137
|
+
} else {
|
|
138
|
+
this.selectedCenter.copy(newSelectedCenter);
|
|
139
|
+
}
|
|
133
140
|
} else {
|
|
134
|
-
this.selectedCenter
|
|
141
|
+
this.selectedCenter = undefined;
|
|
135
142
|
}
|
|
136
143
|
} else {
|
|
137
144
|
this.selectedCenter = undefined;
|
|
@@ -158,16 +165,25 @@ RendererModule.prototype.objectsToZincObjects = function(objects) {
|
|
|
158
165
|
|
|
159
166
|
|
|
160
167
|
RendererModule.prototype.setSelectedByObjects = function(
|
|
161
|
-
objects, coords, propagateChanges) {
|
|
162
|
-
|
|
168
|
+
objects, coords, extraData, propagateChanges) {
|
|
169
|
+
let changed = false;
|
|
170
|
+
if (this.selectObjectOnPick) {
|
|
171
|
+
changed = this.graphicsHighlight.setSelected(objects);
|
|
172
|
+
} else {
|
|
173
|
+
changed = true;
|
|
174
|
+
}
|
|
163
175
|
if (changed) {
|
|
164
176
|
const zincObjects = this.objectsToZincObjects(objects);
|
|
165
|
-
this.
|
|
177
|
+
if (this.selectObjectOnPick) {
|
|
178
|
+
this.setupLiveCoordinates(zincObjects);
|
|
179
|
+
}
|
|
166
180
|
if (propagateChanges) {
|
|
167
181
|
const eventType = EVENT_TYPE.SELECTED;
|
|
168
182
|
const annotations = this.getAnnotationsFromObjects(objects);
|
|
169
|
-
if (annotations.length > 0)
|
|
183
|
+
if (annotations.length > 0) {
|
|
170
184
|
annotations[0].coords = coords;
|
|
185
|
+
annotations[0].extraData = extraData;
|
|
186
|
+
}
|
|
171
187
|
this.publishChanges(annotations, eventType, zincObjects);
|
|
172
188
|
}
|
|
173
189
|
}
|
|
@@ -175,7 +191,7 @@ RendererModule.prototype.setSelectedByObjects = function(
|
|
|
175
191
|
}
|
|
176
192
|
|
|
177
193
|
RendererModule.prototype.setSelectedByZincObjects = function(
|
|
178
|
-
zincObjects, coords, propagateChanges) {
|
|
194
|
+
zincObjects, coords, extraData, propagateChanges) {
|
|
179
195
|
let morphs = [];
|
|
180
196
|
if (zincObjects) {
|
|
181
197
|
zincObjects.forEach(zincObject => {
|
|
@@ -188,7 +204,7 @@ RendererModule.prototype.setSelectedByZincObjects = function(
|
|
|
188
204
|
});
|
|
189
205
|
}
|
|
190
206
|
|
|
191
|
-
return this.setSelectedByObjects(morphs, coords, propagateChanges);
|
|
207
|
+
return this.setSelectedByObjects(morphs, coords, extraData, propagateChanges);
|
|
192
208
|
}
|
|
193
209
|
|
|
194
210
|
const addGlyphToArray = function(objects) {
|
|
@@ -203,12 +219,12 @@ RendererModule.prototype.findObjectsByGroupName = function(groupName) {
|
|
|
203
219
|
|
|
204
220
|
RendererModule.prototype.setHighlightedByGroupName = function(groupName, propagateChanges) {
|
|
205
221
|
const objects = this.findObjectsByGroupName(groupName);
|
|
206
|
-
return this.setHighlightedByObjects(objects, undefined, propagateChanges);
|
|
222
|
+
return this.setHighlightedByObjects(objects, undefined, {}, propagateChanges);
|
|
207
223
|
}
|
|
208
224
|
|
|
209
225
|
RendererModule.prototype.setSelectedByGroupName = function(groupName, propagateChanges) {
|
|
210
226
|
const objects = this.findObjectsByGroupName(groupName);
|
|
211
|
-
return this.setSelectedByObjects(objects, undefined, propagateChanges);
|
|
227
|
+
return this.setSelectedByObjects(objects, undefined, {}, propagateChanges);
|
|
212
228
|
}
|
|
213
229
|
|
|
214
230
|
RendererModule.prototype.changeBackgroundColour = function(backgroundColourString) {
|