00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00042 #ifndef __vtkOpenGLRenderWindow_h
00043 #define __vtkOpenGLRenderWindow_h
00044
00045 #include "vtkRenderWindow.h"
00046
00047 #if defined(__APPLE__) && (defined(VTK_USE_CARBON) || defined(VTK_USE_COCOA))
00048 #include <OpenGL/gl.h>
00049 #else
00050 #include <GL/gl.h>
00051 #endif
00052
00053 class vtkIdList;
00054
00055 class VTK_RENDERING_EXPORT vtkOpenGLRenderWindow : public vtkRenderWindow
00056 {
00057 protected:
00058 int MultiSamples;
00059 long OldMonitorSetting;
00060
00061 public:
00062 vtkTypeRevisionMacro(vtkOpenGLRenderWindow,vtkRenderWindow);
00063 void PrintSelf(ostream& os, vtkIndent indent);
00064
00066
00067 static void SetGlobalMaximumNumberOfMultiSamples(int val);
00068 static int GetGlobalMaximumNumberOfMultiSamples();
00070
00072
00074 vtkSetMacro(MultiSamples,int);
00075 vtkGetMacro(MultiSamples,int);
00077
00079 virtual void StereoUpdate();
00080
00082
00083 virtual unsigned char *GetPixelData(int x,int y,int x2,int y2,int front);
00084 virtual int GetPixelData(int x,int y,int x2,int y2, int front,
00085 vtkUnsignedCharArray*);
00086 virtual int SetPixelData(int x,int y,int x2,int y2,unsigned char *,
00087 int front);
00088 virtual int SetPixelData(int x,int y,int x2,int y2, vtkUnsignedCharArray*,
00089 int front);
00091
00093
00094 virtual float *GetRGBAPixelData(int x,int y,int x2,int y2,int front);
00095 virtual int GetRGBAPixelData(int x,int y,int x2,int y2, int front,
00096 vtkFloatArray* data);
00097 virtual int SetRGBAPixelData(int x,int y,int x2,int y2,float *,int front,
00098 int blend=0);
00099 virtual int SetRGBAPixelData(int x,int y,int x2,int y2, vtkFloatArray*,
00100 int front, int blend=0);
00101 virtual void ReleaseRGBAPixelData(float *data);
00102 virtual unsigned char *GetRGBACharPixelData(int x,int y,int x2,int y2,
00103 int front);
00104 virtual int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00105 vtkUnsignedCharArray* data);
00106 virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,unsigned char *,
00107 int front, int blend=0);
00108 virtual int SetRGBACharPixelData(int x,int y,int x2,int y2,
00109 vtkUnsignedCharArray *,
00110 int front, int blend=0);
00112
00114
00115 virtual float *GetZbufferData( int x1, int y1, int x2, int y2 );
00116 virtual int GetZbufferData( int x1, int y1, int x2, int y2,
00117 vtkFloatArray* z );
00118 virtual int SetZbufferData( int x1, int y1, int x2, int y2, float *buffer );
00119 virtual int SetZbufferData( int x1, int y1, int x2, int y2,
00120 vtkFloatArray *buffer );
00122
00124 void MakeCurrent() = 0;
00125
00127 void RegisterTextureResource (GLuint id);
00128
00130 int GetDepthBufferSize();
00131
00133 virtual void OpenGLInit();
00134
00135 protected:
00136 vtkOpenGLRenderWindow();
00137 ~vtkOpenGLRenderWindow();
00138
00139 vtkIdList *TextureResourceIds;
00140
00141 int GetPixelData(int x,int y,int x2,int y2,int front, unsigned char* data);
00142 int GetZbufferData( int x1, int y1, int x2, int y2, float* z );
00143 int GetRGBAPixelData(int x,int y,int x2,int y2, int front, float* data);
00144 int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00145 unsigned char* data);
00146
00147 private:
00148 vtkOpenGLRenderWindow(const vtkOpenGLRenderWindow&);
00149 void operator=(const vtkOpenGLRenderWindow&);
00150 };
00151
00152 #endif