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

dox/Rendering/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 =========================================================================*/ 00023 #ifndef __vtkCarbonRenderWindow_h 00024 #define __vtkCarbonRenderWindow_h 00025 00026 #include "vtkOpenGLRenderWindow.h" 00027 00028 00029 #include <Carbon/Carbon.h> // Carbon and MAC specific 00030 #include <OpenGL/gl.h> // Carbon and MAC specific 00031 #include <AGL/agl.h> // Carbon and MAC specific 00032 00033 class vtkIdList; 00034 00035 class VTK_RENDERING_EXPORT vtkCarbonRenderWindow : public vtkOpenGLRenderWindow 00036 { 00037 public: 00038 static vtkCarbonRenderWindow *New(); 00039 vtkTypeRevisionMacro(vtkCarbonRenderWindow,vtkOpenGLRenderWindow); 00040 void PrintSelf(ostream& os, vtkIndent indent); 00041 00043 void Start(void); 00044 00046 void Frame(void); 00047 00049 virtual void WindowConfigure(void); 00050 00052 virtual void WindowInitialize(void); 00053 00058 virtual void Initialize(void); 00059 00064 virtual void Finalize(void); 00065 00067 virtual void SetFullScreen(int); 00068 00070 virtual void WindowRemap(void); 00071 00073 virtual void PrefFullScreen(void); 00074 00076 virtual void SetSize(int,int); 00077 00079 virtual int *GetSize(); 00080 00082 virtual void SetPosition(int,int); 00083 00085 virtual int *GetScreenSize(); 00086 00088 virtual int *GetPosition(); 00089 00092 virtual void SetWindowName(const char *); 00093 00095 void SetWindowInfo(void *); 00096 00097 void SetNextWindowInfo(char *) 00098 { 00099 vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented)."); 00100 } 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);}; 00128 void SetNextWindowId(void*) 00129 { 00130 vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented)."); 00131 } 00133 00135 00136 virtual void SetParentId(WindowPtr); 00137 void SetParentId(void *foo) {this->SetParentId((WindowPtr)foo);}; 00139 00141 virtual void SetWindowId(WindowPtr); 00142 00143 void SetContextId(void *); // hsr 00144 void SetDeviceContext(void *); // hsr 00145 00146 //ETX 00147 00148 // supply base class virtual function 00149 vtkSetMacro(MultiSamples,int); 00150 vtkGetMacro(MultiSamples,int); 00151 00156 virtual void SetStereoCapableWindow(int capable); 00157 00159 void MakeCurrent(); 00160 00164 void SetForceMakeCurrent(); 00165 00168 virtual int GetEventPending(); 00169 00177 virtual void SetupPalette(void *hDC); 00178 virtual void SetupPixelFormat(void *hDC, void *dwFlags, int debug, 00179 int bpp=16, int zbpp=16); 00181 00183 void Clean(); 00184 00186 int GetDepthBufferSize(); 00187 00189 00191 void HideCursor(); 00192 void ShowCursor(); 00194 00195 void UpdateSizeAndPosition(int xPos, int yPos, int xSize, int ySize); 00196 00197 00198 protected: 00199 vtkCarbonRenderWindow(); 00200 ~vtkCarbonRenderWindow(); 00201 00202 int ApplicationInitialized; // Toolboxen initialized? 00203 Boolean fAcceleratedMust; // input: must renderer be accelerated? 00204 Boolean draggable; // input: is the window draggable? 00205 GLint aglAttributes[64]; // input: pixel format attributes always required 00206 // (reset to what was actually allocated) 00207 SInt32 VRAM; // input: minimum VRAM; output: actual 00208 // (if successful otherwise input) 00209 SInt32 textureRAM; // input: amount of texture RAM required on card; 00210 // output: same (used in allocation) 00211 AGLPixelFormat fmt; // input: none; output pixel format... 00212 AGLContext ContextId; 00213 AGLDrawable DeviceContext; // the drawable attached to a rendering context 00214 WindowPtr WindowId; 00215 WindowPtr ParentId; 00216 int OwnWindow; 00217 int ScreenSize[2]; 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 void CreateAWindow(int x, int y, int width, int height); 00229 void InitializeApplication(); 00230 private: 00231 vtkCarbonRenderWindow(const vtkCarbonRenderWindow&); // Not implemented. 00232 void operator=(const vtkCarbonRenderWindow&); // Not implemented. 00233 }; 00234 00235 #endif