@abi-software/scaffoldvuer 1.11.0-demo.3 → 1.11.1

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.
@@ -4,6 +4,7 @@ const THREE = Zinc.THREE;
4
4
  import { BaseModule } from './BaseModule';
5
5
  import { EVENT_TYPE } from "./EventNotifier";
6
6
  import GraphicsHighlight from "./GraphicsHighlight";
7
+ import { objectsToZincObjects } from "./Utilities";
7
8
 
8
9
  /**
9
10
  * Create a {@link Zinc.Renderer} on the dom element with corresponding elementID.
@@ -112,8 +113,8 @@ RendererModule.prototype.getAnnotationsFromObjects = function(objects) {
112
113
 
113
114
  RendererModule.prototype.setHighlightedByObjects = function(
114
115
  objects, coords, extraData, propagateChanges) {
116
+ const zincObjects = objectsToZincObjects(objects);
115
117
  const changed = this.graphicsHighlight.setHighlighted(objects);
116
- const zincObjects = this.objectsToZincObjects(objects);
117
118
  if (propagateChanges) {
118
119
  let eventType = EVENT_TYPE.MOVE;
119
120
  if (changed)
@@ -162,24 +163,6 @@ RendererModule.prototype.setupLiveCoordinates = function(zincObjects) {
162
163
  }
163
164
  }
164
165
 
165
- RendererModule.prototype.objectsToZincObjects = function(objects) {
166
- const zincObjects = [];
167
- for (let i = 0; i < objects.length; i++) {
168
- let zincObject = objects[i].userData;
169
- if (zincObject) {
170
- if (zincObject.isGlyph || zincObject.isGlyphset) {
171
- let glyphset = zincObject;
172
- if (zincObject.isGlyph)
173
- glyphset = zincObject.getGlyphset();
174
- zincObjects.push(glyphset);
175
- } else {
176
- zincObjects.push(zincObject);
177
- }
178
- }
179
- }
180
- return zincObjects;
181
- }
182
-
183
166
 
184
167
  RendererModule.prototype.setSelectedByObjects = function(
185
168
  objects, coords, extraData, propagateChanges) {
@@ -190,7 +173,7 @@ RendererModule.prototype.setSelectedByObjects = function(
190
173
  changed = true;
191
174
  }
192
175
  if (changed || this.ignorePreviousSelected) {
193
- const zincObjects = this.objectsToZincObjects(objects);
176
+ const zincObjects = objectsToZincObjects(objects);
194
177
  if (this.selectObjectOnPick) {
195
178
  this.setupLiveCoordinates(zincObjects);
196
179
  }
@@ -1,5 +1,15 @@
1
1
  import { Label, THREE } from 'zincjs';
2
2
 
3
+ // This will be the config for nerves selection and highlight
4
+ export const NERVE_CONFIG = {
5
+ SELECTED_COLOUR: '#00ff00',
6
+ HIGHLIGHTED_COLOUR: '#ff0000',
7
+ DEFAULT_RADIUS: 1,
8
+ DEFAULT_RADIAL_SEGMENTS: 8,
9
+ ZOOM_RADIUS: 5,
10
+ ZOOM_RADIAL_SEGMENTS: 12,
11
+ }
12
+
3
13
  export const createListFromPrimitives = (primitives, list) => {
4
14
  if (primitives) {
5
15
  let id = "";
@@ -409,3 +419,20 @@ export const annotationFeaturesToPrimitives = (scene, features) => {
409
419
  }
410
420
  }
411
421
 
422
+ export const objectsToZincObjects = function(objects) {
423
+ const zincObjects = [];
424
+ for (let i = 0; i < objects.length; i++) {
425
+ let zincObject = objects[i].userData;
426
+ if (zincObject) {
427
+ if (zincObject.isGlyph || zincObject.isGlyphset) {
428
+ let glyphset = zincObject;
429
+ if (zincObject.isGlyph)
430
+ glyphset = zincObject.getGlyphset();
431
+ zincObjects.push(glyphset);
432
+ } else {
433
+ zincObjects.push(zincObject);
434
+ }
435
+ }
436
+ }
437
+ return zincObjects;
438
+ }