VTK  9.7.1
vtkPanoramicProjectionPass.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
21 #ifndef vtkPanoramicProjectionPass_h
22 #define vtkPanoramicProjectionPass_h
23 
24 #include "vtkImageProcessingPass.h"
25 #include "vtkRenderingOpenGL2Module.h" // For export macro
26 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
27 
28 VTK_ABI_NAMESPACE_BEGIN
31 class vtkTextureObject;
32 
33 class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkPanoramicProjectionPass
34  : public vtkImageProcessingPass
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  void Render(const vtkRenderState* s) override;
45 
49  void ReleaseGraphicsResources(vtkWindow* w) override;
50 
52 
56  vtkGetMacro(CubeResolution, unsigned int);
57  vtkSetMacro(CubeResolution, unsigned int);
59 
63  enum : int
64  {
65  Equirectangular = 1,
66  Azimuthal = 2
67  };
68 
70 
78  vtkGetMacro(ProjectionType, int);
79  vtkSetClampMacro(ProjectionType, int, Equirectangular, Azimuthal);
80  void SetProjectionTypeToEquirectangular() { this->SetProjectionType(Equirectangular); }
81  void SetProjectionTypeToAzimuthal() { this->SetProjectionType(Azimuthal); }
83 
85 
91  vtkGetMacro(Angle, double);
92  vtkSetClampMacro(Angle, double, 90.0, 360.0);
94 
96 
101  vtkGetMacro(Interpolate, bool);
102  vtkSetMacro(Interpolate, bool);
103  vtkBooleanMacro(Interpolate, bool);
105 
106 protected:
107  vtkPanoramicProjectionPass() = default;
108  ~vtkPanoramicProjectionPass() override = default;
109 
110  void RenderOnFace(const vtkRenderState* s, int index);
111 
112  void Project(vtkOpenGLRenderWindow* renWin);
113 
114  void InitOpenGLResources(vtkOpenGLRenderWindow* renWin);
115 
119  vtkOpenGLFramebufferObject* FrameBufferObject = nullptr;
120  vtkTextureObject* CubeMapTexture = nullptr;
121  vtkOpenGLQuadHelper* QuadHelper = nullptr;
122 
123  unsigned int CubeResolution = 300;
124  int ProjectionType = Equirectangular;
125  double Angle = 180.0;
126  bool Interpolate = false;
127 
128 private:
130  void operator=(const vtkPanoramicProjectionPass&) = delete;
131 };
132 
133 VTK_ABI_NAMESPACE_END
134 #endif
OpenGL rendering window.
void SetProjectionTypeToEquirectangular()
Get/Set the type of projection.
void ReleaseGraphicsResources(vtkWindow *w) override
Release graphics resources and ask components to release their own resources.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Convenient class for post-processing passes.
Render pass that render the scene in a cubemap and project these six renderings to a single quad...
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
Context in which a vtkRenderPass will render.
a simple class to control print indentation
Definition: vtkIndent.h:28
Internal class which encapsulates OpenGL FramebufferObject.
abstracts an OpenGL texture object.
virtual void Render(const vtkRenderState *s)=0
Perform rendering according to a render state s.
void SetProjectionTypeToAzimuthal()
Get/Set the type of projection.
Class to make rendering a full screen quad easier.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...