Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkCarbonRenderWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCarbonRenderWindow.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 =========================================================================*/
00027 #ifndef __vtkCarbonRenderWindow_h
00028 #define __vtkCarbonRenderWindow_h
00029 
00030 #include "vtkOpenGLRenderWindow.h"
00031 
00032 
00033 #include <Carbon/Carbon.h> // Carbon and MAC specific
00034 #include <OpenGL/gl.h> // Carbon and MAC specific
00035 #include <AGL/agl.h> // Carbon and MAC specific
00036 
00037 class vtkIdList;
00038 
00039 class VTK_RENDERING_EXPORT vtkCarbonRenderWindow : public vtkOpenGLRenderWindow
00040 {
00041 public:
00042   static vtkCarbonRenderWindow *New();
00043   vtkTypeRevisionMacro(vtkCarbonRenderWindow,vtkOpenGLRenderWindow);
00044   void PrintSelf(ostream& os, vtkIndent indent);
00045 
00047   void Start(void);
00048 
00050   void Frame(void);
00051 
00053   virtual void WindowConfigure(void);
00054 
00056   virtual void WindowInitialize(void);
00057 
00059   virtual void Initialize(void);
00060 
00062   virtual void SetFullScreen(int);
00063 
00065   virtual void WindowRemap(void);
00066 
00068   virtual void PrefFullScreen(void);
00069 
00071   virtual void SetSize(int,int);
00072 
00074   virtual int *GetSize();
00075 
00077   virtual void SetPosition(int,int);
00078   
00080   virtual int *GetScreenSize();
00081 
00083   virtual int *GetPosition();
00084 
00087   virtual void SetWindowName(const char *);
00088   
00090   void SetWindowInfo(void *);
00091 
00092   //BTX
00093   virtual void *GetGenericDisplayId() {return (void *)this->ContextId;};
00094   virtual void *GetGenericWindowId()  {return (void *)this->WindowId;};
00095   virtual void *GetGenericParentId()  {return (void *)this->ParentId;};
00096   virtual AGLContext GetContextId()   {return this->ContextId;};
00097   virtual void *GetGenericContext()   {return (void *)this->DeviceContext;};
00098   virtual void SetDisplayId(void *) {};
00099 
00100   virtual void* GetGenericDrawable()
00101     {
00102       vtkWarningMacro("GetGenericDrawable Method not implemented.");
00103       return 0;
00104     }
00105   void SetWindowInfo(char*)
00106     {
00107       vtkWarningMacro("SetWindowInfo Method not implemented.");
00108     }
00109   void SetParentInfo(char*)
00110     {
00111       vtkWarningMacro("SetParentInfo Method not implemented.");
00112     }
00113 
00115 
00116   virtual WindowPtr GetWindowId();
00117   void  SetWindowId(void *foo) {this->SetWindowId((WindowPtr)foo);};
00119 
00121 
00122   virtual void SetParentId(WindowPtr);
00123   void  SetParentId(void *foo) {this->SetParentId((WindowPtr)foo);};
00125   
00127   virtual void SetWindowId(WindowPtr);
00128 
00129   void  SetContextId(void *);   // hsr
00130   void  SetDeviceContext(void *);       // hsr
00131 
00132   //ETX
00133 
00134   // supply base class virtual function
00135   vtkSetMacro(MultiSamples,int);
00136   vtkGetMacro(MultiSamples,int);
00137 
00142   virtual void SetStereoCapableWindow(int capable);
00143 
00145   void MakeCurrent();
00146 
00150   void SetForceMakeCurrent();
00151 
00154   virtual  int GetEventPending();
00155 
00163   virtual void SetupPalette(void *hDC);
00164   virtual void SetupPixelFormat(void *hDC, void *dwFlags, int debug, 
00165                                 int bpp=16, int zbpp=16);
00167   
00169   void Clean();
00170 
00172   int GetDepthBufferSize();
00173 
00175 
00177   void HideCursor();
00178   void ShowCursor();
00180   
00181   void UpdateSizeAndPosition(int xPos, int yPos, int xSize, int ySize);
00182 
00183   
00184 protected:
00185   vtkCarbonRenderWindow();
00186   ~vtkCarbonRenderWindow();
00187 
00188   int ApplicationInitialized; // Toolboxen initialized?
00189   Boolean fAcceleratedMust;   // input: must renderer be accelerated?
00190   Boolean draggable;          // input: is the window draggable?
00191   GLint aglAttributes[64];    // input: pixel format attributes always required
00192                               //   (reset to what was actually allocated)
00193   SInt32 VRAM;                // input: minimum VRAM; output: actual
00194                               //   (if successful otherwise input)
00195   SInt32 textureRAM;          // input: amount of texture RAM required on card;
00196                               // output: same (used in allocation)
00197   AGLPixelFormat fmt;         // input: none; output pixel format...
00198   AGLContext ContextId;
00199   AGLDrawable DeviceContext;  // the drawable attached to a rendering context
00200   WindowPtr WindowId;
00201   WindowPtr ParentId;
00202   int OwnWindow;
00203   int ScreenSize[2];
00204 
00205   int ScreenMapped;
00206   int ScreenWindowSize[2];
00207   void *ScreenDeviceContext;
00208   int ScreenDoubleBuffer;
00209   void *ScreenContextId;
00210 
00211   int CursorHidden;
00212   int ForceMakeCurrent;
00213 
00214   void CreateAWindow(int x, int y, int width, int height);
00215   void InitializeApplication();
00216 private:
00217   vtkCarbonRenderWindow(const vtkCarbonRenderWindow&);  // Not implemented.
00218   void operator=(const vtkCarbonRenderWindow&);  // Not implemented.
00219 };
00220 
00221 #endif