00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00028 #ifndef __vtkCarbonRenderWindowInteractor_h
00029 #define __vtkCarbonRenderWindowInteractor_h
00030
00031 #include "vtkRenderWindowInteractor.h"
00032
00033 #include "vtkTDxConfigure.h"
00034 #ifdef VTK_USE_TDX
00035 class vtkTDxMacDevice;
00036 #endif
00037
00038
00039
00040
00041
00042 #include <AvailabilityMacros.h>
00043 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
00044 #define scalb scalbn
00045 #endif
00046
00047 #include <Carbon/Carbon.h>
00048
00049 class VTK_RENDERING_EXPORT vtkCarbonRenderWindowInteractor : public vtkRenderWindowInteractor
00050 {
00051 public:
00053 static vtkCarbonRenderWindowInteractor *New();
00054
00055 vtkTypeMacro(vtkCarbonRenderWindowInteractor,vtkRenderWindowInteractor);
00056 void PrintSelf(ostream& os, vtkIndent indent);
00057
00059 virtual void Initialize();
00060
00062
00069 virtual void Enable();
00070 virtual void Disable();
00072
00076 virtual void Start();
00077
00079
00084 vtkSetMacro(InstallMessageProc,int);
00085 vtkGetMacro(InstallMessageProc,int);
00086 vtkBooleanMacro(InstallMessageProc,int);
00088
00093 void TerminateApp(void);
00094
00096
00100 static void SetClassExitMethod(void (*f)(void *), void *arg);
00101 static void SetClassExitMethodArgDelete(void (*f)(void *));
00103
00106 virtual void ExitCallback();
00107
00109
00111 void GetLastMouseDelta(int delta[2]) {
00112 delta[0] = this->LastMouseDelta[0]; delta[1] = this->LastMouseDelta[1]; };
00113 void SetLastMouseDelta(int deltaX, int deltaY) {
00114 this->LastMouseDelta[0] = deltaX; this->LastMouseDelta[1] = deltaY; };
00116
00118
00122 void SetMouseInsideWindow(int val) {
00123 this->MouseInsideWindow = val; };
00124 int GetMouseInsideWindow() {
00125 return this->MouseInsideWindow; };
00127
00129
00132 void SetMouseButtonDown(int val) {
00133 this->MouseButtonDown = val; };
00134 int GetMouseButtonDown() {
00135 return this->MouseButtonDown; };
00137
00138 protected:
00139 vtkCarbonRenderWindowInteractor();
00140 ~vtkCarbonRenderWindowInteractor();
00141
00142 EventHandlerUPP ViewProcUPP;
00143 EventHandlerUPP WindowProcUPP;
00144 int InstallMessageProc;
00145
00146
00147 int LastMouseDelta[2];
00148 int LeaveCheckId;
00149 int MouseInsideWindow;
00150 int MouseButtonDown;
00151
00152
00154
00157 static void (*ClassExitMethod)(void *);
00158 static void (*ClassExitMethodArgDelete)(void *);
00159 static void *ClassExitMethodArg;
00160
00162
00164
00166 virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
00167 virtual int InternalDestroyTimer(int platformTimerId);
00169
00170 #ifdef VTK_USE_TDX
00171 vtkTDxMacDevice *Device;
00172 #endif
00173
00174 private:
00175 vtkCarbonRenderWindowInteractor(const vtkCarbonRenderWindowInteractor&);
00176 void operator=(const vtkCarbonRenderWindowInteractor&);
00177 };
00178
00179 #endif