00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00063 #ifndef __vtkInteractorStyleUser_h
00064 #define __vtkInteractorStyleUser_h
00065
00066 #include "vtkInteractorStyleSwitch.h"
00067
00068
00069 #define VTKIS_USERINTERACTION 8
00070
00071 class VTK_EXPORT vtkInteractorStyleUser : public vtkInteractorStyleSwitch
00072 {
00073 public:
00074 static vtkInteractorStyleUser *New();
00075 vtkTypeMacro(vtkInteractorStyleUser,vtkInteractorStyleSwitch);
00076 void PrintSelf(ostream& os, vtkIndent indent);
00077
00085 void SetMouseMoveMethod(void (*f)(void *), void *arg);
00086 void SetMouseMoveMethodArgDelete(void (*f)(void *));
00087
00092 void SetButtonPressMethod(void (*f)(void *), void *arg);
00093 void SetButtonPressMethodArgDelete(void (*f)(void *));
00094
00100 void SetButtonReleaseMethod(void (*f)(void *), void *arg);
00101 void SetButtonReleaseMethodArgDelete(void (*f)(void *));
00102
00107 void SetKeyPressMethod(void (*f)(void *), void *arg);
00108 void SetKeyPressMethodArgDelete(void (*f)(void *));
00109
00113 void SetKeyReleaseMethod(void (*f)(void *), void *arg);
00114 void SetKeyReleaseMethodArgDelete(void (*f)(void *));
00115
00120 void SetCharMethod(void (*f)(void *), void *arg);
00121 void SetCharMethodArgDelete(void (*f)(void *));
00122
00127 void SetConfigureMethod(void (*f)(void *), void *arg);
00128 void SetConfigureMethodArgDelete(void (*f)(void *));
00129
00133 void SetEnterMethod(void (*f)(void *), void *arg);
00134 void SetEnterMethodArgDelete(void (*f)(void *));
00135 void SetLeaveMethod(void (*f)(void *), void *arg);
00136 void SetLeaveMethodArgDelete(void (*f)(void *));
00137
00142 void SetTimerMethod(void (*f)(void *), void *arg);
00143 void SetTimerMethodArgDelete(void (*f)(void *));
00144
00149 vtkGetVector2Macro(LastPos,int);
00150
00154 vtkGetVector2Macro(OldPos,int);
00155
00158 vtkGetMacro(ShiftKey,int);
00159 vtkGetMacro(CtrlKey,int);
00160
00162 vtkGetMacro(Char,int);
00163
00166 vtkGetStringMacro(KeySym);
00167
00170 vtkGetMacro(Button,int);
00171
00175 void SetUserInteractionMethod(void (*f)(void *), void *arg);
00176 void SetUserInteractionMethodArgDelete(void (*f)(void *));
00177
00181 void StartUserInteraction();
00182 void EndUserInteraction();
00183
00184 protected:
00185 vtkInteractorStyleUser();
00186 ~vtkInteractorStyleUser();
00187 vtkInteractorStyleUser(const vtkInteractorStyleUser&) {};
00188 void operator=(const vtkInteractorStyleUser&) {};
00189
00190 void OnChar(int ctrl, int shift, char keycode, int repeatcount);
00191 void OnKeyPress(int ctrl, int shift, char keycode, char *keysym,
00192 int repeatcount);
00193 void OnKeyRelease(int ctrl, int shift, char keycode, char *keysym,
00194 int repeatcount);
00195
00196 void OnLeftButtonDown(int ctrl, int shift, int X, int Y);
00197 void OnLeftButtonUp(int ctrl, int shift, int X, int Y);
00198 void OnMiddleButtonDown(int ctrl, int shift, int X, int Y);
00199 void OnMiddleButtonUp(int ctrl, int shift, int X, int Y);
00200 void OnRightButtonDown(int ctrl, int shift, int X, int Y);
00201 void OnRightButtonUp(int ctrl, int shift, int X, int Y);
00202
00203 void OnMouseMove(int ctrl, int shift, int X, int Y);
00204
00205 void OnConfigure(int width, int height);
00206
00207 void OnEnter(int ctrl, int shift, int X, int Y);
00208 void OnLeave(int ctrl, int shift, int X, int Y);
00209
00210 void OnTimer(void);
00211
00212 int OldPos[2];
00213
00214 int Char;
00215 char *KeySym;
00216 int Button;
00217
00218 unsigned long MouseMoveTag;
00219 unsigned long KeyPressTag;
00220 unsigned long KeyReleaseTag;
00221 unsigned long CharTag;
00222 unsigned long EnterTag;
00223 unsigned long LeaveTag;
00224 unsigned long ConfigureTag;
00225 unsigned long TimerTag;
00226 unsigned long UserTag;
00227
00228 void vtkSetOldCallback(unsigned long &tag, unsigned long event,
00229 void (*f)(void *), void *arg);
00230 void vtkSetOldDelete(unsigned long tag, void (*f)(void *));
00231 };
00232
00233 #endif