Introduction
vtkRenderer is a Viewport designed to hold 3D properties. It contains
an instance of vtkCamera, a collection of vtkLights, and vtkActors. It exists
within a RenderWindow. A RenderWindow may have multiple Renderers
representing different viewports of the Window and Renderers can be layered
on top of each other as well.
Methods
addActor
Add different types of props to the renderer.
| Argument | Type | Required | Description |
|---|---|---|---|
actor |
vtkProp | Yes | The vtkProp instance. |
addLight
Add a light to the list of lights.
| Argument | Type | Required | Description |
|---|---|---|---|
light |
vtkLight | Yes | The vtkLight instance. |
addVolume
Add a volume to the renderer..
| Argument | Type | Required | Description |
|---|---|---|---|
volume |
Yes | The vtkVolume instance. |
allocateTime
Not Implemented yet
computeVisiblePropBounds
Compute the bounding box of all the visible props Used in ResetCamera() and ResetCameraClippingRange()
createLight
Create and add a light to renderer.
extend
Method use to decorate a given object (publicAPI+model) with vtkRenderer 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 |
IRendererInitialValues | No | (default: {}) |
getActiveCamera
Get the active camera
getActiveCameraAndResetIfCreated
getActors
Return any actors in this renderer.
getActorsByReference
Return any actors in this renderer.
getAllocatedRenderTime
getAutomaticLightCreation
getBackingStore
getClippingRangeExpansion
getDelegate
getDraw
getEnvironmentTexture
getEnvironmentTextureDiffuseStrength
Returns the diffuse strength of the set environment texture.
getEnvironmentTextureSpecularStrength
Returns the specular strength of the set environment texture.
getErase
getInteractive
getLastRenderTimeInSeconds
getLastRenderingUsedDepthPeeling
getLayer
getLightFollowCamera
getLights
getLightsByReference
getMTime
Return the Modified Time which is a monotonic increasing integer
global for all vtkObjects.
This allow to solve a question such as:
- Is that object created/modified after another one?
- Do I need to re-execute this filter, or not? …
getMaximumNumberOfPeels
getNearClippingPlaneTolerance
getNumberOfPropsRendered
getOcclusionRatio
getPass
getPreserveColorBuffer
getPreserveDepthBuffer
getRenderWindow
getSelector
getTexturedbackground
getTimeFactor
getTransparent
getTwosidedlighting
getUseEnvironmentTextureAsBackground
Gets whether or not the environment texture is being used as the background for the view.
getUsedepthpeeling
getUseshadows
getVTKWindow
getVolumes
Return the collection of volumes.
getVolumesByReference
Return the collection of volumes.
hasLight
Check if the renderer already has the specified light.
| Argument | Type | Required | Description |
|---|---|---|---|
light |
vtkLight | Yes | The vtkLight instance. |
isActiveCameraCreated
makeCamera
Create a new Camera suitable for use with this type of Renderer.
makeLight
Create a new Light suitable for use with this type of Renderer.
newInstance
Method use to create a new instance of vtkRenderer.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues |
IRendererInitialValues | No | for pre-setting some of its content |
normalizedDisplayToWorld
requires the aspect ratio of the viewport as X/Y
| Argument | Type | Required | Description |
|---|---|---|---|
x |
Number | Yes | The x coordinate. |
y |
Number | Yes | The y coordinate. |
z |
Number | Yes | The z coordinate. |
aspect |
Number | Yes |
onEvent
Adds an event listener.
projectionToView
| Argument | Type | Required | Description |
|---|---|---|---|
x |
Number | Yes | The x coordinate. |
y |
Number | Yes | The y coordinate. |
z |
Number | Yes | The z coordinate. |
aspect |
Number | Yes |
removeActor
Remove an actor from the list of actors.
| Argument | Type | Required | Description |
|---|---|---|---|
actor |
vtkProp | Yes |
removeAllActors
Remove all actors from the list of actors.
removeAllLights
Remove all lights from the list of lights.
removeAllVolumes
Remove all volumes from the list of volumes.
removeLight
Remove a light from the list of lights.
| Argument | Type | Required | Description |
|---|---|---|---|
light |
vtkLight | Yes | The light object to remove. |
removeVolume
Remove a volume from the list of volumes.
| Argument | Type | Required | Description |
|---|---|---|---|
volume |
vtkVolume | Yes | The volume object to remove. |
resetCamera
Automatically set up the camera based on the visible actors.
The camera will reposition itself to view the center point of the actors,
and move along its initial view plane normal (i.e., vector defined from
camera position to focal point) so that all of the actors can be seen.
| Argument | Type | Required | Description |
|---|---|---|---|
bounds |
Bounds | No |
resetCameraClippingRange
Reset the camera clipping range based on a bounding box.
| Argument | Type | Required | Description |
|---|---|---|---|
bounds |
Bounds | No |
setActiveCamera
Specify the camera to use for this renderer.
| Argument | Type | Required | Description |
|---|---|---|---|
camera |
vtkCamera | Yes | The camera object to use. |
setAutomaticLightCreation
| Argument | Type | Required | Description |
|---|---|---|---|
automaticLightCreation |
Boolean | Yes |
setBackground
Set the viewport background.
| Argument | Type | Required | Description |
|---|---|---|---|
background |
Array[Number] | Yes | The RGB color array. |
setBackground
Set the viewport background.
| Argument | Type | Required | Description |
|---|---|---|---|
r |
Number | Yes | Defines the red component (between 0 and 1). |
g |
Number | Yes | Defines the green component (between 0 and 1). |
b |
Number | Yes | Defines the blue component (between 0 and 1). |
setBackground
Set the viewport background.
| Argument | Type | Required | Description |
|---|---|---|---|
r |
Number | Yes | Defines the red component (between 0 and 1). |
g |
Number | Yes | Defines the green component (between 0 and 1). |
b |
Number | Yes | Defines the blue component (between 0 and 1). |
a |
Number | Yes | Defines the alpha component (between 0 and 1). |
setBackingStore
| Argument | Type | Required | Description |
|---|---|---|---|
backingStore |
* | Yes |
setClippingRangeExpansion
| Argument | Type | Required | Description |
|---|---|---|---|
clippingRangeExpansion |
Number | Yes |
setDelegate
| Argument | Type | Required | Description |
|---|---|---|---|
delegate |
Yes |
setDraw
| Argument | Type | Required | Description |
|---|---|---|---|
draw |
Boolean | Yes |
setEnvironmentTexture
| Argument | Type | Required | Description |
|---|---|---|---|
environmentTexture |
vtkTexture | Yes |
setEnvironmentTextureDiffuseStrength
Sets the diffuse strength of the set environment texture.
| Argument | Type | Required | Description |
|---|---|---|---|
diffuseStrength |
number | Yes | the new diffuse strength. |
setEnvironmentTextureSpecularStrength
Sets the specular strength of the set environment texture.
| Argument | Type | Required | Description |
|---|---|---|---|
specularStrength |
number | Yes | the new specular strength. |
setErase
| Argument | Type | Required | Description |
|---|---|---|---|
erase |
Boolean | Yes |
setInteractive
| Argument | Type | Required | Description |
|---|---|---|---|
interactive |
Boolean | Yes |
setLayer
| Argument | Type | Required | Description |
|---|---|---|---|
layer |
Number | Yes |
setLightCollection
Set the collection of lights.
| Argument | Type | Required | Description |
|---|---|---|---|
lights |
Array[vtkLight] | Yes |
setLightFollowCamera
| Argument | Type | Required | Description |
|---|---|---|---|
lightFollowCamera |
Boolean | Yes |
setMaximumNumberOfPeels
| Argument | Type | Required | Description |
|---|---|---|---|
maximumNumberOfPeels |
Number | Yes |
setNearClippingPlaneTolerance
| Argument | Type | Required | Description |
|---|---|---|---|
nearClippingPlaneTolerance |
Number | Yes |
setOcclusionRatio
| Argument | Type | Required | Description |
|---|---|---|---|
occlusionRatio |
Number | Yes |
setPass
| Argument | Type | Required | Description |
|---|---|---|---|
pass |
Number | Yes |
setPreserveColorBuffer
| Argument | Type | Required | Description |
|---|---|---|---|
preserveColorBuffer |
Boolean | Yes |
setPreserveDepthBuffer
| Argument | Type | Required | Description |
|---|---|---|---|
preserveDepthBuffer |
Boolean | Yes |
setRenderWindow
Specify the rendering window in which to draw.
| Argument | Type | Required | Description |
|---|---|---|---|
renderWindow |
vtkRenderWindow | Yes |
setTexturedBackground
| Argument | Type | Required | Description |
|---|---|---|---|
texturedBackground |
Boolean | Yes |
setTwoSidedLighting
| Argument | Type | Required | Description |
|---|---|---|---|
twoSidedLighting |
Boolean | Yes |
setUseDepthPeeling
| Argument | Type | Required | Description |
|---|---|---|---|
useDepthPeeling |
Boolean | Yes |
setUseEnvironmentTextureAsBackground
Sets whether or not to use the environment texture as the background for the view.
| Argument | Type | Required | Description |
|---|---|---|---|
textureAsBackground |
number | Yes |
setUseShadows
| Argument | Type | Required | Description |
|---|---|---|---|
useShadows |
Boolean | Yes |
updateCamera
Ask the active camera to do whatever it needs to do prior to rendering.
updateGeometry
Not Implemented yet
updateLightGeometry
Update the geometry of the lights in the scene that are not in world
space (for instance, Headlights or CameraLights that are attached to the
camera).
updateLightsGeometryToFollowCamera
Ask the lights in the scene that are not in world space
(for instance, Headlights or CameraLights that are attached to the
camera) to update their geometry to match the active camera.
viewToProjection
Convert world point coordinates to view coordinates.
requires the aspect ratio of the viewport as X/Y
| Argument | Type | Required | Description |
|---|---|---|---|
x |
Number | Yes | The x coordinate. |
y |
Number | Yes | The y coordinate. |
z |
Number | Yes | The z coordinate. |
aspect |
Number | Yes |
viewToWorld
requires the aspect ratio of the viewport as X/Y
| Argument | Type | Required | Description |
|---|---|---|---|
x |
Number | Yes | The x coordinate. |
y |
Number | Yes | The y coordinate. |
z |
Number | Yes | The z coordinate. |
visibleActorCount
Get the number of visible actors.
visibleVolumeCount
Not Implemented yet
worldToNormalizedDisplay
requires the aspect ratio of the viewport as X/Y
| Argument | Type | Required | Description |
|---|---|---|---|
x |
Number | Yes | The x coordinate. |
y |
Number | Yes | The y coordinate. |
z |
Number | Yes | The z coordinate. |
aspect |
Number | Yes |
worldToView
Convert world point coordinates to view coordinates.
| Argument | Type | Required | Description |
|---|---|---|---|
x |
Number | Yes | The x coordinate. |
y |
Number | Yes | The y coordinate. |
z |
Number | Yes | The z coordinate. |
Source
import { Bounds, Nullable } from '../../../types'; |
import { mat4, vec3 } from 'gl-matrix'; |