11 #ifndef vtkWebGPUBatchedPolyDataMapper_h
12 #define vtkWebGPUBatchedPolyDataMapper_h
16 #include "vtkRenderingWebGPUModule.h"
22 VTK_ABI_NAMESPACE_BEGIN
38 void AddBatchElement(
unsigned int flatIndex,
BatchElement&& batchElement);
40 void ClearBatchElements();
46 std::vector<vtkPolyData*> GetRenderedList()
const;
53 void UnmarkBatchElements();
54 void ClearUnmarkedBatchElements();
120 bool homogeneousCellSize,
bool useEdgeArray)
override;
123 bool homogeneousCellSize,
bool useEdgeArray)
override;
162 std::map<std::uintptr_t, std::unique_ptr<BatchElement>> VTKPolyDataToBatchElement;
163 std::map<unsigned int, std::uintptr_t> FlatIndexToPolyData;
165 struct CompositeDataProperties
167 vtkTypeUInt32 ApplyOverrideColors = 0;
168 vtkTypeFloat32 Opacity = 0;
169 vtkTypeUInt32 CompositeId = 0;
170 vtkTypeUInt32 Pickable = 1;
171 vtkTypeFloat32 Ambient[3] = {};
172 vtkTypeUInt32 CellIdOffsetForVerts = 0;
173 vtkTypeFloat32 Diffuse[3] = {};
174 vtkTypeUInt32 CellIdOffsetForLines = 0;
175 vtkTypeUInt32 CellIdOffsetForPolys = 0;
176 vtkTypeUInt32 CellIdOffsetForSelector = 0;
181 std::uint64_t Size = 0;
182 std::uint32_t BindingSize = 0;
184 StorageBuffer CompositeDataPropertyStorage;
187 std::size_t CurrentDrawMeshId = 0;
188 std::uint32_t MinStorageBufferOffsetAlignment = 0;
193 VTK_ABI_NAMESPACE_END
represents an object (geometry & properties) in a rendered scene
virtual std::vector< wgpu::BindGroupEntry > GetMeshBindGroupEntries()
Allow subclasses to customize the entries in the bind group corresponding to GROUP_MESH.
vtkTypeUInt32 vtkMTimeType
represent surface properties of a geometric object
void RenderPiece(vtkRenderer *renderer, vtkActor *act) override
Implemented by sub classes.
static vtkWebGPUPolyDataMapper * New()
virtual void ReplaceFragmentShaderColors(GraphicsPipelineType pipelineType, vtkWebGPURenderer *renderer, vtkWebGPUActor *actor, std::string &fss)
record modification and/or execution time
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual unsigned long GetCellAttributeByteSize(vtkWebGPUPolyDataMapper::CellDataAttributes attribute)
Returns the size of the 'sub-buffer' within the whole cell data SSBO for the given attribute...
A WebGPU mapper for batched rendering of vtkPolyData.
virtual std::vector< wgpu::BindGroupEntry > GetTopologyBindGroupEntries(vtkWebGPUCellToPrimitiveConverter::TopologySourceType topologySourceType, bool homogeneousCellSize, bool useEdgeArray)
Allow subclasses to customize the entries in the bind group corresponding to GROUP_TOPOLOGY.
virtual void ReplaceShaderCustomDef(GraphicsPipelineType pipelineType, vtkWebGPURenderer *renderer, vtkWebGPUActor *actor, std::string &vss, std::string &fss)
abstract specification for renderers
virtual bool EnsureInput()
Ensures that the input data is valid and ready for processing.
virtual unsigned long GetPointAttributeByteSize(vtkWebGPUPolyDataMapper::PointDataAttributes attribute)
Returns the size of the 'sub-buffer' within the whole point data SSBO for the given attribute...
GraphicsPipelineType
This mapper uses different wgpu::RenderPipeline to render a list of primitives.
virtual void ReplaceFragmentShaderPicking(GraphicsPipelineType pipelineType, vtkWebGPURenderer *renderer, vtkWebGPUActor *actor, std::string &fss)
concrete dataset represents vertices, lines, polygons, and triangle strips
virtual void UpdateMeshGeometryBuffers(vtkWebGPUConfiguration *wgpuConfiguration)
Creates buffers as needed and updates them with point/cell attributes, topology, draw parameters...
virtual int CanUseTextureMapForColoring(vtkDataObject *input)
Returns if we can use texture maps for scalar coloring.
virtual void ReplaceVertexShaderCellId(GraphicsPipelineType pipelineType, vtkWebGPURenderer *renderer, vtkWebGPUActor *actor, std::string &vss)
window superclass for vtkRenderWindow
virtual DrawCallArgs GetDrawCallArgs(GraphicsPipelineType pipelineType, vtkWebGPUCellToPrimitiveConverter::TopologySourceType topologySourceType)
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
a simple class to control print indentation
virtual void UpdateMeshTopologyBuffers(vtkWebGPUConfiguration *wgpuConfiguration, vtkProperty *displayProperty)
Updates the connectivity related buffers.
vtkCompositePolyDataMapperDelegator::BatchElement BatchElement
vtkMTimeType GetMTime() override
Overload standard modified time function.
virtual bool ShouldReleaseGraphicsResourcesOnSync()
Return true if the mapper should release graphics resources from previous render during the vtkWebGPU...
virtual void ReplaceVertexShaderPicking(GraphicsPipelineType pipelineType, vtkWebGPURenderer *renderer, vtkWebGPUActor *actor, std::string &vss)
virtual void ReplaceShaderCustomBindings(GraphicsPipelineType pipelineType, vtkWebGPURenderer *renderer, vtkWebGPUActor *actor, std::string &vss, std::string &fss)
virtual void DeducePointCellAttributeAvailability()
Looks at the point/cell data of vtkPolyData object and determines which attributes are available...
virtual std::vector< wgpu::BindGroupLayoutEntry > GetTopologyBindGroupLayoutEntries(bool homogeneousCellSize, bool useEdgeArray)
Allow subclasses to customize the entries in the bind group layout corresponding to GROUP_TOPOLOGY...
Create a webgpu device for use in rendering and compute pipelines.
virtual DrawCallArgs GetDrawCallArgsForDrawingVertices(vtkWebGPUCellToPrimitiveConverter::TopologySourceType topologySourceType)
PointDataAttributes
All the attributes supported by the point data buffer.
TopologySourceType
All supported types of topology.
virtual std::vector< wgpu::BindGroupLayoutEntry > GetMeshBindGroupLayoutEntries()
Allow subclasses to customize the entries in the bind group layout corresponding to GROUP_MESH...
general representation of visualization data
CellDataAttributes
All the attributes supported by the cell data buffer.
a class that renders hierarchical polygonal data