Skip to content

VTK Actor Bundles

Michael Keilman edited this page Aug 8, 2022 · 3 revisions

ActorBundle

A convenient object bundling a source, actor, and mapper, which almost always appear together anyway

Constructor

new ActorBundle(source, transform, actorProperties)

Parameters:
Name Type Description
source * a vtk source, reader, etc.
transform SIREPO.GEOMETRY.Transform a Transform to translate between "lab" and "local" coordinate systems
actorProperties Object a map of actor properties (e.g. 'color') to values

Source:

Members

actor :vtk.Rendering.Core.vtkActor

the actor

Type:
  • vtk.Rendering.Core.vtkActor

Source:

actorProperties :vtk.Rendering.Core.Property

properties of the actor

Type:
  • vtk.Rendering.Core.Property

Source:

mapper :vtk.Rendering.Core.vtkMapper

a mapper

Type:
  • vtk.Rendering.Core.vtkMapper

Source:

transform :SIREPO.GEOMETRY.Transform

the transform

Type:
  • SIREPO.GEOMETRY.Transform

Source:

Methods

actorBoundingBox(padPct) → {BoxBundle}

Builds a wireframe box around this actor, with optional padding

Parameters:
Name Type Default Description
padPct number 0 additional padding as a percentage of the size

Source:

Returns:

Type
BoxBundle

getActorProperty(name) → {*}

Gets the value of the actor property with the given name

Parameters:
Name Type Description
name string the name of the property

Source:

Returns:

Type
*

setActorProperty(name, value)

Sets the actor property with the given name to the given value

Parameters:
Name Type Description
name string the name of the property
value * the value to set

Source:

setColor(color)

Convenience method for setting the color. Uses colorToFloat to convert

Parameters:
Name Type Description
color string | Array.<number>

Source:

setMapper(mapper)

Sets the mapper for this bundle as well as the actor

Parameters:
Name Type Description
mapper vtk.Rendering.Core.vtkMapper

Source:

setSource(source)

Sets the source for this bundle. Also sets the mapper's input connection to the source's output

Parameters:
Name Type Description
source * vtk source

Source:

BoxBundle

A bundle for a cube source

Constructor

new BoxBundle(labSize, labCenter, transform, actorProperties)

Parameters:
Name Type Description
labSize Array.<number> array of the x, y, z sides of the box in the lab
labCenter Array.<number> array of the x, y, z coords of the box's center in the lab
transform SIREPO.GEOMETRY.Transform a Transform to translate between "lab" and "local" coordinate systems
actorProperties Object a map of actor properties (e.g. 'color') to values

Source:

Methods

setCenter(labCenter)

Sets the center of the box

Parameters:
Name Type Description
labCenter Array.<number> array of the x, y, z coords of the box's center in the lab

Source:

setSize(labSize)

Sets the size of the box

Parameters:
Name Type Description
labSize Array.<number> array of the x, y, z lengths of the box

Source:

LineBundle

A bundle for a line source defined by two points

Constructor

new LineBundle(labP1, labP2, transform, actorProperties)

Parameters:
Name Type Description
labP1 Array.<number> 1st point
labP2 Array.<number> 2nd point
transform SIREPO.GEOMETRY.Transform a Transform to translate between "lab" and "local" coordinate systems
actorProperties Object a map of actor properties (e.g. 'color') to values

Source:

PlaneBundle

A bundle for a plane source defined by three points

Constructor

new PlaneBundle(labOrigin, labP1, labP2, transform, actorProperties)

Parameters:
Name Type Description
labOrigin Array.<number> origin
labP1 Array.<number> 1st point
labP2 Array.<number> 2nd point
transform SIREPO.GEOMETRY.Transform a Transform to translate between "lab" and "local" coordinate systems
actorProperties Object a map of actor properties (e.g. 'color') to values

Source:

Methods

setPoints(labOrigin, labP1, labP2)

Set the defining points of the plane

Parameters:
Name Type Description
labOrigin Array.<number> origin
labP1 Array.<number> 1st point
labP2 Array.<number> 2nd point

Source:

setResolution(xRes, yRes)

Set the resolution in each direction

Parameters:
Name Type Default Description
xRes number 1 resolution (number of divisions) in the direction of the origin to p1
yRes number 1 resolution (number of divisions) in the direction of the origin to p2

Source:

SphereBundle

A bundle for a sphere source

Constructor

new SphereBundle(labCenter, radius, transform, actorProperties)

Parameters:
Name Type Default Description
labCenter Array.<number> center in the lab
radius number 1
transform SIREPO.GEOMETRY.Transform a Transform to translate between "lab" and "local" coordinate systems
actorProperties Object a map of actor properties (e.g. 'color') to values

Source:

Methods

setCenter(labCenter)

Sets the center of the sphere

Parameters:
Name Type Description
labCenter Array.<number> center in the lab

Source:

setRadius(radius)

Sets the radius of the sphere

Parameters:
Name Type Description
radius number

Source:

setRes(thetaRes, phiRes)

Sets the resolution in each angular direction

Parameters:
Name Type Default Description
thetaRes number 16 number of latitude divisions
phiRes number 16 number of longitude divisions

Source:

Clone this wiki locally