Rendering/vtkCarbonRenderWindow.h Source File

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

# Rendering/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 =========================================================================*/
    00037 #ifndef __vtkCarbonRenderWindow_h
    00038 #define __vtkCarbonRenderWindow_h
    00039
    00040 #include "vtkOpenGLRenderWindow.h"
    00041
    00042
    00043 #include <Carbon/Carbon.h> // Carbon and MAC specific
    00044 #include <OpenGL/gl.h> // Carbon and MAC specific
    00045 #include <AGL/agl.h> // Carbon and MAC specific
    00046
    00047 class vtkIdList;
    00048
    00049 class VTK_RENDERING_EXPORT vtkCarbonRenderWindow : public vtkOpenGLRenderWindow
    00050 {
    00051 public:
    00052   static vtkCarbonRenderWindow *New();
    00053   vtkTypeRevisionMacro(vtkCarbonRenderWindow,vtkOpenGLRenderWindow);
    00054   void PrintSelf(ostream& os, vtkIndent indent);
    00055
    00057   void Start(void);
    00058
    00060   void Frame(void);
    00061
    00063   virtual void WindowConfigure(void);
    00064
    00066   virtual void WindowInitialize(void);
    00067
    00069   virtual void Initialize(void);
    00070
    00072   virtual void SetFullScreen(int);
    00073
    00075   virtual void WindowRemap(void);
    00076
    00078   virtual void PrefFullScreen(void);
    00079
    00081   virtual void SetSize(int,int);
    00082
    00084   virtual int *GetSize();
    00085
    00087   virtual void SetPosition(int,int);
    00088
    00090   virtual int *GetScreenSize();
    00091
    00093   virtual int *GetPosition();
    00094
    00097   virtual void SetWindowName(const char *);
    00098
    00100   void SetWindowInfo(void *);
    00101
    00102   //BTX
    00103   virtual void *GetGenericDisplayId() {return (void *)this->ContextId;};
    00104   virtual void *GetGenericWindowId()  {return (void *)this->WindowId;};
    00105   virtual void *GetGenericParentId()  {return (void *)this->ParentId;};
    00106   virtual AGLContext GetContextId()   {return this->ContextId;};
    00107   virtual void *GetGenericContext()   {return (void *)this->DeviceContext;};
    00108   virtual void SetDisplayId(void *) {};
    00109
    00110   virtual void* GetGenericDrawable()
    00111     {
    00112       vtkWarningMacro("GetGenericDrawable Method not implemented.");
    00113       return 0;
    00114     }
    00115   void SetWindowInfo(char*)
    00116     {
    00117       vtkWarningMacro("SetWindowInfo Method not implemented.");
    00118     }
    00119   void SetParentInfo(char*)
    00120     {
    00121       vtkWarningMacro("SetParentInfo Method not implemented.");
    00122     }
    00123
    00125
    00126   virtual WindowPtr GetWindowId();
    00127   void  SetWindowId(void *foo) {this->SetWindowId((WindowPtr)foo);};
    00129
    00131
    00132   virtual void SetParentId(WindowPtr);
    00133   void  SetParentId(void *foo) {this->SetParentId((WindowPtr)foo);};
    00135
    00137   virtual void SetWindowId(WindowPtr);
    00138
    00139   void  SetContextId(void *);   // hsr
    00140   void  SetDeviceContext(void *);       // hsr
    00141
    00142   //ETX
    00143
    00144   // supply base class virtual function
    00145   vtkSetMacro(MultiSamples,int);
    00146   vtkGetMacro(MultiSamples,int);
    00147
    00152   virtual void SetStereoCapableWindow(int capable);
    00153
    00155   void MakeCurrent();
    00156
    00160   void SetForceMakeCurrent();
    00161
    00164   virtual  int GetEventPending();
    00165
    00173   virtual void SetupPalette(void *hDC);
    00174   virtual void SetupPixelFormat(void *hDC, void *dwFlags, int debug,
    00175                                 int bpp=16, int zbpp=16);
    00177
    00179   void Clean();
    00180
    00182   int GetDepthBufferSize();
    00183
    00185
    00187   void HideCursor();
    00188   void ShowCursor();
    00190
    00191   void UpdateSizeAndPosition(int xPos, int yPos, int xSize, int ySize);
    00192
    00193
    00194 protected:
    00195   vtkCarbonRenderWindow();
    00196   ~vtkCarbonRenderWindow();
    00197
    00198   int ApplicationInitialized; // Toolboxen initialized?
    00199   Boolean fAcceleratedMust;   // input: must renderer be accelerated?
    00200   Boolean draggable;          // input: is the window draggable?
    00201   GLint aglAttributes[64];    // input: pixel format attributes always required
    00202                               //   (reset to what was actually allocated)
    00203   SInt32 VRAM;                // input: minimum VRAM; output: actual
    00204                               //   (if successful otherwise input)
    00205   SInt32 textureRAM;          // input: amount of texture RAM required on card;
    00206                               // output: same (used in allocation)
    00207   AGLPixelFormat fmt;         // input: none; output pixel format...
    00208   AGLContext ContextId;
    00209   AGLDrawable DeviceContext;  // the drawable attached to a rendering context
    00210   WindowPtr WindowId;
    00211   WindowPtr ParentId;
    00212   int OwnWindow;
    00213   int ScreenSize[2];
    00214
    00215   int ScreenMapped;
    00216   int ScreenWindowSize[2];
    00217   void *ScreenDeviceContext;
    00218   int ScreenDoubleBuffer;
    00219   void *ScreenContextId;
    00220
    00221   int CursorHidden;
    00222   int ForceMakeCurrent;
    00223
    00224   void CreateAWindow(int x, int y, int width, int height);
    00225   void InitializeApplication();
    00226 private:
    00227   vtkCarbonRenderWindow(const vtkCarbonRenderWindow&);  // Not implemented.
    00228   void operator=(const vtkCarbonRenderWindow&);  // Not implemented.
    00229 };
    00230
    00231 #endif