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 =========================================================================*/ 00028 #ifndef __vtkCocoaRenderWindowInteractor_h 00029 #define __vtkCocoaRenderWindowInteractor_h 00030 00031 #include "vtkRenderingOpenGLModule.h" // For export macro 00032 #include "vtkRenderWindowInteractor.h" 00033 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX 00034 #ifdef VTK_USE_TDX 00035 class vtkTDxMacDevice; 00036 #endif 00037 00038 class VTKRENDERINGOPENGL_EXPORT vtkCocoaRenderWindowInteractor : public vtkRenderWindowInteractor 00039 { 00040 public: 00042 static vtkCocoaRenderWindowInteractor *New(); 00043 00044 vtkTypeMacro(vtkCocoaRenderWindowInteractor,vtkRenderWindowInteractor); 00045 void PrintSelf(ostream& os, vtkIndent indent); 00046 00048 virtual void Initialize(); 00049 00051 00058 virtual void Enable(); 00059 virtual void Disable(); 00061 00065 virtual void Start(); 00066 00068 00073 vtkSetMacro(InstallMessageProc,int); 00074 vtkGetMacro(InstallMessageProc,int); 00075 vtkBooleanMacro(InstallMessageProc,int); 00077 00082 void TerminateApp(); 00083 00085 00089 static void SetClassExitMethod(void (*f)(void *), void *arg); 00090 static void SetClassExitMethodArgDelete(void (*f)(void *)); 00092 00095 virtual void ExitCallback(); 00096 00097 // int GetButtonDown(); 00098 // void SetButtonDown(int button); 00099 00100 protected: 00101 vtkCocoaRenderWindowInteractor(); 00102 ~vtkCocoaRenderWindowInteractor(); 00103 00104 int InstallMessageProc; 00105 00107 00109 void SetTimerDictionary(void *dictionary); // Really an NSMutableDictionary* 00110 void *GetTimerDictionary(); 00111 void SetCocoaServer(void *server); // Really a vtkCocoaServer* 00112 void *GetCocoaServer(); 00114 00115 //BTX 00117 00120 static void (*ClassExitMethod)(void *); 00121 static void (*ClassExitMethodArgDelete)(void *); 00122 static void *ClassExitMethodArg; 00123 //ETX 00125 00127 00129 virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration); 00130 virtual int InternalDestroyTimer(int platformTimerId); 00132 00134 00136 void SetCocoaManager(void *manager); 00137 void *GetCocoaManager(); 00139 00140 #ifdef VTK_USE_TDX 00141 vtkTDxMacDevice *Device; 00142 #endif 00143 00144 private: 00145 vtkCocoaRenderWindowInteractor(const vtkCocoaRenderWindowInteractor&); // Not implemented. 00146 void operator=(const vtkCocoaRenderWindowInteractor&); // Not implemented. 00147 00148 // Important: this class cannot contain Objective-C instance 00149 // variables for 2 reasons: 00150 // 1) C++ files include this header 00151 // 2) because of garbage collection 00152 // Instead, use the CocoaManager dictionary to keep a collection 00153 // of what would otherwise be Objective-C instance variables. 00154 void *CocoaManager; // Really an NSMutableDictionary* 00155 00156 }; 00157 00158 #endif