VTK  9.7.1
vtkWebGPUActor.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 #ifndef vtkWebGPUActor_h
4 #define vtkWebGPUActor_h
5 
6 #include "vtkActor.h"
7 
8 #include "vtkProperty.h" // for VTK_FLAT
9 #include "vtkRenderingWebGPUModule.h" // for export macro
10 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
11 
12 #include <memory> // for unique_ptr
13 
14 VTK_ABI_NAMESPACE_BEGIN
15 class vtkMatrix3x3;
20 class VTKRENDERINGWEBGPU_EXPORT VTK_MARSHALAUTO vtkWebGPUActor : public vtkActor
21 {
22 public:
23  static vtkWebGPUActor* New();
25  static vtkOverrideAttribute* CreateOverrideAttributes();
26  vtkTypeMacro(vtkWebGPUActor, vtkActor);
27  void PrintSelf(ostream& os, vtkIndent indent) override;
28 
29  void ReleaseGraphicsResources(vtkWindow* window) override;
30 
31  void ShallowCopy(vtkProp* other) override;
32 
36  void Render(vtkRenderer* renderer, vtkMapper* mapper) override;
37 
39 
52  vtkTypeBool HasOpaqueGeometry() override;
55 
56 protected:
58  ~vtkWebGPUActor() override;
59 
60 private:
61  // for accessing SupportsRenderBundles
62  friend class vtkWebGPURenderer;
63  // for accessing vtkWebGPUActorInternals::PopulateBindGroupLayouts
65  friend class vtkWebGPUGlyph3DMapperHelper;
66 
67  vtkWebGPUActor(const vtkWebGPUActor&) = delete;
68  void operator=(const vtkWebGPUActor&) = delete;
69 
70  std::unique_ptr<vtkWebGPUActorInternals> Internals;
71 
78  bool SupportRenderBundles();
79  void SetId(vtkTypeUInt32 id);
80 
81  bool UpdateKeyMatrices();
82 
83  const void* GetCachedActorInformation();
84  static std::size_t GetCacheSizeBytes();
85 
86  bool CacheActorTransforms();
87  bool CacheActorRenderOptions();
88  bool CacheActorShadeOptions();
89  bool CacheActorId();
90 
91  bool NeedToRecreateBindGroups();
92  void CreateBindGroups(vtkWebGPUConfiguration* wgpuConfiguration);
93 };
94 
95 #define vtkWebGPUActor_OVERRIDE_ATTRIBUTES vtkWebGPUActor::CreateOverrideAttributes()
96 VTK_ABI_NAMESPACE_END
97 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
Attribute for vtkObjectFactory overrides.
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:83
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ShallowCopy(vtkProp *prop) override
Shallow copy of an actor.
abstract specification for renderers
Definition: vtkRenderer.h:63
static vtkActor * New()
Creates an actor with the following defaults: origin(0,0,0) position=(0,0,0) scale=(1,1,1) visibility=1 pickable=1 dragable=1 orientation=(0,0,0).
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_NEWINSTANCE
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:77
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
Create a webgpu device for use in rendering and compute pipelines.
vtkTypeBool HasOpaqueGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
#define VTK_MARSHALAUTO
represent and manipulate 3x3 transformation matrices
Definition: vtkMatrix3x3.h:26
Class to create and retrieve render pipelines based on a given key.