Skip to content

ViewNode ​

Introduction ​

a node within a VTK scene graph

This is the superclass for all nodes within a VTK scene graph. It contains the API for a node. It supports the essential operations such as graph creation, state storage and traversal. Child classes adapt this to VTK's major rendering classes. Grandchild classes adapt those to for APIs of different rendering libraries.

Methods ​

addMissingNode ​

Add a child view node to this node, created from the renderable given as argument If the node creation fails or the argument is falsy, returns undefined Otherwise, returns the newly created node or the existing node

ArgumentTypeRequiredDescription
dobjYes

addMissingNodes ​

Add missing child view nodes for the renderables given as argument. Call it between prepareNodes and removeUnusedNodes.

ArgumentTypeRequiredDescription
dataObjsYes
enforceOrderbooleanNoKeep the view nodes of dataObjs next to each other and in the order of dataObjs, defaults to false

apply ​

ArgumentTypeRequiredDescription
renderPassvtkRenderPassYes
prepassYes

build ​

Builds myself.

ArgumentTypeRequiredDescription
prepassYes

createViewNode ​

ArgumentTypeRequiredDescription
dataObjYes

extend ​

Method used to decorate a given object (publicAPI+model) with vtkViewNode characteristics.

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

getChildren ​

getChildrenByReference ​

getFirstAncestorOfType ​

Find the first parent/grandparent of the desired type

ArgumentTypeRequiredDescription
typeYes

getLastAncestorOfType ​

Find the last parent/grandparent of the desired type

ArgumentTypeRequiredDescription
typeYes

getMyFactory ​

getParent ​

getRenderable ​

Get The data object (thing to be rendered).

getViewNodeFor ​

Returns the view node that corresponding to the provided object Will return NULL if a match is not found in self or descendents

ArgumentTypeRequiredDescription
dataObjectYes
hintNothe previously found node (for optimization)

getVisited ​

newInstance ​

Method used to create a new instance of vtkViewNode.

ArgumentTypeRequiredDescription
initialValuesIViewNodeInitialValuesNofor pre-setting some of its content

prepareNodes ​

removeNode ​

Removes a child view node If the node is not found, returns false Otherwise, removes the node from the children list and returns true

ArgumentTypeRequiredDescription
dobjYes

removeUnusedNodes ​

render ​

Makes calls to make self visible.

ArgumentTypeRequiredDescription
prepassYes

setMyFactory ​

ArgumentTypeRequiredDescription
myFactoryYes

setParent ​

ArgumentTypeRequiredDescription
parentYes

setRenderable ​

ArgumentTypeRequiredDescription
renderableYes

setVisited ​

ArgumentTypeRequiredDescription
valYes

traverse ​

Traverse this node with the specified pass. If you want to traverse your children in a specific order or way override this method

ArgumentTypeRequiredDescription
renderPassvtkRenderPassYes