VTK
vtkCarbonRenderWindowInteractor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCarbonRenderWindowInteractor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
28 #ifndef __vtkCarbonRenderWindowInteractor_h
29 #define __vtkCarbonRenderWindowInteractor_h
30 
32 
33 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
34 #ifdef VTK_USE_TDX
35 class vtkTDxMacDevice;
36 #endif
37 
38 // The 10.3.9 SDK (and older probably) have a bug in fp.h (in the Carbon
39 // umbrella framework) which this works around. Without this, there
40 // would be a compile error from the Carbon header if Python wrappings
41 // were enabled.
42 #include <AvailabilityMacros.h> // Needed for MAC_OS_X_VERSION_MAX_ALLOWED
43 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
44  #define scalb scalbn
45 #endif
46 
47 #include <Carbon/Carbon.h> // Carbon and Mac specific
48 
50 {
51 public:
54 
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
59  virtual void Initialize();
60 
62 
69  virtual void Enable();
70  virtual void Disable();
72 
76  virtual void Start();
77 
79 
84  vtkSetMacro(InstallMessageProc,int);
85  vtkGetMacro(InstallMessageProc,int);
86  vtkBooleanMacro(InstallMessageProc,int);
88 
93  void TerminateApp(void);
94 
96 
100  static void SetClassExitMethod(void (*f)(void *), void *arg);
101  static void SetClassExitMethodArgDelete(void (*f)(void *));
103 
106  virtual void ExitCallback();
107 
109 
111  void GetLastMouseDelta(int delta[2]) {
112  delta[0] = this->LastMouseDelta[0]; delta[1] = this->LastMouseDelta[1]; };
113  void SetLastMouseDelta(int deltaX, int deltaY) {
114  this->LastMouseDelta[0] = deltaX; this->LastMouseDelta[1] = deltaY; };
116 
118 
122  void SetMouseInsideWindow(int val) {
123  this->MouseInsideWindow = val; };
125  return this->MouseInsideWindow; };
127 
129 
132  void SetMouseButtonDown(int val) {
133  this->MouseButtonDown = val; };
135  return this->MouseButtonDown; };
137 
138 protected:
141 
142  EventHandlerUPP ViewProcUPP;
143  EventHandlerUPP WindowProcUPP;
145 
146  // For generating event info that Carbon doesn't
147  int LastMouseDelta[2];
151 
152  //BTX
154 
157  static void (*ClassExitMethod)(void *);
158  static void (*ClassExitMethodArgDelete)(void *);
159  static void *ClassExitMethodArg;
160  //ETX
162 
164 
166  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
167  virtual int InternalDestroyTimer(int platformTimerId);
169 
170 #ifdef VTK_USE_TDX
171  vtkTDxMacDevice *Device;
172 #endif
173 
174 private:
176  void operator=(const vtkCarbonRenderWindowInteractor&); // Not implemented.
177 };
178 
179 #endif