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 
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 =========================================================================*/
00024 #ifndef __vtkCarbonRenderWindow_h
00025 #define __vtkCarbonRenderWindow_h
00026 
00027 #include "vtkOpenGLRenderWindow.h"
00028 
00029 #include <Carbon/Carbon.h> // Carbon and MAC specific
00030 #include <AGL/agl.h> // Carbon and MAC specific
00031 
00032 class VTK_RENDERING_EXPORT vtkCarbonRenderWindow : public vtkOpenGLRenderWindow
00033 {
00034 public:
00035   static vtkCarbonRenderWindow *New();
00036   vtkTypeRevisionMacro(vtkCarbonRenderWindow,vtkOpenGLRenderWindow);
00037   void PrintSelf(ostream& os, vtkIndent indent);
00038 
00040   void Start();
00041 
00043   void Frame();
00044 
00046   virtual void WindowConfigure();
00047 
00049   virtual void WindowInitialize();
00050 
00055   virtual void Initialize();
00056 
00061   virtual void Finalize();
00062 
00064   virtual void SetFullScreen(int);
00065 
00067   virtual void WindowRemap();
00068 
00070   virtual void PrefFullScreen();
00071 
00073 
00074   virtual void SetSize(int a[2]);
00075   virtual void SetSize(int,int);
00077 
00079   virtual int *GetSize();
00080 
00082 
00083   virtual void SetPosition(int*);
00084   virtual void SetPosition(int,int);
00086 
00088   virtual int *GetScreenSize();
00089 
00091   virtual int *GetPosition();
00092 
00095   virtual void SetWindowName(const char *);
00096   
00098   void SetWindowInfo(char *);
00099 
00100   void SetNextWindowInfo(char *)
00101      {
00102       vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
00103      }
00104 
00105   //BTX
00106   virtual void *GetGenericDisplayId() {return NULL;};
00107   virtual void *GetGenericWindowId()  {return (void *)this->WindowId;};
00108   virtual void *GetGenericParentId()  {return (void *)this->ParentId;};
00109   virtual AGLContext GetContextId()   {return this->ContextId;};
00110   virtual void *GetGenericContext()   {return (void *)this->ContextId;};
00111   virtual void SetDisplayId(void *) {};
00112 
00113   virtual void* GetGenericDrawable()
00114     {
00115       vtkWarningMacro("GetGenericDrawable Method not implemented.");
00116       return 0;
00117     }
00118 
00119   void SetParentInfo(char*)
00120     {
00121       vtkWarningMacro("SetParentInfo Method not implemented.");
00122     }
00123 
00125 
00126   virtual HIViewRef GetWindowId();
00127   // Set the HIView window pointer.
00128   void  SetWindowId(void *foo) {this->SetWindowId((HIViewRef)foo);};
00129   void SetNextWindowId(void*)
00130     {
00131        vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
00132     }
00134 
00136 
00137   virtual void SetParentId(HIViewRef);
00138   void  SetParentId(void *foo) {this->SetParentId((HIViewRef)foo);};
00140   
00142   virtual void SetWindowId(HIViewRef);
00143 
00145 
00146   void SetRootWindow(WindowPtr win);
00147   WindowPtr GetRootWindow();
00149 
00150   //ETX
00151 
00152   // supply base class virtual function
00153   vtkSetMacro(MultiSamples,int);
00154   vtkGetMacro(MultiSamples,int);
00155 
00160   virtual void SetStereoCapableWindow(int capable);
00161 
00163   void MakeCurrent();
00164 
00168   void SetForceMakeCurrent();
00169 
00172   virtual  int GetEventPending();
00173 
00175 
00176   virtual void SetupPalette(void *hDC);
00177   virtual void SetupPixelFormat(void *hDC, void *dwFlags, int debug, 
00178                                 int bpp=16, int zbpp=16);
00180   
00182   void Clean();
00183 
00185   int GetDepthBufferSize();
00186 
00188 
00190   void HideCursor();
00191   void ShowCursor();
00193   
00194   void UpdateSizeAndPosition(int xPos, int yPos, int xSize, int ySize);
00195 
00198   void UpdateGLRegion();
00199 
00200   
00201 protected:
00202   vtkCarbonRenderWindow();
00203   ~vtkCarbonRenderWindow();
00204 
00205   int ApplicationInitialized; // Toolboxen initialized?
00206   Boolean fAcceleratedMust;   // input: must renderer be accelerated?
00207   Boolean draggable;          // input: is the window draggable?
00208   GLint aglAttributes[64];    // input: pixel format attributes always required
00209                               //   (reset to what was actually allocated)
00210   SInt32 VRAM;                // input: minimum VRAM; output: actual
00211                               //   (if successful otherwise input)
00212   SInt32 textureRAM;          // input: amount of texture RAM required on card;
00213                               // output: same (used in allocation)
00214   AGLPixelFormat fmt;         // input: none; output pixel format...
00215   AGLContext ContextId;
00216   HIViewRef WindowId;
00217   HIViewRef ParentId;
00218   WindowPtr RootWindow;
00219   int OwnWindow;
00220   int ScreenSize[2];
00221 
00222   int CursorHidden;
00223   int ForceMakeCurrent;
00224 
00225 
00226  // data and handlers to keep the GL view coincident with the HIView
00227   EventHandlerUPP RegionEventHandlerUPP;
00228   EventHandlerRef RegionEventHandler;
00229   static OSStatus RegionEventProcessor(EventHandlerCallRef er, EventRef event, void*);
00230 
00231   void CreateAWindow(int x, int y, int width, int height);
00232   void InitializeApplication();
00233 
00234 private:
00235   vtkCarbonRenderWindow(const vtkCarbonRenderWindow&);  // Not implemented.
00236   void operator=(const vtkCarbonRenderWindow&);  // Not implemented.
00237 };
00238 
00239 #endif

Generated on Mon Jan 21 23:07:34 2008 for VTK by  doxygen 1.4.3-20050530