VTK  9.0.20200808
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 =========================================================================*/
30 #ifndef vtkPanoramicProjectionPass_h
31 #define vtkPanoramicProjectionPass_h
32 
33 #include "vtkImageProcessingPass.h"
34 #include "vtkRenderingOpenGL2Module.h" // For export macro
35 
38 class vtkTextureObject;
39 
40 class VTKRENDERINGOPENGL2_EXPORT vtkPanoramicProjectionPass : public vtkImageProcessingPass
41 {
42 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  void Render(const vtkRenderState* s) override;
51 
55  void ReleaseGraphicsResources(vtkWindow* w) override;
56 
58 
62  vtkGetMacro(CubeResolution, unsigned int);
63  vtkSetMacro(CubeResolution, unsigned int);
65 
69  enum : int
70  {
71  Equirectangular = 1,
72  Azimuthal = 2
73  };
74 
76 
84  vtkGetMacro(ProjectionType, int);
85  vtkSetClampMacro(ProjectionType, int, Equirectangular, Azimuthal);
86  void SetProjectionTypeToEquirectangular() { this->SetProjectionType(Equirectangular); }
87  void SetProjectionTypeToAzimuthal() { this->SetProjectionType(Azimuthal); }
89 
91 
97  vtkGetMacro(Angle, double);
98  vtkSetClampMacro(Angle, double, 90.0, 360.0);
100 
102 
107  vtkGetMacro(Interpolate, bool);
108  vtkSetMacro(Interpolate, bool);
109  vtkBooleanMacro(Interpolate, bool);
111 
112 protected:
113  vtkPanoramicProjectionPass() = default;
114  ~vtkPanoramicProjectionPass() override = default;
115 
116  void RenderOnFace(const vtkRenderState* s, int index);
117 
118  void Project(vtkOpenGLRenderWindow* renWin);
119 
120  void InitOpenGLResources(vtkOpenGLRenderWindow* renWin);
121 
125  vtkOpenGLFramebufferObject* FrameBufferObject = nullptr;
126  vtkTextureObject* CubeMapTexture = nullptr;
127  vtkOpenGLQuadHelper* QuadHelper = nullptr;
128 
129  unsigned int CubeResolution = 300;
130  int ProjectionType = Equirectangular;
131  double Angle = 180.0;
132  bool Interpolate = false;
133 
134 private:
136  void operator=(const vtkPanoramicProjectionPass&) = delete;
137 };
138 
139 #endif
vtkImageProcessingPass::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPanoramicProjectionPass::SetProjectionTypeToAzimuthal
void SetProjectionTypeToAzimuthal()
Definition: vtkPanoramicProjectionPass.h:87
vtkImageProcessingPass.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkRenderPass::Render
virtual void Render(const vtkRenderState *s)=0
Perform rendering according to a render state s.
vtkOpenGLFramebufferObject
Internal class which encapsulates OpenGL FramebufferObject.
Definition: vtkOpenGLFramebufferObject.h:181
vtkOpenGLQuadHelper
Class to make rendering a full screen quad easier.
Definition: vtkOpenGLQuadHelper.h:57
vtkImageProcessingPass::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *w) override
Release graphics resources and ask components to release their own resources.
vtkPanoramicProjectionPass::SetProjectionTypeToEquirectangular
void SetProjectionTypeToEquirectangular()
Definition: vtkPanoramicProjectionPass.h:86
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:40
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:53
vtkRenderState
Context in which a vtkRenderPass will render.
Definition: vtkRenderState.h:40
vtkX3D::index
Definition: vtkX3D.h:252
vtkPanoramicProjectionPass
Render pass that render the scene in a cubemap and project these six renderings to a single quad....
Definition: vtkPanoramicProjectionPass.h:40
vtkImageProcessingPass
Convenient class for post-processing passes. render pass.
Definition: vtkImageProcessingPass.h:38