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   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00038 #ifndef __vtkMesaRenderWindow_h
00039 #define __vtkMesaRenderWindow_h
00040 
00041 #include "vtkRenderWindow.h"
00042 
00043 #include "MangleMesaInclude/gl_mangle.h" // Needed for GLuint
00044 #include <MangleMesaInclude/gl.h> // Needed for GLuint
00045 
00046 class vtkIdList;
00047 
00048 class VTK_RENDERING_EXPORT vtkMesaRenderWindow : public vtkRenderWindow
00049 {
00050 protected:
00051   int MultiSamples;
00052   long OldMonitorSetting;
00053 
00054 public:
00055   vtkTypeRevisionMacro(vtkMesaRenderWindow,vtkRenderWindow);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057   
00059 
00060   static void SetGlobalMaximumNumberOfMultiSamples(int val);
00061   static int  GetGlobalMaximumNumberOfMultiSamples();
00063 
00065 
00067   vtkSetMacro(MultiSamples,int);
00068   vtkGetMacro(MultiSamples,int);
00070 
00072   virtual void StereoUpdate();
00073 
00075 
00076   virtual unsigned char *GetPixelData(int x,int y,int x2,int y2,int front);
00077   virtual int GetPixelData(int x,int y,int x2,int y2, int front,
00078                            vtkUnsignedCharArray*);
00079   virtual int SetPixelData(int x,int y,int x2,int y2,unsigned char *,
00080                            int front);
00081   virtual int SetPixelData(int x,int y,int x2,int y2, vtkUnsignedCharArray*,
00082                            int front);
00084 
00086 
00087   virtual float *GetRGBAPixelData(int x,int y,int x2,int y2,int front);
00088   virtual int GetRGBAPixelData(int x,int y,int x2,int y2, int front,
00089                                vtkFloatArray* data);
00090   virtual int SetRGBAPixelData(int x,int y,int x2,int y2,float *,int front,
00091                                 int blend=0);
00092   virtual int SetRGBAPixelData(int x,int y,int x2,int y2, vtkFloatArray*,
00093                                 int front, int blend=0);
00094   virtual void ReleaseRGBAPixelData(float *data);
00095   virtual unsigned char *GetRGBACharPixelData(int x,int y,int x2,int y2,
00096                                               int front);
00097   virtual int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00098                                    vtkUnsignedCharArray* data);
00099   virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,unsigned char *,
00100                                     int front, int blend=0);  
00101   virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,
00102                                    vtkUnsignedCharArray *,
00103                                    int front, int blend=0);  
00105 
00107 
00108   virtual float *GetZbufferData( int x1, int y1, int x2, int y2 );
00109   virtual int GetZbufferData( int x1, int y1, int x2, int y2, 
00110                               vtkFloatArray* z );
00111   virtual int SetZbufferData( int x1, int y1, int x2, int y2, float *buffer );
00112   virtual int SetZbufferData( int x1, int y1, int x2, int y2, 
00113                               vtkFloatArray *buffer );
00115 
00117   void MakeCurrent() = 0;
00118   
00120   void RegisterTextureResource (GLuint id);
00121 
00123   int GetDepthBufferSize();
00124   
00126   virtual void OpenGLInit();
00127  
00128 protected:
00129   vtkMesaRenderWindow();
00130   ~vtkMesaRenderWindow();
00131 
00132   vtkIdList *TextureResourceIds;
00133 
00134   int GetPixelData(int x,int y,int x2,int y2,int front, unsigned char* data);
00135   int GetZbufferData( int x1, int y1, int x2, int y2, float* z );
00136   int GetRGBAPixelData(int x,int y,int x2,int y2, int front, float* data);
00137   int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00138                            unsigned char* data);
00139 
00140 private:
00141   vtkMesaRenderWindow(const vtkMesaRenderWindow&);  // Not implemented.
00142   void operator=(const vtkMesaRenderWindow&);  // Not implemented.
00143 };
00144 
00145 #endif