Skip to content

Viewport ​

Introduction ​

vtkViewport represents part or all of a RenderWindow. It holds a collection of props that will be rendered into the area it represents. This class also contains methods to convert between coordinate systems commonly used in rendering.

See Also ​

vtkActorvtkCoordinatevtkPropvtkRendervtkRenderWindowvtkVolume

Methods ​

PickPropFrom ​

Not Implemented yet

addActor2D ​

Adds a 2D actor to the scene.

ArgumentTypeRequiredDescription
propYes

addViewProp ​

Add a prop to the list of props.

ArgumentTypeRequiredDescription
propYes

displayToView ​

Convert display coordinates to view coordinates.

extend ​

Method use to decorate a given object (publicAPI+model) with vtkViewport characteristics.

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

getActors2D ​

getBackground ​

Get the viewport background.

Returns ​

TypeDescription
RGBColor

getBackground2 ​

Get the viewport background.

Returns ​

TypeDescription
RGBColor

getBackground2ByReference ​

Get the viewport background.

Returns ​

TypeDescription
RGBColor

getBackgroundByReference ​

Get the viewport background.

Returns ​

TypeDescription
RGBColor

getGradientBackground ​

Get the gradient background flag.

Returns ​

TypeDescription
Boolean

getSize ​

Get the size and origin of the viewport in display coordinates.

getViewProps ​

getViewPropsWithNestedProps ​

getViewport ​

Viewport for the Viewport to draw in the rendering window. Coordinates are expressed as (xmin,ymin,xmax,ymax), where each coordinate is 0 <= coordinate <= 1.0.

Returns ​

TypeDescription
Array[Number]

getViewportByReference ​

hasViewProp ​

ArgumentTypeRequiredDescription
propYes

newInstance ​

Method use to create a new instance of vtkViewport

normalizedDisplayToNormalizedViewport ​

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

normalizedDisplayToProjection ​

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

normalizedViewportToNormalizedDisplay ​

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

normalizedViewportToProjection ​

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

projectionToNormalizedDisplay ​

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

projectionToNormalizedViewport ​

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

removeActor2D ​

ArgumentTypeRequiredDescription
propYes

removeAllViewProps ​

removeViewProp ​

ArgumentTypeRequiredDescription
propYes

setBackground ​

Set the viewport background.

ArgumentTypeRequiredDescription
backgroundArray[Number]YesThe RGB color array.

setBackground ​

Set the viewport background.

ArgumentTypeRequiredDescription
rNumberYesDefines the red component (between 0 and 1).
gNumberYesDefines the green component (between 0 and 1).
bNumberYesDefines the blue component (between 0 and 1).

setBackground2 ​

Set the viewport secondary background.

ArgumentTypeRequiredDescription
backgroundRGBColorYes

setBackground2 ​

Set the viewport secondary background.

ArgumentTypeRequiredDescription
rNumberYesDefines the red component (between 0 and 1).
gNumberYesDefines the green component (between 0 and 1).
bNumberYesDefines the blue component (between 0 and 1).

setBackground2From ​

Set the viewport secondary background.

ArgumentTypeRequiredDescription
backgroundRGBColorYes

setBackgroundFrom ​

Set the viewport background.

ArgumentTypeRequiredDescription
backgroundRGBColorYes

setGradientBackground ​

Set the gradient background flag.

ArgumentTypeRequiredDescription
gradientBackgroundBooleanYes

setViewport ​

Specify the viewport for the Viewport to draw in the rendering window. Each coordinate is 0 <= coordinate <= 1.0.

ArgumentTypeRequiredDescription
xminNumberYesThe xmin coordinate.
yminNumberYesThe ymin coordinate.
xmaxNumberYesThe xmax coordinate.
ymaxNumberYesThe ymax coordinate.

setViewportFrom ​

Specify the viewport for the Viewport to draw in the rendering window. Coordinates are expressed as [xmin, ymin, xmax, ymax], where each coordinate is 0 <= coordinate <= 1.0.

ArgumentTypeRequiredDescription
viewportArray[Number]Yes

viewToDisplay ​