• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

dox/Rendering/vtkOpenGLRenderWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkOpenGLRenderWindow.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00027 #ifndef __vtkOpenGLRenderWindow_h
00028 #define __vtkOpenGLRenderWindow_h
00029 
00030 #include "vtkRenderWindow.h"
00031 
00032 #include "vtkOpenGL.h" // Needed for GLuint.
00033 
00034 class vtkIdList;
00035 class vtkOpenGLExtensionManager;
00036 class vtkOpenGLHardwareSupport;
00037 class vtkTextureUnitManager;
00038 
00039 class VTK_RENDERING_EXPORT vtkOpenGLRenderWindow : public vtkRenderWindow
00040 {
00041 protected:
00042   long OldMonitorSetting;
00043 
00044 public:
00045   vtkTypeRevisionMacro(vtkOpenGLRenderWindow,vtkRenderWindow);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049 
00050   static void SetGlobalMaximumNumberOfMultiSamples(int val);
00051   static int  GetGlobalMaximumNumberOfMultiSamples();
00053 
00055   virtual void StereoUpdate();
00056 
00058 
00059   virtual unsigned char *GetPixelData(int x,int y,int x2,int y2,int front);
00060   virtual int GetPixelData(int x,int y,int x2,int y2, int front,
00061                            vtkUnsignedCharArray *data);
00062   virtual int SetPixelData(int x,int y,int x2,int y2,unsigned char *data,
00063                            int front);
00064   virtual int SetPixelData(int x,int y,int x2,int y2,
00065                            vtkUnsignedCharArray *data, int front);
00067 
00069 
00070   virtual float *GetRGBAPixelData(int x,int y,int x2,int y2,int front);
00071   virtual int GetRGBAPixelData(int x,int y,int x2,int y2, int front,
00072                                vtkFloatArray* data);
00073   virtual int SetRGBAPixelData(int x,int y,int x2,int y2, float *data,
00074                                int front, int blend=0);
00075   virtual int SetRGBAPixelData(int x,int y,int x2,int y2, vtkFloatArray *data,
00076                                int front, int blend=0);
00077   virtual void ReleaseRGBAPixelData(float *data);
00078   virtual unsigned char *GetRGBACharPixelData(int x,int y,int x2,int y2,
00079                                               int front);
00080   virtual int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00081                                    vtkUnsignedCharArray *data);
00082   virtual int SetRGBACharPixelData(int x, int y, int x2, int y2,
00083                                    unsigned char *data, int front,
00084                                    int blend=0);  
00085   virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,
00086                                    vtkUnsignedCharArray *data, int front,
00087                                    int blend=0);  
00089 
00091 
00092   virtual float *GetZbufferData( int x1, int y1, int x2, int y2 );
00093   virtual int GetZbufferData( int x1, int y1, int x2, int y2, float* z );
00094   virtual int GetZbufferData( int x1, int y1, int x2, int y2,
00095                               vtkFloatArray* z );
00096   virtual int SetZbufferData( int x1, int y1, int x2, int y2, float *buffer );
00097   virtual int SetZbufferData( int x1, int y1, int x2, int y2,
00098                               vtkFloatArray *buffer );
00100 
00102   void MakeCurrent() = 0;
00103   
00106   virtual bool IsCurrent()=0;
00107   
00109   void RegisterTextureResource (GLuint id);
00110 
00112   int GetDepthBufferSize();
00113 
00116   int GetColorBufferSizes(int *rgba);
00117   
00119   virtual void OpenGLInit();
00120 
00126   unsigned int GetBackLeftBuffer();
00127   
00133   unsigned int GetBackRightBuffer();
00134   
00140   unsigned int GetFrontLeftBuffer();
00141   
00147   unsigned int GetFrontRightBuffer();
00148   
00154   unsigned int GetBackBuffer();
00155   
00161   unsigned int GetFrontBuffer();
00162   
00166   virtual void CheckGraphicError();
00167   
00169   virtual int HasGraphicError();
00170   
00172   virtual const char *GetLastGraphicErrorString();
00173 
00175 
00176   vtkGetMacro(ContextCreationTime, vtkTimeStamp);
00178 
00181   vtkOpenGLExtensionManager* GetExtensionManager();
00182 
00185   vtkOpenGLHardwareSupport* GetHardwareSupport();
00186  
00187   //BTX
00189 
00191   vtkTextureUnitManager *GetTextureUnitManager();
00192   //ETX
00194   
00195 protected:
00196   vtkOpenGLRenderWindow();
00197   ~vtkOpenGLRenderWindow();
00198 
00199   vtkIdList *TextureResourceIds;
00200 
00201   int GetPixelData(int x,int y,int x2,int y2,int front, unsigned char* data);
00202   int GetRGBAPixelData(int x,int y,int x2,int y2, int front, float* data);
00203   int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00204                            unsigned char* data);
00205   
00211   int CreateHardwareOffScreenWindow(int width, int height);
00212   
00216   void DestroyHardwareOffScreenWindow();
00217   
00219   int OffScreenUseFrameBuffer;
00220   
00222 
00223   int NumberOfFrameBuffers;
00224   unsigned int TextureObjects[4]; // really GLuint
00225   unsigned int FrameBufferObject; // really GLuint
00226   unsigned int DepthRenderBufferObject; // really GLuint
00228   
00230   virtual void CreateAWindow()=0;
00231   
00233   virtual void DestroyWindow()=0;
00234   
00236   void SetTextureUnitManager(vtkTextureUnitManager *textureUnitManager);
00237   
00238   unsigned int BackLeftBuffer;
00239   unsigned int BackRightBuffer;
00240   unsigned int FrontLeftBuffer;
00241   unsigned int FrontRightBuffer;
00242   unsigned int FrontBuffer;
00243   unsigned int BackBuffer;
00244   
00245   // Actual type is GLenum. Last value returned by glGetError().
00246   unsigned int LastGraphicError;
00247  
00248   vtkTimeStamp ContextCreationTime;
00249   
00250   vtkTextureUnitManager *TextureUnitManager;
00251   
00252 private:
00253   vtkOpenGLRenderWindow(const vtkOpenGLRenderWindow&);  // Not implemented.
00254   void operator=(const vtkOpenGLRenderWindow&);  // Not implemented.
00255 
00256   void SetExtensionManager(vtkOpenGLExtensionManager*);
00257   void SetHardwareSupport(vtkOpenGLHardwareSupport * renderWindow);
00258 
00259   vtkOpenGLExtensionManager* ExtensionManager;
00260   vtkOpenGLHardwareSupport* HardwareSupport;
00261 };
00262 
00263 #endif

Generated by  doxygen 1.7.1