VTK
dox/Rendering/vtkMesaRenderWindow.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkMesaRenderWindow.h
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 =========================================================================*/
00023 #ifndef __vtkMesaRenderWindow_h
00024 #define __vtkMesaRenderWindow_h
00025 
00026 #include "vtkRenderWindow.h"
00027 
00028 #include "MangleMesaInclude/gl_mangle.h" // Needed for GLuint
00029 #include <MangleMesaInclude/gl.h> // Needed for GLuint
00030 
00031 class vtkIdList;
00032 
00033 class VTK_RENDERING_EXPORT vtkMesaRenderWindow : public vtkRenderWindow
00034 {
00035 protected:
00036   int MultiSamples;
00037   long OldMonitorSetting;
00038 
00039 public:
00040   vtkTypeMacro(vtkMesaRenderWindow,vtkRenderWindow);
00041   void PrintSelf(ostream& os, vtkIndent indent);
00042   
00044 
00045   static void SetGlobalMaximumNumberOfMultiSamples(int val);
00046   static int  GetGlobalMaximumNumberOfMultiSamples();
00048 
00050 
00052   vtkSetMacro(MultiSamples,int);
00053   vtkGetMacro(MultiSamples,int);
00055 
00057   virtual void StereoUpdate();
00058 
00060 
00061   virtual unsigned char *GetPixelData(int x,int y,int x2,int y2,int front);
00062   virtual int GetPixelData(int x,int y,int x2,int y2, int front,
00063                            vtkUnsignedCharArray*);
00064   virtual int SetPixelData(int x,int y,int x2,int y2,unsigned char *,
00065                            int front);
00066   virtual int SetPixelData(int x,int y,int x2,int y2, vtkUnsignedCharArray*,
00067                            int front);
00069 
00071 
00072   virtual float *GetRGBAPixelData(int x,int y,int x2,int y2,int front);
00073   virtual int GetRGBAPixelData(int x,int y,int x2,int y2, int front,
00074                                vtkFloatArray* data);
00075   virtual int SetRGBAPixelData(int x,int y,int x2,int y2,float *,int front,
00076                                 int blend=0);
00077   virtual int SetRGBAPixelData(int x,int y,int x2,int y2, vtkFloatArray*,
00078                                 int front, int blend=0);
00079   virtual void ReleaseRGBAPixelData(float *data);
00080   virtual unsigned char *GetRGBACharPixelData(int x,int y,int x2,int y2,
00081                                               int front);
00082   virtual int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00083                                    vtkUnsignedCharArray* data);
00084   virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,unsigned char *,
00085                                     int front, int blend=0);  
00086   virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,
00087                                    vtkUnsignedCharArray *,
00088                                    int front, int blend=0);  
00090 
00092 
00093   virtual float *GetZbufferData( int x1, int y1, int x2, int y2 );
00094   virtual int GetZbufferData( int x1, int y1, int x2, int y2, float *buffer );
00095   virtual int GetZbufferData( int x1, int y1, int x2, int y2, 
00096                               vtkFloatArray* z );
00097   virtual int SetZbufferData( int x1, int y1, int x2, int y2, float *buffer );
00098   virtual int SetZbufferData( int x1, int y1, int x2, int y2, 
00099                               vtkFloatArray *buffer );
00101 
00103   void MakeCurrent() = 0;
00104   
00106   void RegisterTextureResource (GLuint id);
00107 
00109   int GetDepthBufferSize();
00110   
00113   int GetColorBufferSizes(int *rgba);
00114 
00116   virtual void OpenGLInit();
00117  
00118 protected:
00119   vtkMesaRenderWindow();
00120   ~vtkMesaRenderWindow();
00121 
00122   vtkIdList *TextureResourceIds;
00123 
00124   int GetPixelData(int x,int y,int x2,int y2,int front, unsigned char* data);
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   vtkMesaRenderWindow(const vtkMesaRenderWindow&);  // Not implemented.
00131   void operator=(const vtkMesaRenderWindow&);  // Not implemented.
00132 };
00133 
00134 #endif