ArrowSource
Introduction
vtkArrowSource was intended to be used as the source for a glyph. The shaft base is always at (0,0,0). The arrow tip is always at (1,0,0). If "Invert" is true, then the ends are flipped i.e. tip is at (0,0,0) while base is at (1, 0, 0). The resolution of the cone and shaft can be set and default to 6. The radius of the cone and shaft can be set and default to 0.03 and 0.1. The length of the tip can also be set, and defaults to 0.35.
Usage
import vtkArrowSource from '@kitware/vtk.js/Filters/Sources/ArrowSource';
const arrow = vtkArrowSource.newInstance({
tipResolution: 6,
tipRadius: 0.1,
tipLength: 0.35,
shaftResolution: 6,
shaftRadius: 0.03,
invert: false,
direction: [1.0, 0.0, 0.0]});
const polydata = arrow.getOutputData();Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkArrowSource 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 | IArrowSourceInitialValues | No | (default: {}) |
getDirection
Get the orientation vector of the cone.
getDirectionByReference
Get the orientation vector of the cone.
getInvert
getShaftRadius
Get the resolution of the shaft.
getShaftResolution
Get the resolution of the shaft.
getTipLength
Get the length of the tip.
getTipRadius
Get the radius of the tip.
getTipResolution
Get the resolution of the tip.
newInstance
Method used to create a new instance of vtkArrowSource.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IArrowSourceInitialValues | No | for pre-setting some of its content |
requestData
Expose methods
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setDirection
Set the direction for the arrow.
| Argument | Type | Required | Description |
|---|---|---|---|
direction | Vector3 | Yes | The direction coordinates. |
setDirection
Set the direction for the arrow.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setDirectionFrom
Set the direction for the arrow.
| Argument | Type | Required | Description |
|---|---|---|---|
direction | Vector3 | Yes | The direction coordinates. |
setInvert
Inverts the arrow direction. When set to true, base is at [1, 0, 0] while the tip is at [0, 0, 0].
| Argument | Type | Required | Description |
|---|---|---|---|
invert | Booolean | Yes |
setShaftRadius
Set the radius of the shaft.
| Argument | Type | Required | Description |
|---|---|---|---|
shaftRadius | Number | Yes |
setShaftResolution
Set the resolution of the shaft.
| Argument | Type | Required | Description |
|---|---|---|---|
shaftResolution | Number | Yes |
setTipLength
Set the length of the tip.
| Argument | Type | Required | Description |
|---|---|---|---|
tipLength | Number | Yes |
setTipRadius
Set the radius of the tip.
| Argument | Type | Required | Description |
|---|---|---|---|
tipRadius | Number | Yes |
setTipResolution
Set the resolution of the tip.
| Argument | Type | Required | Description |
|---|---|---|---|
tipResolution | Number | Yes |