00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00033 #ifndef __vtkCarbonRenderWindow_h
00034 #define __vtkCarbonRenderWindow_h
00035
00036 #if defined(__LP64__) && __LP64__
00037 #error vtkCarbonRenderWindow does not work in 64 bit
00038 #endif
00039
00040 #include "vtkOpenGLRenderWindow.h"
00041
00042
00043
00044
00045
00046 #include <AvailabilityMacros.h>
00047 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
00048 #define scalb scalbn
00049 #endif
00050
00051 #include <Carbon/Carbon.h>
00052 #include <AGL/agl.h>
00053
00054 class vtkCarbonRenderWindowInternal;
00055
00056
00057 class VTK_RENDERING_EXPORT vtkCarbonRenderWindow : public vtkOpenGLRenderWindow
00058 {
00059 public:
00060 static vtkCarbonRenderWindow *New();
00061 vtkTypeRevisionMacro(vtkCarbonRenderWindow,vtkOpenGLRenderWindow);
00062 void PrintSelf(ostream& os, vtkIndent indent);
00063
00065 void Start();
00066
00068 void Frame();
00069
00071 virtual void WindowConfigure();
00072
00074 virtual void WindowInitialize();
00075
00080 virtual void Initialize();
00081
00086 virtual void Finalize();
00087
00089 void SetOffScreenRendering(int);
00090
00092 virtual void SetFullScreen(int);
00093
00095 virtual void WindowRemap();
00096
00098 virtual void PrefFullScreen();
00099
00101
00102 virtual void SetSize(int a[2]);
00103 virtual void SetSize(int,int);
00105
00107 virtual int *GetSize();
00108
00110
00111 virtual void SetPosition(int*);
00112 virtual void SetPosition(int,int);
00114
00116 virtual int *GetScreenSize();
00117
00119 virtual int *GetPosition();
00120
00123 virtual void SetWindowName(const char *);
00124
00126 void SetWindowInfo(char *);
00127
00128 void SetNextWindowInfo(char *)
00129 {
00130 vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
00131 }
00132
00133
00134 virtual void *GetGenericDisplayId() {return NULL;}
00135 virtual void *GetGenericWindowId() {return (void *)this->WindowId;}
00136 virtual void *GetGenericParentId() {return (void *)this->ParentId;}
00137 virtual AGLContext GetContextId();
00138 virtual void *GetGenericContext() {return (void*)this->GetContextId();}
00139 virtual void SetDisplayId(void *) {}
00140
00141 virtual void* GetGenericDrawable()
00142 {
00143 vtkWarningMacro("GetGenericDrawable Method not implemented.");
00144 return 0;
00145 }
00146
00147 void SetParentInfo(char*)
00148 {
00149 vtkWarningMacro("SetParentInfo Method not implemented.");
00150 }
00151
00153
00154 virtual HIViewRef GetWindowId();
00155
00156 void SetWindowId(void *foo) {this->SetWindowId((HIViewRef)foo);};
00157 void SetNextWindowId(void*)
00158 {
00159 vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
00160 }
00162
00164
00165 virtual void SetParentId(HIViewRef);
00166 void SetParentId(void *foo) {this->SetParentId((HIViewRef)foo);};
00168
00170 virtual void SetWindowId(HIViewRef);
00171
00173
00174 void SetRootWindow(WindowPtr win);
00175 WindowPtr GetRootWindow();
00177
00178
00179
00180
00181 vtkSetMacro(MultiSamples,int);
00182 vtkGetMacro(MultiSamples,int);
00183
00188 virtual void SetStereoCapableWindow(int capable);
00189
00191 void MakeCurrent();
00192
00196 void SetForceMakeCurrent();
00197
00200 virtual int GetEventPending();
00201
00203 int GetDepthBufferSize();
00204
00206
00208 void HideCursor();
00209 void ShowCursor();
00211
00212 void UpdateSizeAndPosition(int xPos, int yPos, int xSize, int ySize);
00213
00216 void UpdateGLRegion();
00217
00218
00219 protected:
00220 vtkCarbonRenderWindow();
00221 ~vtkCarbonRenderWindow();
00222
00223 vtkCarbonRenderWindowInternal* Internal;
00224
00225 int ApplicationInitialized;
00226 GLint aglAttributes[64];
00227
00228 AGLContext ContextId;
00229 HIViewRef WindowId;
00230 HIViewRef ParentId;
00231 WindowPtr RootWindow;
00232 int OwnWindow;
00233 int ScreenSize[2];
00234
00235 int CursorHidden;
00236 int ForceMakeCurrent;
00237
00238
00239
00240 EventHandlerUPP RegionEventHandlerUPP;
00241 EventHandlerRef RegionEventHandler;
00242 static OSStatus RegionEventProcessor(EventHandlerCallRef er,
00243 EventRef event,
00244 void*);
00245
00246 void InitializeApplication();
00247
00248 void CreateAWindow();
00249 void DestroyWindow();
00250
00251 void CreateOffScreenWindow(int x, int y);
00252 void DestroyOffScreenWindow();
00253 void ResizeOffScreenWindow(int x, int y);
00254
00255 private:
00256 vtkCarbonRenderWindow(const vtkCarbonRenderWindow&);
00257 void operator=(const vtkCarbonRenderWindow&);
00258 };
00259
00260 #endif