Skip to content

CubeAxesActor ​

Introduction ​

vtkCubeAxesActor draws a labeled bounding box with tick marks and optional grid lines around a region of interest. Only the faces facing away from the camera are drawn, so the axes never occlude the data.

The class is split in two: this actor holds the view independent properties while vtkCubeAxesActorHelper, created once per view, holds everything that depends on the view resolution and aspect ratio.

See Also ​

vtkAxesActor

Methods ​

computeFacesToDraw ​

Recompute which of the six faces face the camera.

createPolyDataForOneLabel ​

Append the two triangles and the texture coordinates of one label quad to results.

ArgumentTypeRequiredDescription
textStringYesthe label string, looked up in the texture atlas
posNumberYesindex of the anchor point in the text polydata
cmatmat4Yesworld to normalized device coordinates matrix
imatmat4Yesinverse of cmat
dirVector2Yesscreen space direction the label is pushed towards
offsetNumberYesdistance in pixels the label is pushed by
resultsILabelPolyDataResultsYesaccumulator, updated in place

extend ​

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

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

getGridActor ​

The actor drawing the bounding edges and the grid lines.

getTextPolyData ​

Polydata holding the world coordinates the labels are anchored to.

getTextValues ​

The label strings, in the order the label quads are built.

getTickCounts ​

Number of tick labels per drawn axis.

getTmActor ​

The actor drawing the label quads.

getTmTexture ​

Texture atlas holding the rendering of every label string.

get_tmAtlas ​

Placement of every label string inside the texture atlas.

newInstance ​

Method used to create a new instance of vtkCubeAxesActor.

ArgumentTypeRequiredDescription
initialValuesICubeAxesActorInitialValuesNofor pre-setting some of its content

setAxisTextStyle ​

Merge the given properties into the axis title text style.

ArgumentTypeRequiredDescription
axisStyleICubeAxesTextStyleYes

setCamera ​

Set the camera used to decide which faces are visible. The actor is updated on every camera modification.

ArgumentTypeRequiredDescription
cameraYes

setRenderable ​

Bind the helper to a cube axes actor and share its texture and property with the internal label actor.

ArgumentTypeRequiredDescription
renderableYes

setTickTextStyle ​

Merge the given properties into the tick label text style.

ArgumentTypeRequiredDescription
tickStyleICubeAxesTextStyleYes

update ​

Rebuild whatever the current camera and data bounds invalidated. Called on every camera modification and on every modification of the actor.

updateAPISpecificData ​

Record the view resolution and camera, then rebuild the label quads.

ArgumentTypeRequiredDescription
sizeVector2Yesthe view size in pixels
cameravtkCameraYes
renderWindowYes

updatePolyData ​

Rebuild the polydata holding the bounding edges and the grid lines.

ArgumentTypeRequiredDescription
facesToDrawArray[Boolean]Yesone entry per face
edgesToDrawArray[Number]Yesnumber of drawn faces sharing each of the twelve edges; an edge is labeled when exactly one face uses it
ticksArray[Array[Number]]Yestick positions per axis

updateTextData ​

Rebuild the world coordinates and the strings of the labels.

ArgumentTypeRequiredDescription
facesToDrawArray[Boolean]Yesone entry per face
edgesToDrawArray[Number]Yesnumber of drawn faces sharing each edge
ticksArray[Array[Number]]Yestick positions per axis
tickStringsArray[Array[String]]Yesformatted tick labels per axis

updateTextureAtlas ​

Redraw the label texture atlas.

ArgumentTypeRequiredDescription
tickStringsArray[Array[String]]Yesformatted tick labels per axis

updateTexturePolyData ​

Rebuild the label quads, which depend on the current camera.