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 =========================================================================*/
31 #ifndef vtkCarbonRenderWindowInteractor_h
32 #define vtkCarbonRenderWindowInteractor_h
33 
34 #include "vtkRenderingOpenGLModule.h" // For export macro
36 
37 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
38 #ifdef VTK_USE_TDX
39 class vtkTDxMacDevice;
40 #endif
41 
42 #include <Carbon/Carbon.h> // Carbon and Mac specific
43 
45 {
46 public:
49 
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
54  virtual void Initialize();
55 
57 
64  virtual void Enable();
65  virtual void Disable();
67 
72  void TerminateApp(void);
73 
75 
79  static void SetClassExitMethod(void (*f)(void *), void *arg);
80  static void SetClassExitMethodArgDelete(void (*f)(void *));
82 
85  virtual void ExitCallback();
86 
88 
90  void GetLastMouseDelta(int delta[2]) {
91  delta[0] = this->LastMouseDelta[0]; delta[1] = this->LastMouseDelta[1]; };
92  void SetLastMouseDelta(int deltaX, int deltaY) {
93  this->LastMouseDelta[0] = deltaX; this->LastMouseDelta[1] = deltaY; };
95 
97 
101  void SetMouseInsideWindow(int val) {
102  this->MouseInsideWindow = val; };
104  return this->MouseInsideWindow; };
106 
108 
111  void SetMouseButtonDown(int val) {
112  this->MouseButtonDown = val; };
114  return this->MouseButtonDown; };
116 
117 protected:
120 
121  EventHandlerUPP ViewProcUPP;
122  EventHandlerUPP WindowProcUPP;
123 
124  // For generating event info that Carbon doesn't
125  int LastMouseDelta[2];
129 
130  //BTX
132 
135  static void (*ClassExitMethod)(void *);
136  static void (*ClassExitMethodArgDelete)(void *);
137  static void *ClassExitMethodArg;
138  //ETX
140 
142 
144  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
145  virtual int InternalDestroyTimer(int platformTimerId);
147 
151  virtual void StartEventLoop();
152 
153 #ifdef VTK_USE_TDX
154  vtkTDxMacDevice *Device;
155 #endif
156 
157 private:
159  void operator=(const vtkCarbonRenderWindowInteractor&); // Not implemented.
160 };
161 
162 #endif
void SetLastMouseDelta(int deltaX, int deltaY)
Implementation of vtkTDxDevice on Mac.
virtual int InternalDestroyTimer(int platformTimerId)
void PrintSelf(ostream &os, vtkIndent indent)
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
virtual void Initialize()
static vtkRenderWindowInteractor * New()
platform-independent render window interaction including picking and frame rate control.
implements Carbon specific functions required by vtkRenderWindowInteractor.
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ExitCallback()
#define VTKRENDERINGOPENGL_EXPORT