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 =========================================================================*/
32 #ifndef vtkCocoaRenderWindowInteractor_h
33 #define vtkCocoaRenderWindowInteractor_h
34 
35 #include "vtkRenderingOpenGL2Module.h" // For export macro
37 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
38 #ifdef VTK_USE_TDX
39 class vtkTDxMacDevice;
40 #endif
41 
42 class VTKRENDERINGOPENGL2_EXPORT vtkCocoaRenderWindowInteractor : public vtkRenderWindowInteractor
43 {
44 public:
47 
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
52  virtual void Initialize();
53 
55 
62  virtual void Enable();
63  virtual void Disable();
65 
70  void TerminateApp();
71 
73 
77  static void SetClassExitMethod(void (*f)(void *), void *arg);
78  static void SetClassExitMethodArgDelete(void (*f)(void *));
80 
83  virtual void ExitCallback();
84 
85 // int GetButtonDown();
86 // void SetButtonDown(int button);
87 
88 protected:
91 
93 
95  void SetTimerDictionary(void *dictionary); // Really an NSMutableDictionary*
96  void *GetTimerDictionary();
98 
100 
103  static void (*ClassExitMethod)(void *);
104  static void (*ClassExitMethodArgDelete)(void *);
105  static void *ClassExitMethodArg;
107 
109 
111  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
112  virtual int InternalDestroyTimer(int platformTimerId);
114 
118  virtual void StartEventLoop();
119 
121 
123  void SetCocoaManager(void *manager);
124  void *GetCocoaManager();
126 
127 #ifdef VTK_USE_TDX
128  vtkTDxMacDevice *Device;
129 #endif
130 
131 private:
133  void operator=(const vtkCocoaRenderWindowInteractor&); // Not implemented.
134 
135  // Important: this class cannot contain Objective-C instance
136  // variables for 2 reasons:
137  // 1) C++ files include this header
138  // 2) because of garbage collection
139  // Instead, use the CocoaManager dictionary to keep a collection
140  // of what would otherwise be Objective-C instance variables.
141  void *CocoaManager; // Really an NSMutableDictionary*
142 
143 };
144 
145 #endif
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()
implements Cocoa specific functions required by vtkRenderWindowInteractor.
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ExitCallback()