VTK
vtkOpenGLRenderWindow.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLRenderWindow.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 =========================================================================*/
27 #ifndef vtkOpenGLRenderWindow_h
28 #define vtkOpenGLRenderWindow_h
29 
30 #include "vtkRenderingOpenGLModule.h" // For export macro
31 #include "vtkRenderWindow.h"
32 #include "vtkOpenGL.h" // Needed for GLuint.
33 
34 class vtkIdList;
38 class vtkStdString;
39 
41 {
42 public:
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
47 
51 
53  virtual void StereoUpdate();
54 
56 
57  virtual unsigned char *GetPixelData(int x,int y,int x2,int y2,int front);
58  virtual int GetPixelData(int x,int y,int x2,int y2, int front,
60  virtual int SetPixelData(int x,int y,int x2,int y2,unsigned char *data,
61  int front);
62  virtual int SetPixelData(int x,int y,int x2,int y2,
63  vtkUnsignedCharArray *data, int front);
65 
67 
68  virtual float *GetRGBAPixelData(int x,int y,int x2,int y2,int front);
69  virtual int GetRGBAPixelData(int x,int y,int x2,int y2, int front,
71  virtual int SetRGBAPixelData(int x,int y,int x2,int y2, float *data,
72  int front, int blend=0);
73  virtual int SetRGBAPixelData(int x,int y,int x2,int y2, vtkFloatArray *data,
74  int front, int blend=0);
75  virtual void ReleaseRGBAPixelData(float *data);
76  virtual unsigned char *GetRGBACharPixelData(int x,int y,int x2,int y2,
77  int front);
78  virtual int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
80  virtual int SetRGBACharPixelData(int x, int y, int x2, int y2,
81  unsigned char *data, int front,
82  int blend=0);
83  virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,
84  vtkUnsignedCharArray *data, int front,
85  int blend=0);
87 
89 
90  virtual float *GetZbufferData( int x1, int y1, int x2, int y2 );
91  virtual int GetZbufferData( int x1, int y1, int x2, int y2, float* z );
92  virtual int GetZbufferData( int x1, int y1, int x2, int y2,
93  vtkFloatArray* z );
94  virtual int SetZbufferData( int x1, int y1, int x2, int y2, float *buffer );
95  virtual int SetZbufferData( int x1, int y1, int x2, int y2,
98 
101 
104 
107  int GetColorBufferSizes(int *rgba);
108 
110  virtual void OpenGLInit();
111 
112  // Initialize the state of OpenGL that VTK wants for this window
113  virtual void OpenGLInitState();
114 
115  // Initialize VTK for rendering in a new OpenGL context
116  virtual void OpenGLInitContext();
117 
123  unsigned int GetBackLeftBuffer();
124 
130  unsigned int GetBackRightBuffer();
131 
137  unsigned int GetFrontLeftBuffer();
138 
144  unsigned int GetFrontRightBuffer();
145 
151  unsigned int GetBackBuffer();
152 
158  unsigned int GetFrontBuffer();
159 
161  virtual unsigned long GetContextCreationTime();
162 
166 
170 
171  //BTX
173 
176  //ETX
178 
181  virtual void WaitForCompletion();
182 
183 protected:
186 
189 
190  int GetPixelData(int x, int y, int x2, int y2, int front, unsigned char* data);
191  int GetRGBAPixelData(int x, int y, int x2, int y2, int front, float* data);
192  int GetRGBACharPixelData(int x, int y, int x2, int y2, int front,
193  unsigned char* data);
194 
201 
206 
209 
211 
213  unsigned int TextureObjects[4]; // really GLuint
214  unsigned int FrameBufferObject; // really GLuint
215  unsigned int DepthRenderBufferObject; // really GLuint
217 
219  virtual void CreateAWindow() = 0;
220 
222  virtual void DestroyWindow() = 0;
223 
225  void SetTextureUnitManager(vtkTextureUnitManager *textureUnitManager);
226 
227  unsigned int BackLeftBuffer;
228  unsigned int BackRightBuffer;
229  unsigned int FrontLeftBuffer;
230  unsigned int FrontRightBuffer;
231  unsigned int FrontBuffer;
232  unsigned int BackBuffer;
233 
236 
238 
240 
241 private:
242  vtkOpenGLRenderWindow(const vtkOpenGLRenderWindow&); // Not implemented.
243  void operator=(const vtkOpenGLRenderWindow&); // Not implemented.
244 
245  void SetExtensionManager(vtkOpenGLExtensionManager*);
246  void SetHardwareSupport(vtkOpenGLHardwareSupport * renderWindow);
247 
248  vtkOpenGLExtensionManager* ExtensionManager;
249  vtkOpenGLHardwareSupport* HardwareSupport;
250 };
251 
252 #endif
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkOpenGLRenderWindow::SetPixelData
virtual int SetPixelData(int x, int y, int x2, int y2, unsigned char *data, int front)
vtkOpenGLRenderWindow::OpenGLInit
virtual void OpenGLInit()
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkOpenGLRenderWindow::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkOpenGLRenderWindow::SetZbufferData
virtual int SetZbufferData(int x1, int y1, int x2, int y2, float *buffer)
vtkOpenGLRenderWindow::NumberOfFrameBuffers
int NumberOfFrameBuffers
Definition: vtkOpenGLRenderWindow.h:212
vtkOpenGLRenderWindow::GetZbufferData
virtual int GetZbufferData(int x1, int y1, int x2, int y2, float *z)
vtkOpenGLRenderWindow::DestroyHardwareOffScreenWindow
void DestroyHardwareOffScreenWindow()
vtkOpenGLRenderWindow::SetPixelData
virtual int SetPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front)
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:49
vtkOpenGLRenderWindow::SetRGBAPixelData
virtual int SetRGBAPixelData(int x, int y, int x2, int y2, float *data, int front, int blend=0)
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkOpenGLRenderWindow::SetTextureUnitManager
void SetTextureUnitManager(vtkTextureUnitManager *textureUnitManager)
vtkRenderingOpenGLModule.h
vtkOpenGLRenderWindow::TextureUnitManager
vtkTextureUnitManager * TextureUnitManager
Definition: vtkOpenGLRenderWindow.h:239
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:49
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkOpenGL.h
vtkRenderWindow.h
vtkOpenGLRenderWindow::OldMonitorSetting
long OldMonitorSetting
Definition: vtkOpenGLRenderWindow.h:187
vtkOpenGLRenderWindow::CreateHardwareOffScreenWindow
int CreateHardwareOffScreenWindow(int width, int height)
vtkOpenGLRenderWindow::FrameBufferObject
unsigned int FrameBufferObject
Definition: vtkOpenGLRenderWindow.h:214
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkOpenGLRenderWindow::GetContextCreationTime
virtual unsigned long GetContextCreationTime()
vtkOpenGLRenderWindow::GetBackLeftBuffer
unsigned int GetBackLeftBuffer()
vtkOpenGLRenderWindow::SetRGBACharPixelData
virtual int SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0)
vtkOpenGLRenderWindow::OffScreenUseFrameBuffer
int OffScreenUseFrameBuffer
Definition: vtkOpenGLRenderWindow.h:208
vtkOpenGLRenderWindow::FrontRightBuffer
unsigned int FrontRightBuffer
Definition: vtkOpenGLRenderWindow.h:230
vtkOpenGLRenderWindow::GetBackRightBuffer
unsigned int GetBackRightBuffer()
vtkOpenGLRenderWindow::~vtkOpenGLRenderWindow
~vtkOpenGLRenderWindow()
vtkOpenGLRenderWindow::GetZbufferData
virtual int GetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *z)
vtkOpenGLRenderWindow::SetRGBACharPixelData
virtual int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front, int blend=0)
vtkOpenGLRenderWindow::FrontBuffer
unsigned int FrontBuffer
Definition: vtkOpenGLRenderWindow.h:231
vtkOpenGLRenderWindow::GetRGBACharPixelData
virtual unsigned char * GetRGBACharPixelData(int x, int y, int x2, int y2, int front)
vtkgl::val
GLuint GLfloat * val
Definition: vtkgl.h:13789
vtkOpenGLRenderWindow::GetZbufferData
virtual float * GetZbufferData(int x1, int y1, int x2, int y2)
vtkOpenGLRenderWindow::ContextCreationTime
vtkTimeStamp ContextCreationTime
Definition: vtkOpenGLRenderWindow.h:237
vtkOpenGLRenderWindow::GetRGBAPixelData
int GetRGBAPixelData(int x, int y, int x2, int y2, int front, float *data)
vtkOpenGLExtensionManager
Interface class for querying and using OpenGL extensions.
vtkTextureUnitManager
allocate/free texture units.
Definition: vtkTextureUnitManager.h:38
vtkOpenGLRenderWindow::WaitForCompletion
virtual void WaitForCompletion()
vtkOpenGLRenderWindow::GetPixelData
virtual int GetPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data)
vtkOpenGLHardwareSupport
OpenGL rendering window.
Definition: vtkOpenGLHardwareSupport.h:38
vtkOpenGLRenderWindow::GetPixelData
virtual unsigned char * GetPixelData(int x, int y, int x2, int y2, int front)
vtkOpenGLRenderWindow::GetPixelData
int GetPixelData(int x, int y, int x2, int y2, int front, unsigned char *data)
vtkOpenGLRenderWindow::OpenGLInitState
virtual void OpenGLInitState()
vtkOpenGLRenderWindow::OwnContext
int OwnContext
Definition: vtkOpenGLRenderWindow.h:235
vtkOpenGLRenderWindow::OpenGLInitContext
virtual void OpenGLInitContext()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkOpenGLRenderWindow::GetExtensionManager
vtkOpenGLExtensionManager * GetExtensionManager()
vtkOpenGLRenderWindow::StereoUpdate
virtual void StereoUpdate()
vtkOpenGLRenderWindow::GetFrontBuffer
unsigned int GetFrontBuffer()
vtkOpenGLRenderWindow::FrontLeftBuffer
unsigned int FrontLeftBuffer
Definition: vtkOpenGLRenderWindow.h:229
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkOpenGLRenderWindow::SetZbufferData
virtual int SetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *buffer)
vtkgl::GLuint
typedef GLuint(APIENTRYP PFNGLCREATEPROGRAMPROC)(void)
vtkOpenGLRenderWindow::GetBackBuffer
unsigned int GetBackBuffer()
vtkOpenGLRenderWindow::GetTextureUnitManager
vtkTextureUnitManager * GetTextureUnitManager()
vtkOpenGLRenderWindow::RegisterTextureResource
void RegisterTextureResource(GLuint id)
vtkgl::width
GLint GLint GLsizei width
Definition: vtkgl.h:11316
vtkOpenGLRenderWindow::GetFrontLeftBuffer
unsigned int GetFrontLeftBuffer()
vtkOpenGLRenderWindow::GetFrontRightBuffer
unsigned int GetFrontRightBuffer()
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkgl::buffer
GLuint buffer
Definition: vtkgl.h:11839
vtkOpenGLRenderWindow::GetRGBAPixelData
virtual float * GetRGBAPixelData(int x, int y, int x2, int y2, int front)
vtkOpenGLRenderWindow::BackRightBuffer
unsigned int BackRightBuffer
Definition: vtkOpenGLRenderWindow.h:228
vtkOpenGLRenderWindow::vtkOpenGLRenderWindow
vtkOpenGLRenderWindow()
vtkOpenGLRenderWindow::GetHardwareSupport
vtkOpenGLHardwareSupport * GetHardwareSupport()
vtkOpenGLRenderWindow::DestroyWindow
virtual void DestroyWindow()=0
vtkOpenGLRenderWindow::GetGlobalMaximumNumberOfMultiSamples
static int GetGlobalMaximumNumberOfMultiSamples()
vtkOpenGLRenderWindow::GetColorBufferSizes
int GetColorBufferSizes(int *rgba)
vtkOpenGLRenderWindow::BackLeftBuffer
unsigned int BackLeftBuffer
Definition: vtkOpenGLRenderWindow.h:227
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:41
vtkOpenGLRenderWindow::ReleaseRGBAPixelData
virtual void ReleaseRGBAPixelData(float *data)
vtkOpenGLRenderWindow::GetDepthBufferSize
int GetDepthBufferSize()
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:89
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:48
vtkOpenGLRenderWindow::DepthRenderBufferObject
unsigned int DepthRenderBufferObject
Definition: vtkOpenGLRenderWindow.h:215
vtkOpenGLRenderWindow::BackBuffer
unsigned int BackBuffer
Definition: vtkOpenGLRenderWindow.h:232
vtkOpenGLRenderWindow::GetRGBAPixelData
virtual int GetRGBAPixelData(int x, int y, int x2, int y2, int front, vtkFloatArray *data)
vtkOpenGLRenderWindow::SetGlobalMaximumNumberOfMultiSamples
static void SetGlobalMaximumNumberOfMultiSamples(int val)
vtkOpenGLRenderWindow::SetRGBAPixelData
virtual int SetRGBAPixelData(int x, int y, int x2, int y2, vtkFloatArray *data, int front, int blend=0)
vtkOpenGLRenderWindow::GetRGBACharPixelData
virtual int GetRGBACharPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data)
vtkOpenGLRenderWindow::TextureResourceIds
vtkIdList * TextureResourceIds
Definition: vtkOpenGLRenderWindow.h:188
vtkOpenGLRenderWindow::CreateAWindow
virtual void CreateAWindow()=0
vtkOpenGLRenderWindow::GetRGBACharPixelData
int GetRGBACharPixelData(int x, int y, int x2, int y2, int front, unsigned char *data)
VTKRENDERINGOPENGL_EXPORT
#define VTKRENDERINGOPENGL_EXPORT
Definition: vtkRenderingOpenGLModule.h:15
vtkgl::height
GLint GLint GLsizei GLsizei height
Definition: vtkgl.h:11316