dwv.gui. LayerGroup

new LayerGroup(containerDiv)

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...

Parameters:
NameTypeDescription
containerDivobject

The associated HTML div.

Methods

addDrawLayer() → {object}

Add a draw layer.

Returns:

The created layer.

Type: 
object

addEventListener(type, callback)

Add an event listener to this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackobject

The method 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.

centerdwv.math.Point3D

The scale center Point3D.

addTranslation(translation)

Add translation to the layers.

Parameters:
NameTypeDescription
translationobject

The translation as {x,y,z}.

addViewLayer() → {object}

Add a view layer.

Returns:

The created layer.

Type: 
object

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() → {object}

Get the active draw layer.

Returns:

The layer.

Type: 
object

getActiveViewLayer() → {object}

Get the active image layer.

Returns:

The layer.

Type: 
object

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}

Get the draw layers associated to a data index.

Parameters:
NameTypeDescription
indexnumber

The data index.

Returns:

The layers.

Type: 
Array

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() → {dwv.math.Matrix33}

Get the target orientation.

Returns:

The orientation matrix.

Type: 
dwv.math.Matrix33

getViewDataIndices() → {Array}

Get the view layers data indices.

Returns:

The list of indices.

Type: 
Array

getViewLayersByDataIndex(index) → {Array}

Get the view layers associated to a data index.

Parameters:
NameTypeDescription
indexnumber

The data index.

Returns:

The layers.

Type: 
Array

removeEventListener(type, callback)

Remove an event listener from this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackobject

The method associated with the provided event type.

reset()

Reset the stage to its initial scale and no offset.

searchViewLayers(meta) → {Array}

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

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, center)

Set the layers' scale.

Parameters:
NameTypeDescription
newScaleobject

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

centerdwv.math.Point3D

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
orientationdwv.math.Matrix33

The orientation matrix.

updateLayersToPositionChange(event)

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

Parameters:
NameTypeDescription
eventobject

The position change event.

(inner) bindDrawLayer(drawLayer)

Bind draw layer events to this.

Parameters:
NameTypeDescription
drawLayerobject

The draw layer to bind.

(inner) bindViewLayer(viewLayer)

Bind view layer events to this.

Parameters:
NameTypeDescription
viewLayerobject

The view layer to bind.

(inner) getNextLayerDiv() → {HTMLElement}

Get the next layer DOM div.

Returns:

A DOM div.

Type: 
HTMLElement

(inner) removeCrosshairDiv()

Remove crosshair divs.

(inner) showCrosshairDiv(position)

Show a crosshair at a given position.

Parameters:
NameTypeDescription
positiondwv.math.Point

The position where to show the crosshair.

(inner) updateCrosshairOnChange()

Update crosshair on offset or zoom change.