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...
Name | Type | Description |
---|---|---|
containerDiv | object | The associated HTML div. |
- Source
Methods
addDrawLayer() → {object}
Add a draw layer.
- Source
The created layer.
- Type:
- object
addEventListener(type, callback)
Add an event listener to this class.
Name | Type | Description |
---|---|---|
type | string | The event type. |
callback | object | The method associated with the provided event type, will be called with the fired event. |
- Source
addScale(scaleStep, center)
Add scale to the layers. Scale cannot go lower than 0.1.
Name | Type | Description |
---|---|---|
scaleStep | number | The scale to add. |
center | dwv. | The scale center Point3D. |
- Source
addTranslation(translation)
Add translation to the layers.
Name | Type | Description |
---|---|---|
translation | object | The translation as {x,y,z}. |
- Source
addViewLayer() → {object}
Add a view layer.
- Source
The created layer.
- Type:
- object
calculateFitScale() → {number|undefined}
Calculate the fit scale: the scale that fits the largest data.
- Source
The fit scale.
- Type:
- number |
undefined
display(flag)
Display the layer.
Name | Type | Description |
---|---|---|
flag | boolean | Whether to display the layer or not. |
- Source
draw()
Draw the layer.
- Source
empty()
Empty the layer list.
- Source
flipScaleZ()
Flip all layers along the Z axis without offset compensation.
- Source
getActiveDrawLayer() → {object}
Get the active draw layer.
- Source
The layer.
- Type:
- object
getActiveViewLayer() → {object}
Get the active image layer.
- Source
The layer.
- Type:
- object
getAddedScale() → {object}
Get the added scale: the scale added to the base scale
- Source
The scale as {x,y,z}.
- Type:
- object
getBaseScale() → {object}
Get the base scale.
- Source
The scale as {x,y,z}.
- Type:
- object
getDivId() → {string}
Get the Id of the container div.
- Source
The id of the div.
- Type:
- string
getDrawLayersByDataIndex(index) → {Array}
Get the draw layers associated to a data index.
Name | Type | Description |
---|---|---|
index | number | The data index. |
- Source
The layers.
- Type:
- Array
getMaxSize() → {object|undefined}
Get the largest data size.
- Source
The largest size as {x,y}.
- Type:
- object |
undefined
getNumberOfLayers() → {number}
Get the number of layers handled by this class.
- Source
The number of layers.
- Type:
- number
getOffset() → {object}
Get the layer offset.
- Source
The offset as {x,y,z}.
- Type:
- object
getScale() → {object}
Get the layer scale.
- Source
The scale as {x,y,z}.
- Type:
- object
getShowCrosshair() → {boolean}
Get the showCrosshair flag.
- Source
True to display the crosshair.
- Type:
- boolean
getTargetOrientation() → {dwv.math.Matrix33}
Get the target orientation.
- Source
The orientation matrix.
- Type:
- dwv.
math. Matrix33
getViewDataIndices() → {Array}
Get the view layers data indices.
- Source
The list of indices.
- Type:
- Array
getViewLayersByDataIndex(index) → {Array}
Get the view layers associated to a data index.
Name | Type | Description |
---|---|---|
index | number | The data index. |
- Source
The layers.
- Type:
- Array
removeEventListener(type, callback)
Remove an event listener from this class.
Name | Type | Description |
---|---|---|
type | string | The event type. |
callback | object | The method associated with the provided event type. |
- Source
reset()
Reset the stage to its initial scale and no offset.
- Source
searchViewLayers(meta) → {Array}
Search view layers for equal imae meta data.
Name | Type | Description |
---|---|---|
meta | object | The meta data to find. |
- Source
The list of view layers that contain matched data.
- Type:
- Array
setActiveDrawLayer(index)
Set the active draw layer.
Name | Type | Description |
---|---|---|
index | number | The index of the layer to set as active. |
- Source
setActiveDrawLayerByDataIndex(index)
Set the active draw layer with a data index.
Name | Type | Description |
---|---|---|
index | number | The data index. |
- Source
setActiveViewLayer(index)
Set the active view layer.
Name | Type | Description |
---|---|---|
index | number | The index of the layer to set as active. |
- Source
setActiveViewLayerByDataIndex(index)
Set the active view layer with a data index.
Name | Type | Description |
---|---|---|
index | number | The data index. |
- Source
setFitScale(scaleIn)
Set the layer group fit scale.
Name | Type | Description |
---|---|---|
scaleIn | number | The fit scale. |
- Source
setOffset(newOffset)
Set the layers' offset.
Name | Type | Description |
---|---|---|
newOffset | object | The offset as {x,y,z}. |
- Source
setScale(newScale, center)
Set the layers' scale.
Name | Type | Description |
---|---|---|
newScale | object | The scale to apply as {x,y,z}. |
center | dwv. | The scale center Point3D. |
- Source
setShowCrosshair(flag)
Set the showCrosshair flag.
Name | Type | Description |
---|---|---|
flag | boolean | True to display the crosshair. |
- Source
setTargetOrientation(orientation)
Set the target orientation.
Name | Type | Description |
---|---|---|
orientation | dwv. | The orientation matrix. |
- Source
updateLayersToPositionChange(event)
Update layers (but not the active view layer) to a position change.
Name | Type | Description |
---|---|---|
event | object | The position change event. |
- Source
(inner) bindDrawLayer(drawLayer)
Bind draw layer events to this.
Name | Type | Description |
---|---|---|
drawLayer | object | The draw layer to bind. |
- Source
(inner) bindViewLayer(viewLayer)
Bind view layer events to this.
Name | Type | Description |
---|---|---|
viewLayer | object | The view layer to bind. |
- Source
(inner) getNextLayerDiv() → {HTMLElement}
Get the next layer DOM div.
- Source
A DOM div.
- Type:
- HTMLElement
(inner) removeCrosshairDiv()
Remove crosshair divs.
- Source
(inner) showCrosshairDiv(position)
Show a crosshair at a given position.
Name | Type | Description |
---|---|---|
position | dwv. | The position where to show the crosshair. |
- Source
(inner) updateCrosshairOnChange()
Update crosshair on offset or zoom change.
- Source