SDK3DVerse_MPR_Ext

Override the current viewport layout with a MPR layout. Provide sagittal, coronal, and axial views with interactive spatial planes.

This extension require the following extension installed:

  • SDK3DVerse_ThreeJS_Ext

Methods

getViewportConfig()

Returns the current configuration of the viewports

(async) installExtension(options)

Example
defaultViewportConfig: [
    {
        name  : 'axial',
        id    : 1,
        defaultTransform     : {
            position        : [ 0.0, 0.0, 0.0 ],
            eulerOrientation: [ 90, 0, 0 ],
            scale           : [ 1.0, 1.0, 1.0 ]
        },
        defaultCameraValues  : {
            renderGraphRef: MPR_RENDER_GRAPH
        },
        disableThreeJSMeshes     : true,
        disableViewportDomOverlay: false
    },
    {
        name  : 'volume',
        id    : 2,
        defaultTransform            : {
            position   : [ 0.0, 0.0, 5.0 ],
            orientation: [ 0.0, 0.0, 0.0, 1.0 ],
            scale      : [ 1.0, 1.0, 1.0 ]
        },
        defaultCameraValues         : this.sdk.utils.clone(this.cameraAPI.defaultCameraTemplate.camera),
        defaultPerspectiveLensValues: {
            fovy     : 60,
            nearPlane: 0.01,
            farPlane : 0
        },
        disableThreeJSMeshes     : false,
        disableViewportDomOverlay: false
    },
    {
        name  : 'sagittal',
        id    : 3,
        defaultTransform     : {
            position        : [ 0.0, 0.0, 0.0 ],
            eulerOrientation: [ 0, 90, 0 ],
            scale           : [ 1.0, 1.0, 1.0 ]
        },
        defaultCameraValues  : {
            renderGraphRef: MPR_RENDER_GRAPH
        },
        defaultControllerType: 2,
        isOrthographic       : true,
        // Non sdk props (used by others extensions)
        disableThreeJSMeshes     : true,
        disableViewportDomOverlay: false
    },
    {
        name  : 'coronal',
        id    : 4,
        defaultTransform     : {
            position        : [ 0.0, 0.0, 0.0 ],
            eulerOrientation: [ 0, 0, 0 ],
            scale           : [ 1.0, 1.0, 1.0 ]
        },
        defaultCameraValues  : {
            renderGraphRef: MPR_RENDER_GRAPH
        },
        disableThreeJSMeshes     : true,
        disableViewportDomOverlay: false
    }
]
Parameters:
Name Type Description
options Object

Default: {viewportConfig: []}

Properties
Name Type Attributes Default Description
viewportConfig Array.<Object> <optional>
defaultViewportConfig

An object defining the viewport config where the viewport is identified by the viewportConfig.name property. See upper example for defaultViewportConfig.

Properties
Name Type Description
name String

The viewport config name to alter ('axial', 'sagittal', 'coronal', 'volume')

defaultTransform Object

local_transform component

defaultCameraValues Object

camera component

defaultPerspectiveLensValues Object

Only for viewport.id = 2. Set perspective_lens component values:
{ fovy:number, nearPlane:number, farPlane:number }

disableThreeJSMeshes Boolean

See SDK3DVerse_MPR_Ext#toggleThreeJsExtensionRendering

disableViewportDomOverlay Boolean

See SDK3DVerse_MPR_Ext#toggleViewportDomOverlayRendering

toggleThreeJsExtensionRendering(viewportNamesopt, draw)

Toggle the rendering of the ThreeJS extension per viewport e.g the display of:

  • the measures shapes (SDK3DVerse_Measures_Ext)
  • the orthographic cutting planes (SDK3DVerse_MPR_Ext)
  • the sprites (SDK3DVerse_Sprites_Ext)
  • the splines (SDK3DVerse_SplineDisplay_Ext)
  • the geometry gizmos of the geometry cutters (SDK3DVerse_GeometryGizmos_Ext)
Parameters:
Name Type Attributes Default Description
viewportNames Array.<String> <optional>
['volume']

The names of the viewports to affect.

draw Boolean

Default: toggle current draw value.

(async) toggleViewport(requestedViewport)

Set to fullscreen or minify a viewport.

Parameters:
Name Type Description
requestedViewport SDK3DVerse_Viewport

The requested viewport

toggleViewportDomOverlayRendering(viewportNamesopt, draw)

Toggle the rendering of the ViewportDomOverlay extension per viewport e.g:

  • the display of the measures text labels (SDK3DVerse_Measures_Ext)
  • the display of the regular labels (SDK3DVerse_Label_Ext)
  • enable/disable the handlers to interact with the splines (SDK3DVerse_SplineDisplay_Ext
  • enable/disable the handlers to interact with the gizmos of the geometry cutters (SDK3DVerse_GeometryGizmos_Ext)
Parameters:
Name Type Attributes Default Description
viewportNames Array.<String> <optional>
['volume']

The names of the viewports to affect.

draw Boolean

Default: toggle current draw value.