VTK
vtkCocoaRenderWindowInteractor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCocoaRenderWindowInteractor.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 =========================================================================*/
33 #ifndef vtkCocoaRenderWindowInteractor_h
34 #define vtkCocoaRenderWindowInteractor_h
35 
36 #include "vtkRenderingOpenGL2Module.h" // For export macro
38 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
39 #ifdef VTK_USE_TDX
40 class vtkTDxMacDevice;
41 #endif
42 
43 class VTKRENDERINGOPENGL2_EXPORT vtkCocoaRenderWindowInteractor : public vtkRenderWindowInteractor
44 {
45 public:
50 
52  void PrintSelf(ostream& os, vtkIndent indent);
53 
57  virtual void Initialize();
58 
60 
69  virtual void Enable();
70  virtual void Disable();
72 
78  void TerminateApp();
79 
81 
87  static void SetClassExitMethod(void (*f)(void *), void *arg);
88  static void SetClassExitMethodArgDelete(void (*f)(void *));
90 
95  virtual void ExitCallback();
96 
97 // int GetButtonDown();
98 // void SetButtonDown(int button);
99 
100 protected:
103 
108  void SetTimerDictionary(void *dictionary); // Really an NSMutableDictionary*
110 
112 
117  static void (*ClassExitMethod)(void *);
118  static void (*ClassExitMethodArgDelete)(void *);
119  static void *ClassExitMethodArg;
121 
123 
127  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
128  virtual int InternalDestroyTimer(int platformTimerId);
130 
136  virtual void StartEventLoop();
137 
139 
143  void SetCocoaManager(void *manager);
146 
147 #ifdef VTK_USE_TDX
148  vtkTDxMacDevice *Device;
149 #endif
150 
151 private:
153  void operator=(const vtkCocoaRenderWindowInteractor&) VTK_DELETE_FUNCTION;
154 
155  // Important: this class cannot contain Objective-C instance
156  // variables for 2 reasons:
157  // 1) C++ files include this header
158  // 2) because of garbage collection
159  // Instead, use the CocoaManager dictionary to keep a collection
160  // of what would otherwise be Objective-C instance variables.
161  void *CocoaManager; // Really an NSMutableDictionary*
162 
163 };
164 
165 #endif
implements Cocoa specific functions required by vtkRenderWindowInteractor.
virtual void Enable()
Enable/Disable interactions.
static void SetClassExitMethod(void(*f)(void *), void *arg)
Methods to set the default exit method for the class.
virtual void Initialize()
Initialize the even handler.
void SetCocoaManager(void *manager)
Accessors for the cocoa manager (Really an NSMutableDictionary*).
virtual void ExitCallback()
These methods correspond to the the Exit, User and Pick callbacks.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static vtkCocoaRenderWindowInteractor * New()
Construct object so that light follows camera motion.
void TerminateApp()
Cocoa specific application terminate, calls ClassExitMethod then calls PostQuitMessage(0) to terminat...
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Cocoa-specific internal timer methods.
void SetTimerDictionary(void *dictionary)
Accessors for the Cocoa member variables.
virtual int InternalDestroyTimer(int platformTimerId)
static void SetClassExitMethodArgDelete(void(*f)(void *))
virtual void StartEventLoop()
This will start up the event loop and never return.
a simple class to control print indentation
Definition: vtkIndent.h:40
platform-independent render window interaction including picking and frame rate control.
Implementation of vtkTDxDevice on Mac.