Skip to content

Cursor3D

Introduction

vtkCursor3D is an object that generates a 3D representation of a cursor. The cursor consists of a wireframe bounding box, three intersecting axes lines that meet at the cursor focus, and "shadows" or projections of the axes against the sides of the bounding box. Each of these components can be turned on/off.

Usage

js
import vtkCursor3D from '@kitware/vtk.js/Filters/Sources/vtkCursor3D';

const cursor = vtkCursor3D.newInstance({focalPoint: [0, 0, 0], modelBounds: [-100, 100, -100, 100, -100, 100]});
const polyData = cursor.getOutputData();

Methods

allOff

Turn every part of the 3D cursor off.

allOn

Turn every part of the 3D cursor on.

extend

Method used to decorate a given object (publicAPI+model) with vtkCursor3D characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesICursor3DInitialValuesNo(default: {})

getAxes

getFocalPoint

Get the position of cursor focus.

getFocalPointByReference

getFocus

getModelBounds

Set the boundary of the 3D cursor.

getModelBoundsByReference

getOutline

getTranslationMode

Get the translation mode.

getWrap

Get the state of the cursor wrapping.

getXShadows

Get the state of the wireframe x-shadows.

getYShadows

Get the state of the wireframe y-shadows.

getZShadows

Get the state of the wireframe z-shadows.

newInstance

Method used to create a new instance of vtkCursor3D.

ArgumentTypeRequiredDescription
initialValuesICursor3DInitialValuesNofor pre-setting some of its content

requestData

Expose methods

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setAll

ArgumentTypeRequiredDescription
flagBooleanYes

setAxes

Turn on/off the wireframe axes.

ArgumentTypeRequiredDescription
axesBooleanYes

setFocalPoint

Set the position of cursor focus. If translation mode is on, then the entire cursor (including bounding box, cursor, and shadows) is translated. Otherwise, the focal point will either be clamped to the bounding box, or wrapped, if Wrap is on. (Note: this behavior requires that the bounding box is set prior to the focal point.)

ArgumentTypeRequiredDescription
pointsVector3Yes

setModelBounds

Set the boundary of the 3D cursor.

ArgumentTypeRequiredDescription
boundsBoundsYesThe bounds of the 3D cursor.

setTranslationMode

Enable/disable the translation mode. If on, changes in cursor position cause the entire widget to translate along with the cursor.

ArgumentTypeRequiredDescription
translationModeBooleanYes

setWrap

Turn on/off cursor wrapping. If the cursor focus moves outside the specified bounds, the cursor will either be restrained against the nearest "wall" (Wrap=off), or it will wrap around (Wrap=on).

ArgumentTypeRequiredDescription
wrapNumberYes

setXShadows

Turn on/off the wireframe x-shadows.

ArgumentTypeRequiredDescription
xLengthNumberYes

setYShadows

Turn on/off the wireframe y-shadows.

ArgumentTypeRequiredDescription
yLengthNumberYes

setZShadows

Turn on/off the wireframe z-shadows.

ArgumentTypeRequiredDescription
zLengthNumberYes