VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkCocoaRenderWindowInteractor.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00032 #ifndef vtkCocoaRenderWindowInteractor_h 00033 #define vtkCocoaRenderWindowInteractor_h 00034 00035 #include "vtkRenderingOpenGL2Module.h" // For export macro 00036 #include "vtkRenderWindowInteractor.h" 00037 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX 00038 #ifdef VTK_USE_TDX 00039 class vtkTDxMacDevice; 00040 #endif 00041 00042 class VTKRENDERINGOPENGL2_EXPORT vtkCocoaRenderWindowInteractor : public vtkRenderWindowInteractor 00043 { 00044 public: 00046 static vtkCocoaRenderWindowInteractor *New(); 00047 00048 vtkTypeMacro(vtkCocoaRenderWindowInteractor,vtkRenderWindowInteractor); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00050 00052 virtual void Initialize(); 00053 00055 00062 virtual void Enable(); 00063 virtual void Disable(); 00065 00070 void TerminateApp(); 00071 00073 00077 static void SetClassExitMethod(void (*f)(void *), void *arg); 00078 static void SetClassExitMethodArgDelete(void (*f)(void *)); 00080 00083 virtual void ExitCallback(); 00084 00085 // int GetButtonDown(); 00086 // void SetButtonDown(int button); 00087 00088 protected: 00089 vtkCocoaRenderWindowInteractor(); 00090 ~vtkCocoaRenderWindowInteractor(); 00091 00093 00095 void SetTimerDictionary(void *dictionary); // Really an NSMutableDictionary* 00096 void *GetTimerDictionary(); 00098 00100 00103 static void (*ClassExitMethod)(void *); 00104 static void (*ClassExitMethodArgDelete)(void *); 00105 static void *ClassExitMethodArg; 00107 00109 00111 virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration); 00112 virtual int InternalDestroyTimer(int platformTimerId); 00114 00118 virtual void StartEventLoop(); 00119 00121 00123 void SetCocoaManager(void *manager); 00124 void *GetCocoaManager(); 00126 00127 #ifdef VTK_USE_TDX 00128 vtkTDxMacDevice *Device; 00129 #endif 00130 00131 private: 00132 vtkCocoaRenderWindowInteractor(const vtkCocoaRenderWindowInteractor&); // Not implemented. 00133 void operator=(const vtkCocoaRenderWindowInteractor&); // Not implemented. 00134 00135 // Important: this class cannot contain Objective-C instance 00136 // variables for 2 reasons: 00137 // 1) C++ files include this header 00138 // 2) because of garbage collection 00139 // Instead, use the CocoaManager dictionary to keep a collection 00140 // of what would otherwise be Objective-C instance variables. 00141 void *CocoaManager; // Really an NSMutableDictionary* 00142 00143 }; 00144 00145 #endif