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

vtkCocoaRenderWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCocoaRenderWindow.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 =========================================================================*/
00039 #ifndef __vtkCocoaRenderWindow_h
00040 #define __vtkCocoaRenderWindow_h
00041 
00042 #include "vtkOpenGLRenderWindow.h"
00043 
00044 class VTK_RENDERING_EXPORT vtkCocoaRenderWindow : public vtkOpenGLRenderWindow
00045 {
00046 public:
00047   static vtkCocoaRenderWindow *New();
00048   vtkTypeRevisionMacro(vtkCocoaRenderWindow,vtkOpenGLRenderWindow);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050 
00052   virtual void Start();
00053 
00055   virtual void Frame();
00056 
00058   virtual void WindowConfigure();
00059 
00061   virtual void WindowInitialize();
00062 
00064   virtual void Initialize();
00065 
00067   virtual void SetFullScreen(int);
00068 
00070   virtual void WindowRemap();
00071 
00073   virtual void PrefFullScreen();
00074 
00076 
00077   virtual void SetSize(int*);
00078   virtual void SetSize(int,int);
00080 
00082   virtual int *GetSize();
00083 
00085 
00086   virtual void SetPosition(int*);
00087   virtual void SetPosition(int,int);
00089   
00091   virtual int *GetScreenSize();
00092 
00094   virtual int *GetPosition();
00095 
00098   virtual void SetWindowName(const char *);
00099   
00101   virtual void SetWindowInfo(void *);
00102 
00103   void SetNextWindowInfo(char *)
00104     {
00105     vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
00106     }
00107 
00108 
00109   //BTX
00110   virtual void *GetGenericDisplayId() {return (void *)this->ContextId;};
00111   virtual void *GetGenericWindowId()  {return (void *)this->WindowId;};
00112   virtual void *GetGenericContext()   {return (void *)this->DeviceContext;};
00113   virtual void SetDisplayId(void *) {};
00114   virtual void SetParentId(void *) 
00115     {
00116     vtkWarningMacro("Method not implemented.");
00117     }
00118   virtual void* GetGenericParentId()
00119     {
00120     vtkWarningMacro("Method not implemented.");
00121     return 0;
00122     }
00123   virtual void* GetGenericDrawable()
00124     {
00125     vtkWarningMacro("Method not implemented.");
00126     return 0;
00127     }
00128   virtual void SetWindowInfo(char*)
00129     {
00130     vtkWarningMacro("Method not implemented.");
00131     }
00132   virtual void SetParentInfo(char*)
00133     {
00134     vtkWarningMacro("Method not implemented.");
00135     }
00136 
00138   virtual void *GetWindowId();
00139 
00141   virtual void  SetWindowId(void *);
00142 
00143   void SetNextWindowId(void*)
00144     {
00145     vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
00146     }
00147 
00148   void  SetContextId(void *);   // hsr
00149   void  SetDeviceContext(void *);       // hsr
00150 
00151   //ETX
00152 
00153   // supply base class virtual function
00154   vtkSetMacro(MultiSamples,int);
00155   vtkGetMacro(MultiSamples,int);
00156 
00158   virtual void StereoUpdate();
00159   
00164   virtual void SetStereoCapableWindow(int capable);
00165 
00167   virtual void MakeCurrent();
00168 
00170   const char *ReportCapabilities();
00171 
00173   int SupportsOpenGL();
00174 
00176   int IsDirect();
00177 
00181   virtual void SetForceMakeCurrent();
00182 
00185   virtual  int GetEventPending();
00186 
00194   virtual void SetupPalette(void *hDC);
00195   virtual void SetupPixelFormat(void *hDC, void *dwFlags, int debug, 
00196                                 int bpp=16, int zbpp=16);
00198   
00200   void Clean();
00201 
00203   void RegisterTextureResource (GLuint id);
00204 
00206   int GetDepthBufferSize();
00207 
00209 
00211   virtual void HideCursor();
00212   virtual void ShowCursor();
00214   
00215   void UpdateSizeAndPosition(int xPos, int yPos, int xSize, int ySize);
00216 
00217   
00218 protected:
00219   vtkCocoaRenderWindow();
00220   ~vtkCocoaRenderWindow();
00221 
00222   int       ApplicationInitialized; //NSApplication called?
00223   void     *AutoreleasePool;
00224   void     *ContextId;
00225   void     *DeviceContext;
00226   void     *WindowId;
00227   void     *WindowController;
00228   int       OwnWindow;
00229   int       ScreenSize[2];
00230   int       MultiSamples;
00231 
00232   // the following is used to support rendering into memory
00233 //  void *MemoryDataHeader;
00234 //  void *MemoryBuffer;
00235 //  unsigned char *MemoryData;  // the data in the DIBSection
00236 //  void *MemoryHdc;
00237 
00238   int ScreenMapped;
00239   int ScreenWindowSize[2];
00240   void *ScreenDeviceContext;
00241   int ScreenDoubleBuffer;
00242   void *ScreenContextId;
00243 
00244   int CursorHidden;
00245   int ForceMakeCurrent;
00246 
00247   char *Capabilities;
00248 
00249 private:
00250   vtkCocoaRenderWindow(const vtkCocoaRenderWindow&);  // Not implemented.
00251   void operator=(const vtkCocoaRenderWindow&);  // Not implemented.
00252 };
00253 
00254 #endif