Helper
Methods
drawArrays
Update the shaders, bind the vertex array object and issue the draw call.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer being drawn. |
actor | vtkActor | Yes | The actor being drawn. |
rep | Yes | The representation to draw with. | |
oglMapper | Yes | The OpenGL mapper driving this helper. |
Returns
| Type | Description |
|---|---|
| number | The number of primitives drawn. |
extend
Method used to decorate a given object (publicAPI+model) with vtkOpenGLHelper 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 | IOpenGLHelperInitialValues | No | (default: {}) |
getAllocatedGPUMemoryInBytes
Get the amount of GPU memory this helper's buffers hold, in bytes.
getAttributeUpdateTime
Get the time object tracking when the attributes were last bound.
getCABO
Get the cell array buffer object holding the packed vertices.
getNeedToRebuildShaders
Whether the shader program must be rebuilt before the next draw.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer being drawn. |
actor | vtkActor | Yes | The actor being drawn. |
oglMapper | Yes | The OpenGL mapper driving this helper. |
getOpenGLMode
Get the GL draw mode for this helper's primitive, POINTS while point picking.
| Argument | Type | Required | Description |
|---|---|---|---|
rep | Yes | The representation to draw with. |
getPointPicking
Whether the helper draws points for hardware point picking.
getPointPickingPrimitiveSize
Get the point size in pixels used to make this helper's primitive pickable.
getPrimitiveType
Get which of the primTypes this helper draws.
getProgram
Get the shader program this helper draws with.
getShaderSourceTime
Get the time object tracking when the shader sources were last rebuilt.
getVAO
Get the vertex array object.
haveWideLines
Whether the lines must be emulated with instanced quads because the hardware does not support the requested line width.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer being drawn. |
actor | vtkActor | Yes | The actor being drawn. |
newInstance
Method used to create a new instance of vtkOpenGLHelper.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IOpenGLHelperInitialValues | No | for pre-setting some of its content |
releaseGraphicsResources
Release the vertex array object and the buffers.
releasePolyDataMapperResources
Release the shared resources of a polydata mapper and invalidate its buffers.
replaceShaderPositionVC
Add the point size and, for wide lines, the line widening code to the vertex shader.
| Argument | Type | Required | Description |
|---|---|---|---|
shaders | IShaderSources | Yes | The shader sources to substitute into. |
ren | vtkRenderer | Yes | The renderer being drawn. |
actor | vtkActor | Yes | The actor being drawn. |
setAttributeUpdateTime
Set the time object tracking when the attributes were last bound.
| Argument | Type | Required | Description |
|---|---|---|---|
attributeUpdateTime | Yes | The time object. |
setCABO
Set the cell array buffer object holding the packed vertices.
| Argument | Type | Required | Description |
|---|---|---|---|
CABO | Yes | The cell array buffer object. |
setMapperShaderParameters
Set the wide line and point size uniforms.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer being drawn. |
actor | vtkActor | Yes | The actor being drawn. |
size | ITiledSizeAndOrigin | Yes | The pixel extent of the viewport. |
setOpenGLRenderWindow
Attach this helper, its vertex array object and its buffers to an OpenGL render window.
| Argument | Type | Required | Description |
|---|---|---|---|
win | Yes | The OpenGL render window. |
setPointPicking
Set whether the helper draws points for hardware point picking.
| Argument | Type | Required | Description |
|---|---|---|---|
pointPicking | Yes | The point picking flag. |
setPrimitiveType
Set which of the primTypes this helper draws.
| Argument | Type | Required | Description |
|---|---|---|---|
primitiveType | Yes | The primitive type. |
setProgram
Set the shader program this helper draws with.
| Argument | Type | Required | Description |
|---|---|---|---|
program | Yes | The shader program. |
setShaderSourceTime
Set the time object tracking when the shader sources were last rebuilt.
| Argument | Type | Required | Description |
|---|---|---|---|
shaderSourceTime | Yes | The time object. |
setVAO
Set the vertex array object.
| Argument | Type | Required | Description |
|---|---|---|---|
VAO | Yes | The vertex array object. |
updateShaders
Rebuild the program if needed, bind it and let the mapper set its uniforms.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes | The renderer being drawn. |
actor | vtkActor | Yes | The actor being drawn. |
oglMapper | Yes | The OpenGL mapper driving this helper. |