IndexBuffer
Methods
buildFlatIndexBuffer
Build an index buffer with a separate provoking vertex for each cell.
buildIndexBuffer
Build the index buffer for the cells of the request. The resulting typed array is stored on the request as nativeArray and its WebGPU index format as format. When pointIds is true, the indices are point ids and the flat id maps are null. Otherwise, the indices refer to flattened vertices.
| Argument | Type | Required | Description |
|---|---|---|---|
req | IWebGPUBufferRequest | Yes | The request, providing cells, numberOfPoints, primitiveType, representation and cellOffset. |
buildPointIdIndexBuffer
Build an index buffer of point ids for the primitive-index feature.
extend
Method used to decorate a given object (publicAPI+model) with vtkWebGPUIndexBuffer 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 | IWebGPUIndexBufferInitialValues | No | (default: {}) |
getFlatIdToCellId
Get the map from flat id to the cell id it was expanded from.
getFlatIdToPointId
Get the map from flat id to the point id it was expanded from.
getFlatSize
Get the number of flat ids, i.e. the number of vertices the attribute buffers must hold.
getIndexCount
Get the number of indices stored in the buffer.
getPrimitiveToCellId
Get the global cell id of each primitive, or null for a one-to-one mapping.
getPrimitiveToCellIdBuffer
Get the storage buffer holding the primitive-to-cell map, when needed.
newInstance
Method used to create a new instance of vtkWebGPUIndexBuffer.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IWebGPUIndexBufferInitialValues | No | for pre-setting some of its content |
setFlatIdToCellId
Set the map from flat id to the cell id it was expanded from.
setFlatIdToPointId
Set the map from flat id to the point id it was expanded from.
setFlatSize
Set the number of flat ids.
setIndexCount
Set the number of indices stored in the buffer.