VTK  9.6.20260205
vtkWebGPUCamera.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 vtkWebGPUCamera_h
4#define vtkWebGPUCamera_h
5
6#include "vtkCamera.h"
7
8#include "vtkMatrix4x4.h" // for ivar
9#include "vtkNew.h" // for ivar
10#include "vtkRenderingWebGPUModule.h" // for export macro
11#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
12
13VTK_ABI_NAMESPACE_BEGIN
14class vtkActor;
15class vtkMatrix3x3;
17
18class VTKRENDERINGWEBGPU_EXPORT VTK_MARSHALAUTO vtkWebGPUCamera : public vtkCamera
19{
20public:
24 vtkTypeMacro(vtkWebGPUCamera, vtkCamera);
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
28 inline void* GetCachedSceneTransforms() { return &(this->CachedSceneTransforms); }
29 static std::size_t GetCacheSizeBytes() { return sizeof(SceneTransforms); }
30
37 void Render(vtkRenderer* renderer) override;
38
43 void UpdateViewport(vtkRenderer* renderer) override;
44
45protected:
47 ~vtkWebGPUCamera() override;
48
52
53 // Pack uniforms as needed.
55 {
56 // Viewport dimensions
57 vtkTypeFloat32 Viewport[4];
58 // World -> Camera space
59 vtkTypeFloat32 ViewMatrix[4][4] = {};
60 // Camera space -> Clipped space
61 vtkTypeFloat32 ProjectionMatrix[4][4] = {};
62 // Normal matrix Inverted and transposed ViewMatrix
63 vtkTypeFloat32 NormalMatrix[3][4] = {};
64 // Clipped space -> Camera space
65 vtkTypeFloat32 InvertedProjectionMatrix[4][4] = {};
66 // Custom flags used to encode various integer/boolean properties.
67 vtkTypeUInt32 Flags = 0;
68 };
70
71private:
72 vtkWebGPUCamera(const vtkWebGPUCamera&) = delete;
73 void operator=(const vtkWebGPUCamera&) = delete;
74};
75
76#define vtkWebGPUCamera_OVERRIDE_ATTRIBUTES vtkWebGPUCamera::CreateOverrideAttributes()
77VTK_ABI_NAMESPACE_END
78#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 3x3 transformation matrices
Allocate and hold a VTK object.
Definition vtkNew.h:167
Attribute for vtkObjectFactory overrides.
abstract specification for renderers
record modification and/or execution time
~vtkWebGPUCamera() override
void * GetCachedSceneTransforms()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTimeStamp KeyMatrixTime
vtkNew< vtkMatrix3x3 > NormalMatrix
vtkRenderer * LastRenderer
static vtkWebGPUCamera * New()
SceneTransforms CachedSceneTransforms
void Render(vtkRenderer *renderer) override
Implement base class method.
void UpdateViewport(vtkRenderer *renderer) override
Invokes setViewport, setScissor (if needed) followed by updating the view, projection buffers.
static std::size_t GetCacheSizeBytes()
void CacheSceneTransforms(vtkRenderer *renderer)
static vtkOverrideAttribute * CreateOverrideAttributes()
vtkTypeFloat32 NormalMatrix[3][4]
vtkTypeFloat32 ProjectionMatrix[4][4]
vtkTypeFloat32 InvertedProjectionMatrix[4][4]
#define VTK_MARSHALAUTO
#define VTK_NEWINSTANCE