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
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.
| Argument | Type | Required | Description |
|---|---|---|---|
text | String | Yes | the label string, looked up in the texture atlas |
pos | Number | Yes | index of the anchor point in the text polydata |
cmat | mat4 | Yes | world to normalized device coordinates matrix |
imat | mat4 | Yes | inverse of cmat |
dir | Vector2 | Yes | screen space direction the label is pushed towards |
offset | Number | Yes | distance in pixels the label is pushed by |
results | ILabelPolyDataResults | Yes | accumulator, updated in place |
extend
Method used to decorate a given object (publicAPI+model) with vtkCubeAxesActor 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 | ICubeAxesActorInitialValues | No | (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.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ICubeAxesActorInitialValues | No | for pre-setting some of its content |
setAxisTextStyle
Merge the given properties into the axis title text style.
| Argument | Type | Required | Description |
|---|---|---|---|
axisStyle | ICubeAxesTextStyle | Yes |
setCamera
Set the camera used to decide which faces are visible. The actor is updated on every camera modification.
| Argument | Type | Required | Description |
|---|---|---|---|
camera | Yes |
setRenderable
Bind the helper to a cube axes actor and share its texture and property with the internal label actor.
| Argument | Type | Required | Description |
|---|---|---|---|
renderable | Yes |
setTickTextStyle
Merge the given properties into the tick label text style.
| Argument | Type | Required | Description |
|---|---|---|---|
tickStyle | ICubeAxesTextStyle | Yes |
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.
| Argument | Type | Required | Description |
|---|---|---|---|
size | Vector2 | Yes | the view size in pixels |
camera | vtkCamera | Yes | |
renderWindow | Yes |
updatePolyData
Rebuild the polydata holding the bounding edges and the grid lines.
| Argument | Type | Required | Description |
|---|---|---|---|
facesToDraw | Array[Boolean] | Yes | one entry per face |
edgesToDraw | Array[Number] | Yes | number of drawn faces sharing each of the twelve edges; an edge is labeled when exactly one face uses it |
ticks | Array[Array[Number]] | Yes | tick positions per axis |
updateTextData
Rebuild the world coordinates and the strings of the labels.
| Argument | Type | Required | Description |
|---|---|---|---|
facesToDraw | Array[Boolean] | Yes | one entry per face |
edgesToDraw | Array[Number] | Yes | number of drawn faces sharing each edge |
ticks | Array[Array[Number]] | Yes | tick positions per axis |
tickStrings | Array[Array[String]] | Yes | formatted tick labels per axis |
updateTextureAtlas
Redraw the label texture atlas.
| Argument | Type | Required | Description |
|---|---|---|---|
tickStrings | Array[Array[String]] | Yes | formatted tick labels per axis |
updateTexturePolyData
Rebuild the label quads, which depend on the current camera.