VTK  9.7.1
vtkWebGPUCompositePolyDataMapperDelegator.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
14 #ifndef vtkWebGPUCompositePolyDataMapperDelegator_h
15 #define vtkWebGPUCompositePolyDataMapperDelegator_h
16 
18 
19 #include "vtkRenderingWebGPUModule.h" // for export macro
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 
25 
26 class VTKRENDERINGWEBGPU_EXPORT vtkWebGPUCompositePolyDataMapperDelegator
28 {
29 public:
32  static vtkOverrideAttribute* CreateOverrideAttributes();
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
37 
39 
42  // Copy array names used for selection. Ex: PointIdArrayName, CompositeIdArrayName, ..
43  void ShallowCopy(vtkCompositePolyDataMapper* mapper) override;
44  void ClearUnmarkedBatchElements() override;
45  void UnmarkBatchElements() override;
47 
48 protected:
51 
53 
56  std::vector<vtkPolyData*> GetRenderedList() const override;
57  void SetParent(vtkCompositePolyDataMapper* mapper) override;
58  void Insert(BatchElement&& item) override;
59  BatchElement* Get(vtkPolyData* polydata) override;
60  void Clear() override;
62 
63  // The actual mapper which renders multiple vtkPolyData.
64  // Constructor assigns it to vtkBatchedPolyDataMapperDelegator::Delegate.
65  // From that point on, parent class manages lifetime of this WebGPUDelegate.
66  // Instead of repeatedly downcasting the abstract Delegate, we trampoline
67  // calls to WebGPUDelegate.
68  vtkWebGPUBatchedPolyDataMapper* WebGPUDelegate = nullptr;
69 
70 private:
73  void operator=(const vtkWebGPUCompositePolyDataMapperDelegator&) = delete;
74 };
75 
76 #define vtkWebGPUCompositePolyDataMapperDelegator_OVERRIDE_ATTRIBUTES \
77  vtkWebGPUCompositePolyDataMapperDelegator::CreateOverrideAttributes()
78 VTK_ABI_NAMESPACE_END
79 #endif
Attribute for vtkObjectFactory overrides.
virtual void UnmarkBatchElements()=0
Keep track of what data is being used as the structure can change.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void ClearUnmarkedBatchElements()=0
Keep track of what data is being used as the structure can change.
An OpenGL delegator for batched rendering of multiple polydata with similar structure.
virtual void ShallowCopy(vtkCompositePolyDataMapper *polydataMapper)
Shallow copies scalar array related properties into the delegate.
A WebGPU mapper for batched rendering of vtkPolyData.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
Delegates rendering of multiple polydata that share similar signatures.
virtual std::vector< vtkPolyData * > GetRenderedList() const =0
Accessor to the ordered list of PolyData that we last drew.
a simple class to control print indentation
Definition: vtkIndent.h:28
static vtkCompositePolyDataMapperDelegator * New()
virtual void SetParent(vtkCompositePolyDataMapper *mapper)=0
Assign a parent mapper.
#define VTK_NEWINSTANCE
virtual BatchElement * Get(vtkPolyData *polydata)=0
Get the batch element that describes attributes for a vtkPolyData.
virtual void Clear()=0
Clear all batch elements.
virtual void Insert(BatchElement &&element)=0
Add input polydata and it's rendering attributes to internal storage.
a class that renders hierarchical polygonal data