@abi-software/scaffoldvuer 0.1.52-beta.1 → 0.1.52-beta.4
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.common.js +636 -283
- package/dist/scaffoldvuer.common.js.map +1 -1
- package/dist/scaffoldvuer.css +1 -1
- package/dist/scaffoldvuer.umd.js +636 -283
- package/dist/scaffoldvuer.umd.js.map +1 -1
- package/dist/scaffoldvuer.umd.min.js +1 -1
- package/dist/scaffoldvuer.umd.min.js.map +1 -1
- package/package-lock.json +1398 -2472
- package/package.json +4 -3
- package/src/App.vue +78 -49
- package/src/components/DropZone.vue +91 -0
- package/src/components/ScaffoldTooltip.vue +126 -0
- package/src/components/ScaffoldVuer.vue +79 -49
- package/src/components/TreeControls.vue +633 -0
- package/src/scripts/RendererModule.js +21 -14
- package/src/scripts/eventNotifier.js +1 -1
- package/src/scripts/organsRenderer.js +36 -30
|
@@ -58,7 +58,6 @@ RendererModule.prototype.getIntersectedObject = function(intersects) {
|
|
|
58
58
|
|
|
59
59
|
RendererModule.prototype.getAnnotationsFromObjects = function(objects) {
|
|
60
60
|
const annotations = [];
|
|
61
|
-
let count = 0;
|
|
62
61
|
for (var i = 0; i < objects.length; i++) {
|
|
63
62
|
const zincObject = objects[i].userData;
|
|
64
63
|
let annotation = undefined;
|
|
@@ -67,7 +66,7 @@ RendererModule.prototype.getAnnotationsFromObjects = function(objects) {
|
|
|
67
66
|
const glyphset = zincObject;
|
|
68
67
|
if (zincObject.isGlyph)
|
|
69
68
|
glyphset = zincObject.getGlyphset();
|
|
70
|
-
annotation = glyphset.userData ? glyphset.userData
|
|
69
|
+
annotation = glyphset.userData ? glyphset.userData.annotation : undefined;
|
|
71
70
|
if (annotation && annotation.data) {
|
|
72
71
|
if (objects[i].name && objects[i].name != "")
|
|
73
72
|
annotation.data.id = objects[i].name;
|
|
@@ -75,23 +74,28 @@ RendererModule.prototype.getAnnotationsFromObjects = function(objects) {
|
|
|
75
74
|
annotation.data.id = glyphset.groupName;
|
|
76
75
|
}
|
|
77
76
|
} else {
|
|
78
|
-
annotation = zincObject.userData ? zincObject.userData
|
|
77
|
+
annotation = zincObject.userData ? zincObject.userData.annotation : undefined;
|
|
79
78
|
if (annotation && annotation.data){
|
|
80
79
|
annotation.data.id = objects[i].name;
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
if (annotation)
|
|
85
|
-
annotations
|
|
84
|
+
annotations.push(annotation);
|
|
86
85
|
}
|
|
87
86
|
return annotations;
|
|
88
87
|
}
|
|
89
88
|
|
|
90
|
-
RendererModule.prototype.setHighlightedByObjects = function(
|
|
89
|
+
RendererModule.prototype.setHighlightedByObjects = function(
|
|
90
|
+
objects, coords, propagateChanges) {
|
|
91
91
|
const changed = this.graphicsHighlight.setHighlighted(objects);
|
|
92
|
-
if (
|
|
93
|
-
|
|
92
|
+
if (propagateChanges) {
|
|
93
|
+
eventType = require("./eventNotifier").EVENT_TYPE.MOVE;
|
|
94
|
+
if (changed)
|
|
95
|
+
eventType = require("./eventNotifier").EVENT_TYPE.HIGHLIGHTED;
|
|
94
96
|
const annotations = this.getAnnotationsFromObjects(objects);
|
|
97
|
+
if (annotations.length > 0)
|
|
98
|
+
annotations[0].coords = coords;
|
|
95
99
|
this.publishChanges(annotations, eventType);
|
|
96
100
|
}
|
|
97
101
|
return changed;
|
|
@@ -99,8 +103,8 @@ RendererModule.prototype.setHighlightedByObjects = function(objects, propagateCh
|
|
|
99
103
|
|
|
100
104
|
|
|
101
105
|
RendererModule.prototype.setHighlightedByZincObject = function(
|
|
102
|
-
zincObject, propagateChanges) {
|
|
103
|
-
return this.setHighlightedByObjects([zincObject ? zincObject.morph : undefined], propagateChanges);
|
|
106
|
+
zincObject, coords, propagateChanges) {
|
|
107
|
+
return this.setHighlightedByObjects([zincObject ? zincObject.morph : undefined], coords,propagateChanges);
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
RendererModule.prototype.setupLiveCoordinates = function(zincObjects) {
|
|
@@ -139,7 +143,7 @@ RendererModule.prototype.objectsToZincObjects = function(objects) {
|
|
|
139
143
|
|
|
140
144
|
|
|
141
145
|
RendererModule.prototype.setSelectedByObjects = function(
|
|
142
|
-
objects, propagateChanges) {
|
|
146
|
+
objects, coords, propagateChanges) {
|
|
143
147
|
const changed = this.graphicsHighlight.setSelected(objects);
|
|
144
148
|
if (changed) {
|
|
145
149
|
const zincObjects = this.objectsToZincObjects(objects);
|
|
@@ -147,6 +151,8 @@ RendererModule.prototype.setSelectedByObjects = function(
|
|
|
147
151
|
if (propagateChanges) {
|
|
148
152
|
const eventType = require("./eventNotifier").EVENT_TYPE.SELECTED;
|
|
149
153
|
const annotations = this.getAnnotationsFromObjects(objects);
|
|
154
|
+
if (annotations.length > 0)
|
|
155
|
+
annotations[0].coords = coords;
|
|
150
156
|
this.publishChanges(annotations, eventType);
|
|
151
157
|
}
|
|
152
158
|
}
|
|
@@ -154,8 +160,9 @@ RendererModule.prototype.setSelectedByObjects = function(
|
|
|
154
160
|
}
|
|
155
161
|
|
|
156
162
|
RendererModule.prototype.setSelectedByZincObject = function(
|
|
157
|
-
zincObject, propagateChanges) {
|
|
158
|
-
return this.setSelectedByObjects([zincObject ? zincObject.morph : undefined],
|
|
163
|
+
zincObject, coords, propagateChanges) {
|
|
164
|
+
return this.setSelectedByObjects([zincObject ? zincObject.morph : undefined],
|
|
165
|
+
coords, propagateChanges);
|
|
159
166
|
}
|
|
160
167
|
|
|
161
168
|
const addGlyphToArray = function(objects) {
|
|
@@ -180,12 +187,12 @@ RendererModule.prototype.findObjectsByGroupName = function(groupName) {
|
|
|
180
187
|
|
|
181
188
|
RendererModule.prototype.setHighlightedByGroupName = function(groupName, propagateChanges) {
|
|
182
189
|
const objects = this.findObjectsByGroupName(groupName);
|
|
183
|
-
return this.setHighlightedByObjects(objects, propagateChanges);
|
|
190
|
+
return this.setHighlightedByObjects(objects, undefined, propagateChanges);
|
|
184
191
|
}
|
|
185
192
|
|
|
186
193
|
RendererModule.prototype.setSelectedByGroupName = function(groupName, propagateChanges) {
|
|
187
194
|
const objects = this.findObjectsByGroupName(groupName);
|
|
188
|
-
return this.setSelectedByObjects(objects, propagateChanges);
|
|
195
|
+
return this.setSelectedByObjects(objects, undefined, propagateChanges);
|
|
189
196
|
}
|
|
190
197
|
|
|
191
198
|
RendererModule.prototype.changeBackgroundColour = function(backgroundColourString) {
|
|
@@ -90,7 +90,18 @@ const OrgansSceneData = function() {
|
|
|
90
90
|
cameraControl.resetView();
|
|
91
91
|
this.NDCCameraControl = cameraControl.enableSyncControl();
|
|
92
92
|
} else {
|
|
93
|
-
|
|
93
|
+
cameraControl.disableSyncControl();
|
|
94
|
+
this.NDCCameraControl = undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
this.isSyncControl = () => {
|
|
99
|
+
return this.NDCCameraControl !== undefined;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
this.setSyncControlZoomToBox = (box) => {
|
|
103
|
+
if (this.NDCCameraControl) {
|
|
104
|
+
this.NDCCameraControl.zoomToBox(box, 2);
|
|
94
105
|
}
|
|
95
106
|
}
|
|
96
107
|
|
|
@@ -208,18 +219,20 @@ const OrgansSceneData = function() {
|
|
|
208
219
|
return function(intersects, window_x, window_y) {
|
|
209
220
|
const intersected = _this.getIntersectedObject(intersects);
|
|
210
221
|
const idObject = getIdObjectFromIntersect(intersected);
|
|
222
|
+
const coords = { x: window_x, y: window_y };
|
|
211
223
|
if (idObject.id) {
|
|
212
|
-
if (idObject.object.userData.isGlyph) {
|
|
224
|
+
if (idObject.object.userData.isGlyph) {
|
|
213
225
|
if (idObject.object.name)
|
|
214
|
-
_this.setSelectedByObjects([idObject.object], true);
|
|
226
|
+
_this.setSelectedByObjects([idObject.object], coords, true);
|
|
215
227
|
else
|
|
216
|
-
_this.setSelectedByZincObject(idObject.object.userData.getGlyphset(),
|
|
228
|
+
_this.setSelectedByZincObject(idObject.object.userData.getGlyphset(),
|
|
229
|
+
coords, true);
|
|
217
230
|
} else {
|
|
218
|
-
_this.setSelectedByObjects([idObject.object], true);
|
|
231
|
+
_this.setSelectedByObjects([idObject.object], coords, true);
|
|
219
232
|
}
|
|
220
233
|
return;
|
|
221
234
|
} else {
|
|
222
|
-
_this.setSelectedByObjects([], true);
|
|
235
|
+
_this.setSelectedByObjects([], coords, true);
|
|
223
236
|
}
|
|
224
237
|
}
|
|
225
238
|
};
|
|
@@ -233,14 +246,15 @@ const OrgansSceneData = function() {
|
|
|
233
246
|
return function(intersects, window_x, window_y) {
|
|
234
247
|
const intersected = _this.getIntersectedObject(intersects);
|
|
235
248
|
const idObject = getIdObjectFromIntersect(intersected);
|
|
249
|
+
const coords = { x: window_x, y: window_y };
|
|
236
250
|
if (idObject.id) {
|
|
237
251
|
_this.displayArea.style.cursor = "pointer";
|
|
238
|
-
_this.setHighlightedByObjects([idObject.object], true);
|
|
252
|
+
_this.setHighlightedByObjects([idObject.object], coords, true);
|
|
239
253
|
return;
|
|
240
254
|
}
|
|
241
255
|
else {
|
|
242
256
|
_this.displayArea.style.cursor = "auto";
|
|
243
|
-
_this.setHighlightedByObjects([], true);
|
|
257
|
+
_this.setHighlightedByObjects([], coords, true);
|
|
244
258
|
}
|
|
245
259
|
}
|
|
246
260
|
};
|
|
@@ -335,37 +349,29 @@ const OrgansSceneData = function() {
|
|
|
335
349
|
}
|
|
336
350
|
|
|
337
351
|
const addOrganPartToSceneData = function(zincObject) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
} else if (zincObject.isLines) {
|
|
348
|
-
if (!_this.sceneData.lines.includes(zincObject.groupName)) {
|
|
349
|
-
_this.sceneData.lines.push(zincObject.groupName);
|
|
350
|
-
}
|
|
351
|
-
} else if (zincObject.isPointset) {
|
|
352
|
-
if (!_this.sceneData.pointsets.includes(zincObject.groupName)) {
|
|
353
|
-
_this.sceneData.pointsets.push(zincObject.groupName);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
352
|
+
if (zincObject.isGeometry) {
|
|
353
|
+
_this.sceneData.geometries.push(zincObject);
|
|
354
|
+
} else if (zincObject.isGlyphset) {
|
|
355
|
+
_this.sceneData.glyphsets.push(zincObject);
|
|
356
|
+
} else if (zincObject.isLines) {
|
|
357
|
+
_this.sceneData.lines.push(zincObject);
|
|
358
|
+
} else if (zincObject.isPointset) {
|
|
359
|
+
_this.sceneData.pointsets.push(zincObject);
|
|
360
|
+
}
|
|
357
361
|
}
|
|
358
362
|
|
|
359
363
|
const addOrganPart = function(systemName, partName, useDefautColour, zincObject) {
|
|
360
364
|
for (let i = 0; i < organPartAddedCallbacks.length;i++) {
|
|
361
|
-
organPartAddedCallbacks[i](zincObject
|
|
365
|
+
organPartAddedCallbacks[i](zincObject, _this.scene.isTimeVarying());
|
|
362
366
|
}
|
|
363
367
|
if (useDefautColour)
|
|
364
368
|
modelsLoader.setGeometryColour(zincObject, systemName, partName);
|
|
365
369
|
addOrganPartToSceneData(zincObject);
|
|
366
370
|
const annotation = new (require('./annotation').annotation)();
|
|
367
|
-
|
|
368
|
-
|
|
371
|
+
const region = zincObject.region.getFullPath();
|
|
372
|
+
annotation.data = {species:_this.sceneData.currentSpecies, system:systemName,
|
|
373
|
+
part:partName, group:zincObject.groupName, region: region};
|
|
374
|
+
zincObject.userData["annotation"] = annotation;
|
|
369
375
|
}
|
|
370
376
|
|
|
371
377
|
/**
|