Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

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 =========================================================================*/
00024 #ifndef __vtkOpenGLRenderWindow_h
00025 #define __vtkOpenGLRenderWindow_h
00026 
00027 #include "vtkRenderWindow.h"
00028 
00029 #if defined(__APPLE__) && (defined(VTK_USE_CARBON) || defined(VTK_USE_COCOA))
00030 #include <OpenGL/gl.h> // Needed for GLuint
00031 #else
00032 #include <GL/gl.h> // Needed for GLuint
00033 #endif
00034 
00035 class vtkIdList;
00036 
00037 class VTK_RENDERING_EXPORT vtkOpenGLRenderWindow : public vtkRenderWindow
00038 {
00039 protected:
00040   int MultiSamples;
00041   long OldMonitorSetting;
00042 
00043 public:
00044   vtkTypeRevisionMacro(vtkOpenGLRenderWindow,vtkRenderWindow);
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00048 
00049   static void SetGlobalMaximumNumberOfMultiSamples(int val);
00050   static int  GetGlobalMaximumNumberOfMultiSamples();
00052 
00054 
00056   vtkSetMacro(MultiSamples,int);
00057   vtkGetMacro(MultiSamples,int);
00059 
00061   virtual void StereoUpdate();
00062 
00064 
00065   virtual unsigned char *GetPixelData(int x,int y,int x2,int y2,int front);
00066   virtual int GetPixelData(int x,int y,int x2,int y2, int front,
00067                            vtkUnsignedCharArray*);
00068   virtual int SetPixelData(int x,int y,int x2,int y2,unsigned char *,
00069                            int front);
00070   virtual int SetPixelData(int x,int y,int x2,int y2, vtkUnsignedCharArray*,
00071                            int front);
00073 
00075 
00076   virtual float *GetRGBAPixelData(int x,int y,int x2,int y2,int front);
00077   virtual int GetRGBAPixelData(int x,int y,int x2,int y2, int front,
00078                                vtkFloatArray* data);
00079   virtual int SetRGBAPixelData(int x,int y,int x2,int y2,float *,int front,
00080                                int blend=0);
00081   virtual int SetRGBAPixelData(int x,int y,int x2,int y2, vtkFloatArray*,
00082                                int front, int blend=0);
00083   virtual void ReleaseRGBAPixelData(float *data);
00084   virtual unsigned char *GetRGBACharPixelData(int x,int y,int x2,int y2,
00085                                               int front);
00086   virtual int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00087                                    vtkUnsignedCharArray* data);
00088   virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,unsigned char *,
00089                                    int front, int blend=0);  
00090   virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,
00091                                    vtkUnsignedCharArray *,
00092                                    int front, int blend=0);  
00094 
00096 
00097   virtual float *GetZbufferData( int x1, int y1, int x2, int y2 );
00098   virtual int GetZbufferData( int x1, int y1, int x2, int y2,
00099                               vtkFloatArray* z );
00100   virtual int SetZbufferData( int x1, int y1, int x2, int y2, float *buffer );
00101   virtual int SetZbufferData( int x1, int y1, int x2, int y2,
00102                               vtkFloatArray *buffer );
00104 
00106   void MakeCurrent() = 0;
00107   
00109   void RegisterTextureResource (GLuint id);
00110 
00112   int GetDepthBufferSize();
00113   
00115   virtual void OpenGLInit();
00116 
00117 protected:
00118   vtkOpenGLRenderWindow();
00119   ~vtkOpenGLRenderWindow();
00120 
00121   vtkIdList *TextureResourceIds;
00122 
00123   int GetPixelData(int x,int y,int x2,int y2,int front, unsigned char* data);
00124   int GetZbufferData( int x1, int y1, int x2, int y2, float* z );
00125   int GetRGBAPixelData(int x,int y,int x2,int y2, int front, float* data);
00126   int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00127                            unsigned char* data);
00128 
00129 private:
00130   vtkOpenGLRenderWindow(const vtkOpenGLRenderWindow&);  // Not implemented.
00131   void operator=(const vtkOpenGLRenderWindow&);  // Not implemented.
00132 };
00133 
00134 #endif