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
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.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | ICursor3DInitialValues | No | (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.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ICursor3DInitialValues | No | for pre-setting some of its content |
requestData
Expose methods
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setAll
| Argument | Type | Required | Description |
|---|---|---|---|
flag | Boolean | Yes |
setAxes
Turn on/off the wireframe axes.
| Argument | Type | Required | Description |
|---|---|---|---|
axes | Boolean | Yes |
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.)
| Argument | Type | Required | Description |
|---|---|---|---|
points | Vector3 | Yes |
setModelBounds
Set the boundary of the 3D cursor.
| Argument | Type | Required | Description |
|---|---|---|---|
bounds | Bounds | Yes | The 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.
| Argument | Type | Required | Description |
|---|---|---|---|
translationMode | Boolean | Yes |
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).
| Argument | Type | Required | Description |
|---|---|---|---|
wrap | Number | Yes |
setXShadows
Turn on/off the wireframe x-shadows.
| Argument | Type | Required | Description |
|---|---|---|---|
xLength | Number | Yes |
setYShadows
Turn on/off the wireframe y-shadows.
| Argument | Type | Required | Description |
|---|---|---|---|
yLength | Number | Yes |
setZShadows
Turn on/off the wireframe z-shadows.
| Argument | Type | Required | Description |
|---|---|---|---|
zLength | Number | Yes |