Skip to content

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

js
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.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIArrowSourceInitialValuesNo(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.

ArgumentTypeRequiredDescription
initialValuesIArrowSourceInitialValuesNofor pre-setting some of its content

requestData

Expose methods

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setDirection

Set the direction for the arrow.

ArgumentTypeRequiredDescription
directionVector3YesThe direction coordinates.

setDirection

Set the direction for the arrow.

ArgumentTypeRequiredDescription
xNumberYesThe x coordinate.
yNumberYesThe y coordinate.
zNumberYesThe z coordinate.

setDirectionFrom

Set the direction for the arrow.

ArgumentTypeRequiredDescription
directionVector3YesThe 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].

ArgumentTypeRequiredDescription
invertBoooleanYes

setShaftRadius

Set the radius of the shaft.

ArgumentTypeRequiredDescription
shaftRadiusNumberYes

setShaftResolution

Set the resolution of the shaft.

ArgumentTypeRequiredDescription
shaftResolutionNumberYes

setTipLength

Set the length of the tip.

ArgumentTypeRequiredDescription
tipLengthNumberYes

setTipRadius

Set the radius of the tip.

ArgumentTypeRequiredDescription
tipRadiusNumberYes

setTipResolution

Set the resolution of the tip.

ArgumentTypeRequiredDescription
tipResolutionNumberYes