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

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 =========================================================================*/
00034 #ifndef __vtkMesaRenderWindow_h
00035 #define __vtkMesaRenderWindow_h
00036 
00037 #include "vtkRenderWindow.h"
00038 
00039 #include "MangleMesaInclude/gl_mangle.h" // Needed for GLuint
00040 #include <MangleMesaInclude/gl.h> // Needed for GLuint
00041 
00042 class vtkIdList;
00043 
00044 class VTK_RENDERING_EXPORT vtkMesaRenderWindow : public vtkRenderWindow
00045 {
00046 protected:
00047   int MultiSamples;
00048   long OldMonitorSetting;
00049 
00050 public:
00051   vtkTypeRevisionMacro(vtkMesaRenderWindow,vtkRenderWindow);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00053   
00055 
00056   static void SetGlobalMaximumNumberOfMultiSamples(int val);
00057   static int  GetGlobalMaximumNumberOfMultiSamples();
00059 
00061 
00063   vtkSetMacro(MultiSamples,int);
00064   vtkGetMacro(MultiSamples,int);
00066 
00068   virtual void StereoUpdate();
00069 
00071 
00072   virtual unsigned char *GetPixelData(int x,int y,int x2,int y2,int front);
00073   virtual int GetPixelData(int x,int y,int x2,int y2, int front,
00074                            vtkUnsignedCharArray*);
00075   virtual int SetPixelData(int x,int y,int x2,int y2,unsigned char *,
00076                            int front);
00077   virtual int SetPixelData(int x,int y,int x2,int y2, vtkUnsignedCharArray*,
00078                            int front);
00080 
00082 
00083   virtual float *GetRGBAPixelData(int x,int y,int x2,int y2,int front);
00084   virtual int GetRGBAPixelData(int x,int y,int x2,int y2, int front,
00085                                vtkFloatArray* data);
00086   virtual int SetRGBAPixelData(int x,int y,int x2,int y2,float *,int front,
00087                                 int blend=0);
00088   virtual int SetRGBAPixelData(int x,int y,int x2,int y2, vtkFloatArray*,
00089                                 int front, int blend=0);
00090   virtual void ReleaseRGBAPixelData(float *data);
00091   virtual unsigned char *GetRGBACharPixelData(int x,int y,int x2,int y2,
00092                                               int front);
00093   virtual int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00094                                    vtkUnsignedCharArray* data);
00095   virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,unsigned char *,
00096                                     int front, int blend=0);  
00097   virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,
00098                                    vtkUnsignedCharArray *,
00099                                    int front, int blend=0);  
00101 
00103 
00104   virtual float *GetZbufferData( int x1, int y1, int x2, int y2 );
00105   virtual int GetZbufferData( int x1, int y1, int x2, int y2, 
00106                               vtkFloatArray* z );
00107   virtual int SetZbufferData( int x1, int y1, int x2, int y2, float *buffer );
00108   virtual int SetZbufferData( int x1, int y1, int x2, int y2, 
00109                               vtkFloatArray *buffer );
00111 
00113   void MakeCurrent() = 0;
00114   
00116   void RegisterTextureResource (GLuint id);
00117 
00119   int GetDepthBufferSize();
00120   
00122   virtual void OpenGLInit();
00123  
00124 protected:
00125   vtkMesaRenderWindow();
00126   ~vtkMesaRenderWindow();
00127 
00128   vtkIdList *TextureResourceIds;
00129 
00130   int GetPixelData(int x,int y,int x2,int y2,int front, unsigned char* data);
00131   int GetZbufferData( int x1, int y1, int x2, int y2, float* z );
00132   int GetRGBAPixelData(int x,int y,int x2,int y2, int front, float* data);
00133   int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00134                            unsigned char* data);
00135 
00136 private:
00137   vtkMesaRenderWindow(const vtkMesaRenderWindow&);  // Not implemented.
00138   void operator=(const vtkMesaRenderWindow&);  // Not implemented.
00139 };
00140 
00141 #endif