Skip to content

CellArrayMapper ​

Introduction ​

Draws one cell array of a polydata. The WebGPU polydata mappers create one of these per non empty cell array, and this class assembles the shader code, the vertex input and the uniform buffer of that primitive.

Methods ​

addCellIdToFragmentShader ​

Add the fragment shader's vtkCellId helper and cell texture coordinates when the mapper uses primitive-index.

buildPass ​

Locate the actor, renderer, render window and device this mapper draws through, and pick the coordinate system from the actor.

ArgumentTypeRequiredDescription
prepassYes

buildVertexInput ​

Build the vertex input of this mapper: the point, normal, color and texture coordinate buffers of the cell array, plus the index buffer when the primitive needs one.

extend ​

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

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

getCellArray ​

Get the cell array this mapper draws.

getCellNormalMatrix ​

Get the WGSL matrix expression transforming cell normals to world space.

getCellOffset ​

Get the index of the first cell of this cell array within the polydata, used to look up cell data.

getCoincidentParameters ​

Get the polygon offset factor and offset applied to this primitive, from the coincident topology resolution of the renderable. Point picking always adds an offset.

getCullMode ​

Get the cull mode from the front and back face culling flags of the actor's property.

getCurrentInput ​

Get the polydata the cell array belongs to.

getHashFromUsage ​

Get the part of the pipeline hash that depends on the buffer usage.

ArgumentTypeRequiredDescription
usageBufferUsageYes

getIs2D ​

Get whether this mapper draws in 2D, i.e. under a vtkWebGPUActor2D.

getPipelineSettings ​

Get the pipeline settings: the cull mode, plus a color target with writes masked off during the depth only pass.

getPrimitiveType ​

Get the primitive type of the cell array.

getRenderEncoder ​

Get the render encoder this mapper last drew through.

getTopologyFromUsage ​

Get the primitive topology a buffer usage is drawn with.

ArgumentTypeRequiredDescription
usageBufferUsageYes

getUsage ​

Get the buffer usage the primitive is drawn with for a representation.

ArgumentTypeRequiredDescription
repRepresentationYesthe representation of the actor's property
iPrimitiveTypesYesthe primitive type

haveWideLines ​

Whether the primitive is drawn as wide lines, which are emulated with one instance per pixel of line width.

isEdgePrimitive ​

Whether this mapper draws the edges of triangles or triangle strips.

newInstance ​

Method used to create a new instance of vtkWebGPUCellArrayMapper.

ArgumentTypeRequiredDescription
initialValuesIWebGPUCellArrayMapperInitialValuesNofor pre-setting some of its content

opaquePass ​

ArgumentTypeRequiredDescription
prepassYes

opaqueZBufferPass ​

ArgumentTypeRequiredDescription
prepassYes

renderForPass ​

Prepare and register the draw callback of this mapper on an encoder.

ArgumentTypeRequiredDescription
renderEncodervtkWebGPURenderEncoderYes
depthOnlyBooleanNo(default: false)

replaceShaderAlpha ​

Apply the alpha mode of the actor's property to the fragment shader.

replaceShaderCoincidentOffset ​

ArgumentTypeRequiredDescription
hashStringYesthe pipeline hash
pipelinevtkWebGPUPipelineYes
vertexInputvtkWebGPUVertexInputYes

replaceShaderColor ​

ArgumentTypeRequiredDescription
hashStringYesthe pipeline hash
pipelinevtkWebGPUPipelineYes
vertexInputvtkWebGPUVertexInputYes

replaceShaderLight ​

ArgumentTypeRequiredDescription
hashStringYesthe pipeline hash
pipelinevtkWebGPUPipelineYes
vertexInputvtkWebGPUVertexInputYes

replaceShaderNormal ​

ArgumentTypeRequiredDescription
hashStringYesthe pipeline hash
pipelinevtkWebGPUPipelineYes
vertexInputvtkWebGPUVertexInputYes

replaceShaderPosition ​

ArgumentTypeRequiredDescription
hashStringYesthe pipeline hash
pipelinevtkWebGPUPipelineYes
vertexInputvtkWebGPUVertexInputYes

replaceShaderSelect ​

ArgumentTypeRequiredDescription
hashStringYesthe pipeline hash
pipelinevtkWebGPUPipelineYes
vertexInputvtkWebGPUVertexInputYes

replaceShaderTCoord ​

ArgumentTypeRequiredDescription
hashStringYesthe pipeline hash
pipelinevtkWebGPUPipelineYes
vertexInputvtkWebGPUVertexInputYes

setCellArray ​

Set the cell array this mapper draws.

ArgumentTypeRequiredDescription
cellArrayvtkCellArrayYes

setCellOffset ​

Set the index of the first cell of this cell array within the polydata.

ArgumentTypeRequiredDescription
cellOffsetNumberYes

setCurrentInput ​

Set the polydata the cell array belongs to.

ArgumentTypeRequiredDescription
currentInputvtkPolyDataYes

setIs2D ​

Set whether this mapper draws in 2D, i.e. under a vtkWebGPUActor2D.

ArgumentTypeRequiredDescription
is2DBooleanYes

setPrimitiveType ​

Set the primitive type of the cell array.

ArgumentTypeRequiredDescription
primitiveTypePrimitiveTypesYes

setRenderEncoder ​

Set the render encoder this mapper draws through.

ArgumentTypeRequiredDescription
renderEncodervtkWebGPURenderEncoderYes

shouldSkipPass ​

Whether this pass should be skipped, which is the case for edges during the depth only and the selection passes.

translucentPass ​

ArgumentTypeRequiredDescription
prepassYes

updateCellScalarSSBO ​

Update the storage buffer holding cell scalar colors.

updateSkinSSBO ​

Update the storage buffer holding the skinning transforms.

updateTextures ​

Create the texture views and samplers of the textures of the renderable, dropping the ones that are no longer used.

updateUBO ​

Fill the mapper uniform buffer from the actor matrices, its property and the clipping planes of the renderable, then send it if anything changed.

usesCellNormals ​

Whether cell normals are read from a storage buffer.

zBufferPass ​

ArgumentTypeRequiredDescription
prepassYes