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