Rendering/vtkOpenGLRenderWindow.h Source File

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

# Rendering/vtkOpenGLRenderWindow.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkOpenGLRenderWindow.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 =========================================================================*/
    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> // Needed for GLuint
    00049 #else
    00050 #include <GL/gl.h> // Needed for GLuint
    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&);  // Not implemented.
    00149   void operator=(const vtkOpenGLRenderWindow&);  // Not implemented.
    00150 };
    00151
    00152 #endif