Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | 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 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00034 #ifndef __vtkCarbonRenderWindow_h
00035 #define __vtkCarbonRenderWindow_h
00036 
00037 #include "vtkOpenGLRenderWindow.h"
00038 
00039 #include <Carbon/Carbon.h> // Carbon and MAC specific
00040 #include <AGL/agl.h> // Carbon and MAC specific
00041 
00042 class VTK_RENDERING_EXPORT vtkCarbonRenderWindow : public vtkOpenGLRenderWindow
00043 {
00044 public:
00045   static vtkCarbonRenderWindow *New();
00046   vtkTypeRevisionMacro(vtkCarbonRenderWindow,vtkOpenGLRenderWindow);
00047   void PrintSelf(ostream& os, vtkIndent indent);
00048 
00050   void Start();
00051 
00053   void Frame();
00054 
00056   virtual void WindowConfigure();
00057 
00059   virtual void WindowInitialize();
00060 
00065   virtual void Initialize();
00066 
00071   virtual void Finalize();
00072 
00074   virtual void SetFullScreen(int);
00075 
00077   virtual void WindowRemap();
00078 
00080   virtual void PrefFullScreen();
00081 
00083 
00084   virtual void SetSize(int a[2]);
00085   virtual void SetSize(int,int);
00087 
00089   virtual int *GetSize();
00090 
00092 
00093   virtual void SetPosition(int*);
00094   virtual void SetPosition(int,int);
00096 
00098   virtual int *GetScreenSize();
00099 
00101   virtual int *GetPosition();
00102 
00105   virtual void SetWindowName(const char *);
00106   
00108   void SetWindowInfo(char *);
00109 
00110   void SetNextWindowInfo(char *)
00111      {
00112       vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
00113      }
00114 
00115   //BTX
00116   virtual void *GetGenericDisplayId() {return (void *)this->ContextId;};
00117   virtual void *GetGenericWindowId()  {return (void *)this->WindowId;};
00118   virtual void *GetGenericParentId()  {return (void *)this->ParentId;};
00119   virtual AGLContext GetContextId()   {return this->ContextId;};
00120   virtual void *GetGenericContext()   {return (void *)this->DeviceContext;};
00121   virtual void SetDisplayId(void *) {};
00122 
00123   virtual void* GetGenericDrawable()
00124     {
00125       vtkWarningMacro("GetGenericDrawable Method not implemented.");
00126       return 0;
00127     }
00128 
00129   void SetParentInfo(char*)
00130     {
00131       vtkWarningMacro("SetParentInfo Method not implemented.");
00132     }
00133 
00135 
00136   virtual WindowPtr GetWindowId();
00137   void  SetWindowId(void *foo) {this->SetWindowId((WindowPtr)foo);};
00138   void SetNextWindowId(void*)
00139     {
00140        vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
00141     }
00143 
00145 
00146   virtual void SetParentId(WindowPtr);
00147   void  SetParentId(void *foo) {this->SetParentId((WindowPtr)foo);};
00149   
00151   virtual void SetWindowId(WindowPtr);
00152 
00153   void  SetContextId(void *);   // hsr
00154   void  SetDeviceContext(void *);       // hsr
00155 
00156   //ETX
00157 
00158   // supply base class virtual function
00159   vtkSetMacro(MultiSamples,int);
00160   vtkGetMacro(MultiSamples,int);
00161 
00166   virtual void SetStereoCapableWindow(int capable);
00167 
00169   void MakeCurrent();
00170 
00174   void SetForceMakeCurrent();
00175 
00178   virtual  int GetEventPending();
00179 
00187   virtual void SetupPalette(void *hDC);
00188   virtual void SetupPixelFormat(void *hDC, void *dwFlags, int debug, 
00189                                 int bpp=16, int zbpp=16);
00191   
00193   void Clean();
00194 
00196   int GetDepthBufferSize();
00197 
00199 
00201   void HideCursor();
00202   void ShowCursor();
00204   
00205   void UpdateSizeAndPosition(int xPos, int yPos, int xSize, int ySize);
00206 
00207   
00208 protected:
00209   vtkCarbonRenderWindow();
00210   ~vtkCarbonRenderWindow();
00211 
00212   int ApplicationInitialized; // Toolboxen initialized?
00213   Boolean fAcceleratedMust;   // input: must renderer be accelerated?
00214   Boolean draggable;          // input: is the window draggable?
00215   GLint aglAttributes[64];    // input: pixel format attributes always required
00216                               //   (reset to what was actually allocated)
00217   SInt32 VRAM;                // input: minimum VRAM; output: actual
00218                               //   (if successful otherwise input)
00219   SInt32 textureRAM;          // input: amount of texture RAM required on card;
00220                               // output: same (used in allocation)
00221   AGLPixelFormat fmt;         // input: none; output pixel format...
00222   AGLContext ContextId;
00223   AGLDrawable DeviceContext;  // the drawable attached to a rendering context
00224   WindowPtr WindowId;
00225   WindowPtr ParentId;
00226   int OwnWindow;
00227   int ScreenSize[2];
00228 
00229   int ScreenMapped;
00230   int ScreenWindowSize[2];
00231   void *ScreenDeviceContext;
00232   int ScreenDoubleBuffer;
00233   void *ScreenContextId;
00234 
00235   int CursorHidden;
00236   int ForceMakeCurrent;
00237 
00238   void CreateAWindow(int x, int y, int width, int height);
00239   void InitializeApplication();
00240 private:
00241   vtkCarbonRenderWindow(const vtkCarbonRenderWindow&);  // Not implemented.
00242   void operator=(const vtkCarbonRenderWindow&);  // Not implemented.
00243 };
00244 
00245 #endif