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

dox/Rendering/vtkCocoaRenderWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCocoaRenderWindow.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 __vtkCocoaRenderWindow_h
00028 #define __vtkCocoaRenderWindow_h
00029 
00030 #include "vtkOpenGLRenderWindow.h"
00031 #include <OpenGL/gl.h> // Needed for types used in public interface
00032 
00033 class vtkIdList;
00034 
00035 class VTK_RENDERING_EXPORT vtkCocoaRenderWindow : public vtkOpenGLRenderWindow
00036 {
00037 public:
00038   static vtkCocoaRenderWindow *New();
00039   vtkTypeRevisionMacro(vtkCocoaRenderWindow,vtkOpenGLRenderWindow);
00040   void PrintSelf(ostream& os, vtkIndent indent);
00041 
00043   virtual void Start(void);
00044 
00046   virtual void Frame(void);
00047 
00049   virtual void WindowConfigure(void);
00050 
00052   virtual void WindowInitialize(void);
00053 
00055   virtual void Initialize(void);
00056 
00058   virtual void SetFullScreen(int);
00059 
00061   virtual void WindowRemap(void);
00062 
00064   virtual void PrefFullScreen(void);
00065 
00067   virtual void SetSize(int,int);
00068 
00070   virtual int *GetSize();
00071 
00073   virtual void SetPosition(int,int);
00074   
00076   virtual int *GetScreenSize();
00077 
00079   virtual int *GetPosition();
00080 
00083   virtual void SetWindowName(const char *);
00084   
00086   virtual void SetWindowInfo(void *);
00087 
00088   //BTX
00089   virtual void *GetGenericDisplayId() {return (void *)this->ContextId;};
00090   virtual void *GetGenericWindowId()  {return (void *)this->WindowId;};
00091   virtual void *GetGenericContext()   {return (void *)this->DeviceContext;};
00092   virtual void SetDisplayId(void *) {};
00093   virtual void SetParentId(void *) 
00094     {
00095       vtkWarningMacro("Method not implemented.");
00096     }
00097   virtual void* GetGenericParentId()
00098     {
00099       vtkWarningMacro("Method not implemented.");
00100       return 0;
00101     }
00102   virtual void* GetGenericDrawable()
00103     {
00104       vtkWarningMacro("Method not implemented.");
00105       return 0;
00106     }
00107   virtual void SetWindowInfo(char*)
00108     {
00109       vtkWarningMacro("Method not implemented.");
00110     }
00111   virtual void SetParentInfo(char*)
00112     {
00113       vtkWarningMacro("Method not implemented.");
00114     }
00115 
00117   virtual void *GetWindowId();
00118 
00120   virtual void  SetWindowId(void *);
00121   
00122   void  SetContextId(void *);   // hsr
00123   void  SetDeviceContext(void *);       // hsr
00124 
00125   //ETX
00126 
00127   // supply base class virtual function
00128   vtkSetMacro(MultiSamples,int);
00129   vtkGetMacro(MultiSamples,int);
00130 
00132   virtual void StereoUpdate();
00133   
00138   virtual void SetStereoCapableWindow(int capable);
00139 
00141   virtual void MakeCurrent();
00142 
00144   const char *ReportCapabilities();
00145 
00147   int SupportsOpenGL();
00148 
00150   int IsDirect();
00151 
00155   virtual void SetForceMakeCurrent();
00156 
00159   virtual  int GetEventPending();
00160 
00168   virtual void OpenGLInit();
00169   virtual void SetupPalette(void *hDC);
00170   virtual void SetupPixelFormat(void *hDC, void *dwFlags, int debug, 
00171                                 int bpp=16, int zbpp=16);
00173   
00175   void Clean();
00176 
00178   void RegisterTextureResource (GLuint id);
00179 
00181   int GetDepthBufferSize();
00182 
00184 
00186   virtual void HideCursor();
00187   virtual void ShowCursor();
00189   
00190   void UpdateSizeAndPosition(int xPos, int yPos, int xSize, int ySize);
00191 
00192   
00193 protected:
00194   vtkCocoaRenderWindow();
00195   ~vtkCocoaRenderWindow();
00196 
00197   int       ApplicationInitialized; //NSApplication called?
00198   void     *ContextId;
00199   void     *DeviceContext;
00200   void     *WindowId;
00201   void     *WindowController;
00202   int       OwnWindow;
00203   int       ScreenSize[2];
00204   int       MultiSamples;
00205   vtkIdList *TextureResourceIds;
00206 
00207   int GetPixelData(int x,int y,int x2,int y2,int front, unsigned char* data);
00208   int GetZbufferData( int x1, int y1, int x2, int y2, float* z );
00209   int GetRGBAPixelData(int x,int y,int x2,int y2, int front, float* data);
00210   int GetRGBACharPixelData(int x,int y,int x2,int y2, int front,
00211                            unsigned char* data);
00212 
00213   // the following is used to support rendering into memory
00214 //  void *MemoryDataHeader;
00215 //  void *MemoryBuffer;
00216 //  unsigned char *MemoryData;  // the data in the DIBSection
00217 //  void *MemoryHdc;
00218 
00219   int ScreenMapped;
00220   int ScreenWindowSize[2];
00221   void *ScreenDeviceContext;
00222   int ScreenDoubleBuffer;
00223   void *ScreenContextId;
00224 
00225   int CursorHidden;
00226   int ForceMakeCurrent;
00227 
00228   char *Capabilities;
00229 
00230 private:
00231   vtkCocoaRenderWindow(const vtkCocoaRenderWindow&);  // Not implemented.
00232   void operator=(const vtkCocoaRenderWindow&);  // Not implemented.
00233 };
00234 
00235 #endif