Prop3D
Introduction
vtkProp3D is an abstract class used to represent an entity in a rendering scene (i.e., vtkProp3D is a vtkProp with an associated transformation matrix). It handles functions related to the position, orientation and scaling. It combines these instance variables into one 4x4 transformation matrix as follows: [x y z 1] = [x y z 1] Translate(-origin) Scale(scale) Rot(y) Rot(x) Rot (z) Trans(origin) Trans(position). Both vtkActor and vtkVolume are specializations of class vtkProp. The constructor defaults to: origin(0,0,0) position=(0,0,0) orientation=(0,0,0), no user defined matrix or transform, and no texture map.
Methods
addPosition
Add the position of the Prop3D in world coordinates.
| Argument | Type | Required | Description |
|---|---|---|---|
deltaXYZ | Yes |
computeMatrix
Generate the matrix based on internal model.
extend
Method use to decorate a given object (publicAPI+model) with vtkProp3D 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 | IProp3DInitialValues | No | (default: {}) |
getBounds
Get the bounds of this actor as [xmin, xmax, ymin, ymax, zmin, zmax]. They are the bounds of the underlying mapper, transformed using the actor's matrix.
getBoundsByReference
Same as getBounds() but the returned array is not copied, so it should not be written to.
getCenter
Get the center of the bounding box in world coordinates.
getIsIdentity
Check if there was a modification or transformation.
getLength
Get the length of the diagonal of the bounding box.
getMatrix
Get a reference to the Prop3D’s 4x4 composite matrix. Get the matrix from the position, origin, scale and orientation This matrix is cached, so multiple GetMatrix() calls will be efficient.
getOrientation
The ordering in which these rotations must be done to generate the same matrix is RotateZ, RotateX, and finally RotateY. See also SetOrientation.
getOrientationByReference
Get a reference of the orientation of the Prop3D as s vector of X, Y and Z rotation.
getOrientationQuaternion
Get the orientation quaternion of the Prop3D. out is optional and will be created if not supplied.
| Argument | Type | Required | Description |
|---|---|---|---|
out | quat or undefined | Yes |
getOrientationWXYZ
Get the WXYZ orientation of the Prop3D.
getOrientationWXYZ
Get the WXYZ orientation of the Prop3D.
getOrigin
Get the origin of the Prop3D. This is the point about which all rotations take place.
getOriginByReference
Get a reference of the origin of the Prop3D. This is the point about which all rotations take place.
getPosition
Get the position of the Prop3D in world coordinates.
getPositionByReference
Get a refrence of the position of the Prop3D in world coordinates.
getProperties
Get the actor properties array Each element of the array corresponds to a mapper input port
getProperty
Get the actor property for the specified mapper input port, which defaults to 0 It controls this actors rendering properties. If one isn’t specified, then one will be generated automatically. Multiple actors can share one property object.
| Argument | Type | Required | Description |
|---|---|---|---|
mapperInputPort | number | Yes | Defaults to 0 |
getScale
Get the scale of the actor.
getScaleByReference
Get a refrence of the scale of the actor.
getUserMatrix
Get the transformation matrix set for your own use.
getXRange
Get the Prop3D's x range in world coordinates.
getYRange
Get the Prop3D's y range in world coordinates.
getZRange
Get the Prop3D's z range in world coordinates.
newInstance
Method use to create a new instance of vtkProp3D
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IProp3DInitialValues | No | for pre-setting some of its content |
rotateQuaternion
Rotate the Prop3D by the provided orientation quaternion. If the provided quaternion is identity (~epsilon), this function does nothing. The quaternion should follow the gl-matrix convention: [x,y,z,w]
| Argument | Type | Required | Description |
|---|---|---|---|
orientationQuaternion | quat | Yes | The quaternion to rotate the prop by. |
rotateWXYZ
Rotate the Prop3D in degrees about an arbitrary axis specified by the last three arguments. The axis is specified in world coordinates. To rotate an about its model axes, use RotateX, RotateY, RotateZ.
| Argument | Type | Required | Description |
|---|---|---|---|
degrees | Number | Yes | The angle value. |
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
rotateX
Rotate the Prop3D in degrees about the X axis using the right hand rule. The axis is the Prop3D’s X axis, which can change as other rotations are performed. To rotate about the world X axis use RotateWXYZ (angle, 1, 0, 0). This rotation is applied before all others in the current transformation matrix.
| Argument | Type | Required | Description |
|---|---|---|---|
angle | Number | Yes | The angle value. |
rotateY
Rotate the Prop3D in degrees about the Y axis using the right hand rule. The axis is the Prop3D’s Y axis, which can change as other rotations are performed. To rotate about the world Y axis use RotateWXYZ (angle, 0, 1, 0). This rotation is applied before all others in the current transformation matrix.
| Argument | Type | Required | Description |
|---|---|---|---|
angle | Number | Yes | The angle value. |
rotateZ
Rotate the Prop3D in degrees about the Z axis using the right hand rule. The axis is the Prop3D’s Z axis, which can change as other rotations are performed. To rotate about the world Z axis use RotateWXYZ (angle, 0, 0, 1). This rotation is applied before all others in the current transformation matrix.
| Argument | Type | Required | Description |
|---|---|---|---|
angle | Number | Yes | The angle value. |
setOrientation
Orientation is specified as X, Y and Z rotations in that order, but they are performed as RotateZ, RotateX, and finally RotateY.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setOrigin
Set the origin of the Prop3D. This is the point about which all rotations take place.
| Argument | Type | Required | Description |
|---|---|---|---|
origin | Array[Number] | Yes |
setOrigin
Set the origin of the Prop3D. This is the point about which all rotations take place.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setOriginFrom
Set the origin of the Prop3D. This is the point about which all rotations take place.
| Argument | Type | Required | Description |
|---|---|---|---|
origin | Array[Number] | Yes |
setPosition
Set the origin of the Prop3D. This is the point about which all rotations take place.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setPositionFrom
Set the origin of the Prop3D.
| Argument | Type | Required | Description |
|---|---|---|---|
position | Vector3 | Yes |
setProperties
Set the actor properties array Each element of the array corresponds to a mapper input port
| Argument | Type | Required | Description |
|---|---|---|---|
properties | Array[vtkObject] | Yes |
setProperty
Set the actor property for the specified mapper input port, which defaults to 0
| Argument | Type | Required | Description |
|---|---|---|---|
property | vtkObject | Yes | |
mapperInputPort | number | Yes | Is 0 when not given |
setScale
Set the scale of the actor. Scaling in performed independently on the X, Y and Z axis. A scale of zero is illegal and will be replaced with one.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setScaleFrom
| Argument | Type | Required | Description |
|---|---|---|---|
scale | Array[Number] | Yes |
setUserMatrix
In addition to the instance variables such as position and orientation, you can add an additional transformation matrix for your own use. This matrix is concatenated with the actor's internal matrix, which you implicitly create through the use of setPosition(), setOrigin() and setOrientation().
| Argument | Type | Required | Description |
|---|---|---|---|
matrix | mat4 | Yes |