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

Rendering/vtkXOpenGLRenderWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXOpenGLRenderWindow.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00058 #ifndef __vtkXOpenGLRenderWindow_h
00059 #define __vtkXOpenGLRenderWindow_h
00060 
00061 #include <stdlib.h>
00062 #include <X11/Xlib.h>
00063 #include <X11/Xutil.h>
00064 #include "vtkOpenGLRenderWindow.h"
00065 #include "GL/glx.h"
00066 #include "vtkToolkits.h"
00067 
00068 
00069 #ifdef VTK_OPENGL_HAS_OSMESA
00070 #include "GL/osmesa.h"
00071 #endif
00072 
00073 class vtkIdList;
00074 
00075 class VTK_RENDERING_EXPORT vtkXOpenGLRenderWindow : public vtkOpenGLRenderWindow
00076 {
00077 protected:
00078   GLXContext ContextId;
00079   
00080 public:
00081   static vtkXOpenGLRenderWindow *New();
00082   vtkTypeMacro(vtkXOpenGLRenderWindow,vtkOpenGLRenderWindow);
00083   void PrintSelf(ostream& os, vtkIndent indent);
00084 
00086   virtual void Start(void);
00087 
00089   virtual void Frame(void);
00090 
00092   virtual void WindowInitialize(void);
00093 
00095   virtual void Initialize(void);
00096 
00098   virtual void SetFullScreen(int);
00099 
00101   virtual void WindowRemap(void);
00102 
00104   virtual void PrefFullScreen(void);
00105 
00107 
00108   virtual void SetSize(int,int);
00109   virtual void SetSize(int a[2]) {this->SetSize(a[0], a[1]);};
00111 
00113 
00114   virtual Colormap GetDesiredColormap();
00115   virtual Visual  *GetDesiredVisual();
00116   virtual XVisualInfo     *GetDesiredVisualInfo();
00117   virtual int      GetDesiredDepth();
00119 
00124   virtual void SetStereoCapableWindow(int capable);
00125 
00127   void MakeCurrent();
00128   
00130 
00131   virtual void *GetGenericDisplayId() {return (void *)this->GetDisplayId();};
00132   virtual void *GetGenericWindowId();
00133   virtual void *GetGenericParentId()  {return (void *)this->ParentId;};
00134   virtual void *GetGenericContext();
00135   virtual void *GetGenericDrawable()  {return (void *)this->WindowId;};
00137   
00139   virtual int     *GetSize();
00140 
00142   virtual int     *GetScreenSize();
00143 
00145   virtual int     *GetPosition();
00146 
00148   Display *GetDisplayId();
00149 
00151 
00153   void     SetDisplayId(Display *);
00154   void     SetDisplayId(void *);
00156 
00158   Window   GetParentId();
00159 
00161 
00162   void     SetParentId(Window);
00163   void     SetParentId(void *);
00165   
00167   Window   GetWindowId();
00168 
00170 
00171   void     SetWindowId(Window);
00172   void     SetWindowId(void *);
00174 
00176 
00177   void     SetNextWindowId(Window);
00178   void     SetWindowName(char *);
00180 
00182 
00183   void     SetPosition(int,int);
00184   void     SetPosition(int a[2]) {this->SetPosition(a[0], a[1]);};
00186   
00188 
00190   void HideCursor();
00191   void ShowCursor();
00193 
00196   virtual  int GetEventPending();
00197   
00199   void     SetWindowInfo(char *info);
00200 
00202   void     SetParentInfo(char *info);
00203 
00206   void Render();  
00207 
00209   void SetOffScreenRendering(int i);
00210 
00211 protected:
00212   vtkXOpenGLRenderWindow();
00213   ~vtkXOpenGLRenderWindow();
00214 
00215   Window   ParentId;
00216   Window   WindowId;
00217   Window   NextWindowId;
00218   Display *DisplayId;
00219   Colormap ColorMap;
00220   int      OwnWindow;
00221   int      OwnDisplay;
00222   int      ScreenSize[2];
00223   int      CursorHidden;
00224 
00225 #ifdef VTK_OPENGL_HAS_OSMESA
00226   // OffScreen stuff
00227   OSMesaContext OffScreenContextId;
00228   void *OffScreenWindow;
00229   int ScreenMapped;
00230   // Looks like this just stores DoubleBuffer.
00231   int ScreenDoubleBuffer;
00232 #endif
00233 private:
00234   vtkXOpenGLRenderWindow(const vtkXOpenGLRenderWindow&);  // Not implemented.
00235   void operator=(const vtkXOpenGLRenderWindow&);  // Not implemented.
00236 };
00237 
00238 
00239 
00240 #endif

Generated on Thu Mar 28 14:19:35 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001