00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00024 #ifndef __vtkCarbonRenderWindow_h
00025 #define __vtkCarbonRenderWindow_h
00026
00027 #include "vtkOpenGLRenderWindow.h"
00028
00029 #include <Carbon/Carbon.h>
00030 #include <AGL/agl.h>
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
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
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
00151
00152
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;
00206 Boolean fAcceleratedMust;
00207 Boolean draggable;
00208 GLint aglAttributes[64];
00209
00210 SInt32 VRAM;
00211
00212 SInt32 textureRAM;
00213
00214 AGLPixelFormat fmt;
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
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&);
00236 void operator=(const vtkCarbonRenderWindow&);
00237 };
00238
00239 #endif