LayerGroup

Layer group.

Display position: {x,y} Plane position: Index (access: get(i)) (world) Position: Point3D (access: getX, getY, getZ)

Display -> World: planePos = viewLayer.displayToPlanePos(displayPos) -> compensate for layer scale and offset pos = viewController.getPositionFromPlanePoint(planePos)

World -> display planePos = viewController.getOffset3DFromPlaneOffset(pos) no need yet for a planePos to displayPos...

Constructor

new LayerGroup(containerDiv)

Parameters:
NameTypeDescription
containerDivHTMLElement

The associated HTML div.

Classes

LayerGroup

Methods

addDrawLayer() → {DrawLayer}

Add a draw layer.

Returns:

The created layer.

Type: 
DrawLayer

addEventListener(type, callback)

Add an event listener to this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackfunction

The function associated with the provided event type, will be called with the fired event.

addScale(scaleStep, center)

Add scale to the layers. Scale cannot go lower than 0.1.

Parameters:
NameTypeDescription
scaleStepnumber

The scale to add.

centerPoint3D

The scale center Point3D.

addTranslation(translation)

Add translation to the layers.

Parameters:
NameTypeDescription
translationobject

The translation as {x,y,z}.

addViewLayer() → {ViewLayer}

Add a view layer.

Returns:

The created layer.

Type: 
ViewLayer

calculateFitScale() → {number|undefined}

Calculate the fit scale: the scale that fits the largest data.

Returns:

The fit scale.

Type: 
number | undefined

display(flag)

Display the layer.

Parameters:
NameTypeDescription
flagboolean

Whether to display the layer or not.

draw()

Draw the layer.

empty()

Empty the layer list.

flipScaleZ()

Flip all layers along the Z axis without offset compensation.

getActiveDrawLayer() → {DrawLayer}

Get the active draw layer.

Returns:

The layer.

Type: 
DrawLayer

getActiveViewLayer() → {ViewLayer}

Get the active image layer.

Returns:

The layer.

Type: 
ViewLayer

getAddedScale() → {object}

Get the added scale: the scale added to the base scale

Returns:

The scale as {x,y,z}.

Type: 
object

getBaseScale() → {object}

Get the base scale.

Returns:

The scale as {x,y,z}.

Type: 
object

getDivId() → {string}

Get the Id of the container div.

Returns:

The id of the div.

Type: 
string

getDrawLayersByDataIndex(index) → {Array.<DrawLayer>}

Get the draw layers associated to a data index.

Parameters:
NameTypeDescription
indexnumber

The data index.

Returns:

The layers.

Type: 
Array.<DrawLayer>

getMaxSize() → {object|undefined}

Get the largest data size.

Returns:

The largest size as {x,y}.

Type: 
object | undefined

getNumberOfLayers() → {number}

Get the number of layers handled by this class.

Returns:

The number of layers.

Type: 
number

getOffset() → {object}

Get the layer offset.

Returns:

The offset as {x,y,z}.

Type: 
object

getScale() → {object}

Get the layer scale.

Returns:

The scale as {x,y,z}.

Type: 
object

getShowCrosshair() → {boolean}

Get the showCrosshair flag.

Returns:

True to display the crosshair.

Type: 
boolean

getTargetOrientation() → {Matrix33}

Get the target orientation.

Returns:

The orientation matrix.

Type: 
Matrix33

getViewDataIndices() → {Array}

Get the view layers data indices.

Returns:

The list of indices.

Type: 
Array

getViewLayersByDataIndex(index) → {Array.<ViewLayer>}

Get the view layers associated to a data index.

Parameters:
NameTypeDescription
indexnumber

The data index.

Returns:

The layers.

Type: 
Array.<ViewLayer>

removeEventListener(type, callback)

Remove an event listener from this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackfunction

The function associated with the provided event type.

reset()

Reset the stage to its initial scale and no offset.

searchViewLayers(meta) → {Array.<ViewLayer>}

Search view layers for equal imae meta data.

Parameters:
NameTypeDescription
metaobject

The meta data to find.

Returns:

The list of view layers that contain matched data.

Type: 
Array.<ViewLayer>

setActiveDrawLayer(index)

Set the active draw layer.

Parameters:
NameTypeDescription
indexnumber

The index of the layer to set as active.

setActiveDrawLayerByDataIndex(index)

Set the active draw layer with a data index.

Parameters:
NameTypeDescription
indexnumber

The data index.

setActiveViewLayer(index)

Set the active view layer.

Parameters:
NameTypeDescription
indexnumber

The index of the layer to set as active.

setActiveViewLayerByDataIndex(index)

Set the active view layer with a data index.

Parameters:
NameTypeDescription
indexnumber

The data index.

setFitScale(scaleIn)

Set the layer group fit scale.

Parameters:
NameTypeDescription
scaleInnumber

The fit scale.

setOffset(newOffset)

Set the layers' offset.

Parameters:
NameTypeDescription
newOffsetobject

The offset as {x,y,z}.

setScale(newScale, centeropt)

Set the layers' scale.

Parameters:
NameTypeAttributesDescription
newScaleobject

The scale to apply as {x,y,z}.

centerPoint3D<optional>

The scale center Point3D.

setShowCrosshair(flag)

Set the showCrosshair flag.

Parameters:
NameTypeDescription
flagboolean

True to display the crosshair.

setTargetOrientation(orientation)

Set the target orientation.

Parameters:
NameTypeDescription
orientationMatrix33

The orientation matrix.

updateLayersToPositionChange(event)

Update layers (but not the active view layer) to a position change.

Parameters:
NameTypeDescription
eventobject

The position change event.

Events

offsetchange

Offset change event.

Type:
  • object
Properties
NameTypeDescription
valueArray

The changed value.

zoomchange

Zoom change event.

Type:
  • object
Properties
NameTypeDescription
valueArray

The changed value.