VTK
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 
101 protected:
102  vtkPanoramicProjectionPass() = default;
103  ~vtkPanoramicProjectionPass() override = default;
104 
105  void RenderOnFace(const vtkRenderState* s, int index);
106 
107  void Project(vtkOpenGLRenderWindow* renWin);
108 
109  void InitOpenGLResources(vtkOpenGLRenderWindow* renWin);
110 
114  vtkOpenGLFramebufferObject* FrameBufferObject = nullptr;
115  vtkTextureObject* CubeMapTexture = nullptr;
116  vtkOpenGLQuadHelper* QuadHelper = nullptr;
117 
118  unsigned int CubeResolution = 300;
119  int ProjectionType = Equirectangular;
120  double Angle = 180.0;
121 
122 private:
124  void operator=(const vtkPanoramicProjectionPass&) = delete;
125 };
126 
127 #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:37
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...