Skip to content

VTKUtils

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

subject to change - please see the latest code

VTKUtils

Collection of static methods

Constructor

new VTKUtils()

Source:

Methods

(static) interactionMode() → {Object}

Modes when interacting with the vtk canvas

Source:

Returns:

- interactionModes

Type
Object

(static) buildBoundingBox(bounds, padPct) → {BoxBundle}

Builds a wireframe box with the specified bounds and optional padding

Parameters:
Name Type Default Description
bounds Array.<number> the bounds in the format [xMin, xMax, yMin, yMax, zMin, zMax]
padPct number 0 additional padding as a percentage of the size

Source:

Returns:

Type
BoxBundle

(static) buildOrientationMarker(actor, interactor, location) → {vtk.Interaction.Widgets.vtkOrientationMarkerWidget}

Makes an orientation widget out of the given vtk actor and interactor, placed in the given corner of the viewport

Parameters:
Name Type Description
actor vtk.Rendering.Core.vtkActor vtk actor
interactor vtk.Rendering.Core.vtkRenderWindowInteractor interactor from a render window
location vtk.Interaction.Widgets.vtkOrientationMarkerWidget.Corners which corner to place the widget

Source:

Returns:

Type
vtk.Interaction.Widgets.vtkOrientationMarkerWidget

(static) colorToFloat(hexStringOrArray) → {Array.<number>}

Converts a string or an array of floats to an array of floats using vtk's conversion util, for use in colors

Parameters:
Name Type Description
hexStringOrArray string | Array.<number> a color string (#rrggbb) or array of floats

Source:

Returns:

- array of floats ranging from 0 - 1.

Type
Array.<number>

(static) colorToHex(hexStringOrArray) → {string}

Converts a string or an array of floats to a string using vtk's conversion util, for use in colors

Parameters:
Name Type Description
hexStringOrArray string | Array.<number> a color string (#rrggbb) or array of floats

Source:

Returns:

- a color string (#rrggbb)

Type
string

(static) userMatrix(matrix) → {Array.<Array.<number>>}

Creates a vtk user matrix from a SquareMatrix.

Parameters:
Name Type Description
matrix SquareMatrix vtk actor

Source:

Returns:

Type
Array.<Array.<number>>

Clone this wiki locally