Skip to content

VTKScene

Michael Keilman edited this page Jul 20, 2022 · 2 revisions

in progress

Class: VTKScene

VTKScene(container, resetSide)

This class encapsulates various basic vtk elements such as the renderer, and supplies methods for using them.

Constructor

new VTKScene(container, resetSide)

Parameters:
Name Type Description
container Object jquery element in which to place the scene
resetSide string the dimension to display facing the user when the scene is reset

Source:

Classes

CAM_DEFAULTS

Methods

addActor(actor)

Convenience method for adding an actor to the renderer

Parameters:
Name Type Description
actor vtk.Rendering.Core.vtkActor

Source:

directionIcon() → {string}

Gets an icon based on the view direction ("into/out of the screen")

Source:

Returns:

Type
string

hasMarker() → {boolean}

Source:

Returns:

- true if an orientation marker has been defined

Type
boolean

refreshMarker(doRender)

Refreshes the visibility of the orientation marker, if one exists

Parameters:
Name Type Default Description
doRender true if true, perform a render

Source:

removeActor(actor)

Convenience method for removing the given actor from the renderer

Parameters:
Name Type Description
actor vtk.Rendering.Core.vtkActor

Source:

removeActors(actors)

Convenience method for removing the given actors from the renderer, or all actors if input is null/empty

Parameters:
Name Type Description
actors Array.<vtk.Rendering.Core.vtkActor> | null

Source:

render()

Convenience method for triggering a render in the render window

Source:

resetView()

Sets the camera so that the resetSide is facing the user

Source:

sceneBoundingBox(padPct) → {BoxBundle}

Builds a wireframe box around all the objects in the scene, with optional padding

Parameters:
Name Type Default Description
padPct number 0 additional padding as a percentage of the size

Source:

Returns:

Type
BoxBundle

setBgColor(color)

Sets the background color of the renderer

Parameters:
Name Type Description
color string | Array.<number>

Source:

setCam(position, viewUp)

Sets the camera to the given position, pointing such that "up" is in the given direction

Parameters:
Name Type Description
position Array.<number>
viewUp Array.<number>

Source:

setCamProperty(dim, name, val)

Sets a property for the camera along the given dimension

Parameters:
Name Type Description
dim string x|y|z
name string
val *

Source:

setMarker(m)

Sets an orientation marker

Parameters:
Name Type Description
m vtk.Interaction.Widgets.vtkOrientationMarkerWidget

Source:

showSide(side, direction)

Sets the camera so that the given side is facing the user. If that side is already set, flip to the other side

Parameters:
Name Type Default Description
side string x|y|z
direction number 0 -1|0|1

Source:

teardown()

Cleans up vtk items

Source:

Clone this wiki locally