VTK  9.2.20230326
vtkPanoramicProjectionPass.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPanoramicProjectionPass.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
33 #ifndef vtkPanoramicProjectionPass_h
34 #define vtkPanoramicProjectionPass_h
35 
36 #include "vtkImageProcessingPass.h"
37 #include "vtkRenderingOpenGL2Module.h" // For export macro
38 
39 VTK_ABI_NAMESPACE_BEGIN
42 class vtkTextureObject;
43 
44 class VTKRENDERINGOPENGL2_EXPORT vtkPanoramicProjectionPass : public vtkImageProcessingPass
45 {
46 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
54  void Render(const vtkRenderState* s) override;
55 
60 
62 
66  vtkGetMacro(CubeResolution, unsigned int);
67  vtkSetMacro(CubeResolution, unsigned int);
69 
73  enum : int
74  {
75  Equirectangular = 1,
76  Azimuthal = 2
77  };
78 
80 
88  vtkGetMacro(ProjectionType, int);
89  vtkSetClampMacro(ProjectionType, int, Equirectangular, Azimuthal);
90  void SetProjectionTypeToEquirectangular() { this->SetProjectionType(Equirectangular); }
91  void SetProjectionTypeToAzimuthal() { this->SetProjectionType(Azimuthal); }
93 
95 
101  vtkGetMacro(Angle, double);
102  vtkSetClampMacro(Angle, double, 90.0, 360.0);
104 
106 
111  vtkGetMacro(Interpolate, bool);
112  vtkSetMacro(Interpolate, bool);
113  vtkBooleanMacro(Interpolate, bool);
115 
116 protected:
118  ~vtkPanoramicProjectionPass() override = default;
119 
120  void RenderOnFace(const vtkRenderState* s, int index);
121 
123 
125 
129  vtkOpenGLFramebufferObject* FrameBufferObject = nullptr;
130  vtkTextureObject* CubeMapTexture = nullptr;
131  vtkOpenGLQuadHelper* QuadHelper = nullptr;
132 
133  unsigned int CubeResolution = 300;
134  int ProjectionType = Equirectangular;
135  double Angle = 180.0;
136  bool Interpolate = false;
137 
138 private:
140  void operator=(const vtkPanoramicProjectionPass&) = delete;
141 };
142 
143 VTK_ABI_NAMESPACE_END
144 #endif
Convenient class for post-processing passes.
a simple class to control print indentation
Definition: vtkIndent.h:120
Internal class which encapsulates OpenGL FramebufferObject.
Class to make rendering a full screen quad easier.
OpenGL rendering window.
Render pass that render the scene in a cubemap and project these six renderings to a single quad.
void InitOpenGLResources(vtkOpenGLRenderWindow *renWin)
void SetProjectionTypeToEquirectangular()
Get/Set the type of projection.
static vtkPanoramicProjectionPass * New()
void Project(vtkOpenGLRenderWindow *renWin)
~vtkPanoramicProjectionPass() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void RenderOnFace(const vtkRenderState *s, int index)
void Render(const vtkRenderState *s) override
Perform rendering according to a render state.
vtkPanoramicProjectionPass()=default
void ReleaseGraphicsResources(vtkWindow *w) override
Release graphics resources and ask components to release their own resources.
void SetProjectionTypeToAzimuthal()
Get/Set the type of projection.
Context in which a vtkRenderPass will render.
abstracts an OpenGL texture object.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:40
@ index
Definition: vtkX3D.h:258