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

Rendering/vtkMesaRenderWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMesaRenderWindow.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 =========================================================================*/
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   vtkTypeRevisionMacro(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, 
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   
00105   void RegisterTextureResource (GLuint id);
00106 
00108   int GetDepthBufferSize();
00109   
00111   virtual void OpenGLInit();
00112  
00113 protected:
00114   vtkMesaRenderWindow();
00115   ~vtkMesaRenderWindow();
00116 
00117   vtkIdList *TextureResourceIds;
00118 
00119   int GetPixelData(int x,int y,int x2,int y2,int front, unsigned char* data);
00120   int GetZbufferData( int x1, int y1, int x2, int y2, float* z );
00121   int GetRGBAPixelData(int x,int y,int x2,int y2, int front, float* data);
00122   int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00123                            unsigned char* data);
00124 
00125 private:
00126   vtkMesaRenderWindow(const vtkMesaRenderWindow&);  // Not implemented.
00127   void operator=(const vtkMesaRenderWindow&);  // Not implemented.
00128 };
00129 
00130 #endif