VTK  9.2.6
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 
41 class vtkTextureObject;
42 
43 class VTKRENDERINGOPENGL2_EXPORT vtkPanoramicProjectionPass : public vtkImageProcessingPass
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
53  void Render(const vtkRenderState* s) override;
54 
58  void ReleaseGraphicsResources(vtkWindow* w) override;
59 
61 
65  vtkGetMacro(CubeResolution, unsigned int);
66  vtkSetMacro(CubeResolution, unsigned int);
68 
72  enum : int
73  {
74  Equirectangular = 1,
75  Azimuthal = 2
76  };
77 
79 
87  vtkGetMacro(ProjectionType, int);
88  vtkSetClampMacro(ProjectionType, int, Equirectangular, Azimuthal);
89  void SetProjectionTypeToEquirectangular() { this->SetProjectionType(Equirectangular); }
90  void SetProjectionTypeToAzimuthal() { this->SetProjectionType(Azimuthal); }
92 
94 
100  vtkGetMacro(Angle, double);
101  vtkSetClampMacro(Angle, double, 90.0, 360.0);
103 
105 
110  vtkGetMacro(Interpolate, bool);
111  vtkSetMacro(Interpolate, bool);
112  vtkBooleanMacro(Interpolate, bool);
114 
115 protected:
116  vtkPanoramicProjectionPass() = default;
117  ~vtkPanoramicProjectionPass() override = default;
118 
119  void RenderOnFace(const vtkRenderState* s, int index);
120 
121  void Project(vtkOpenGLRenderWindow* renWin);
122 
123  void InitOpenGLResources(vtkOpenGLRenderWindow* renWin);
124 
128  vtkOpenGLFramebufferObject* FrameBufferObject = nullptr;
129  vtkTextureObject* CubeMapTexture = nullptr;
130  vtkOpenGLQuadHelper* QuadHelper = nullptr;
131 
132  unsigned int CubeResolution = 300;
133  int ProjectionType = Equirectangular;
134  double Angle = 180.0;
135  bool Interpolate = false;
136 
137 private:
139  void operator=(const vtkPanoramicProjectionPass&) = delete;
140 };
141 
142 #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:38
Context in which a vtkRenderPass will render.
a simple class to control print indentation
Definition: vtkIndent.h:39
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.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...