VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkIOSRenderWindowInteractor.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 vtkIOSRenderWindowInteractor_h 00029 #define vtkIOSRenderWindowInteractor_h 00030 00031 #include "vtkRenderingOpenGL2Module.h" // For export macro 00032 #include "vtkRenderWindowInteractor.h" 00033 00034 class VTKRENDERINGOPENGL2_EXPORT vtkIOSRenderWindowInteractor : public vtkRenderWindowInteractor 00035 { 00036 public: 00038 static vtkIOSRenderWindowInteractor *New(); 00039 00040 vtkTypeMacro(vtkIOSRenderWindowInteractor,vtkRenderWindowInteractor); 00041 void PrintSelf(ostream& os, vtkIndent indent); 00042 00044 virtual void Initialize(); 00045 00047 00054 virtual void Enable(); 00055 virtual void Disable(); 00057 00062 void TerminateApp(); 00063 00065 00069 static void SetClassExitMethod(void (*f)(void *), void *arg); 00070 static void SetClassExitMethodArgDelete(void (*f)(void *)); 00072 00075 virtual void ExitCallback(); 00076 00078 00080 int GetContactIndex(void *ptr); 00081 void ClearContactIndex(void *ptr); 00083 00084 // int GetButtonDown(); 00085 // void SetButtonDown(int button); 00086 00087 protected: 00088 vtkIOSRenderWindowInteractor(); 00089 ~vtkIOSRenderWindowInteractor(); 00090 00092 00094 void SetTimerDictionary(void *dictionary); // Really an NSMutableDictionary* 00095 void *GetTimerDictionary(); 00097 00099 00102 static void (*ClassExitMethod)(void *); 00103 static void (*ClassExitMethodArgDelete)(void *); 00104 static void *ClassExitMethodArg; 00106 00107 void *IDLookup[VTKI_MAX_POINTERS]; 00108 00110 00112 virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration); 00113 virtual int InternalDestroyTimer(int platformTimerId); 00115 00119 virtual void StartEventLoop(); 00120 00122 00124 void SetIOSManager(void *manager); 00125 void *GetIOSManager(); 00127 00128 private: 00129 vtkIOSRenderWindowInteractor(const vtkIOSRenderWindowInteractor&); // Not implemented. 00130 void operator=(const vtkIOSRenderWindowInteractor&); // Not implemented. 00131 00132 // Important: this class cannot contain Objective-C instance 00133 // variables for 2 reasons: 00134 // 1) C++ files include this header 00135 // 2) because of garbage collection 00136 // Instead, use the IOSManager dictionary to keep a collection 00137 // of what would otherwise be Objective-C instance variables. 00138 void *IOSManager; // Really an NSMutableDictionary* 00139 00140 }; 00141 00142 #endif