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 
102  this->MouseInsideWindow = val; };
104  return this->MouseInsideWindow; };
106 
108 
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
vtkCarbonRenderWindowInteractor::SetMouseButtonDown
void SetMouseButtonDown(int val)
Definition: vtkCarbonRenderWindowInteractor.h:111
vtkCarbonRenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
vtkCarbonRenderWindowInteractor::GetMouseInsideWindow
int GetMouseInsideWindow()
Definition: vtkCarbonRenderWindowInteractor.h:103
vtkCarbonRenderWindowInteractor::ViewProcUPP
EventHandlerUPP ViewProcUPP
Definition: vtkCarbonRenderWindowInteractor.h:121
vtkCarbonRenderWindowInteractor::LeaveCheckId
int LeaveCheckId
Definition: vtkCarbonRenderWindowInteractor.h:126
vtkCarbonRenderWindowInteractor::~vtkCarbonRenderWindowInteractor
~vtkCarbonRenderWindowInteractor()
vtkRenderingOpenGLModule.h
vtkCarbonRenderWindowInteractor::Initialize
virtual void Initialize()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkTDxMacDevice
Implementation of vtkTDxDevice on Mac.
Definition: vtkTDxMacDevice.h:36
vtkCarbonRenderWindowInteractor::MouseButtonDown
int MouseButtonDown
Definition: vtkCarbonRenderWindowInteractor.h:128
vtkCarbonRenderWindowInteractor::SetLastMouseDelta
void SetLastMouseDelta(int deltaX, int deltaY)
Definition: vtkCarbonRenderWindowInteractor.h:92
vtkCarbonRenderWindowInteractor::GetMouseButtonDown
int GetMouseButtonDown()
Definition: vtkCarbonRenderWindowInteractor.h:113
vtkCarbonRenderWindowInteractor::ClassExitMethodArg
static void * ClassExitMethodArg
Definition: vtkCarbonRenderWindowInteractor.h:137
vtkgl::val
GLuint GLfloat * val
Definition: vtkgl.h:13789
vtkCarbonRenderWindowInteractor::MouseInsideWindow
int MouseInsideWindow
Definition: vtkCarbonRenderWindowInteractor.h:127
vtkCarbonRenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
vtkCarbonRenderWindowInteractor::ExitCallback
virtual void ExitCallback()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCarbonRenderWindowInteractor::New
static vtkCarbonRenderWindowInteractor * New()
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:80
vtkCarbonRenderWindowInteractor::Enable
virtual void Enable()
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkCarbonRenderWindowInteractor::vtkCarbonRenderWindowInteractor
vtkCarbonRenderWindowInteractor()
vtkCarbonRenderWindowInteractor::WindowProcUPP
EventHandlerUPP WindowProcUPP
Definition: vtkCarbonRenderWindowInteractor.h:122
vtkCarbonRenderWindowInteractor::GetLastMouseDelta
void GetLastMouseDelta(int delta[2])
Definition: vtkCarbonRenderWindowInteractor.h:90
vtkCarbonRenderWindowInteractor::SetMouseInsideWindow
void SetMouseInsideWindow(int val)
Definition: vtkCarbonRenderWindowInteractor.h:101
vtkCarbonRenderWindowInteractor::SetClassExitMethod
static void SetClassExitMethod(void(*f)(void *), void *arg)
vtkCarbonRenderWindowInteractor::TerminateApp
void TerminateApp(void)
vtkRenderWindowInteractor.h
vtkCarbonRenderWindowInteractor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkgl::void
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
vtkTDxConfigure.h
vtkCarbonRenderWindowInteractor::Disable
virtual void Disable()
vtkCarbonRenderWindowInteractor
implements Carbon specific functions required by vtkRenderWindowInteractor.
Definition: vtkCarbonRenderWindowInteractor.h:45
vtkCarbonRenderWindowInteractor::SetClassExitMethodArgDelete
static void SetClassExitMethodArgDelete(void(*f)(void *))
VTKRENDERINGOPENGL_EXPORT
#define VTKRENDERINGOPENGL_EXPORT
Definition: vtkRenderingOpenGLModule.h:15
vtkCarbonRenderWindowInteractor::InternalCreateTimer
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)