Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Rendering/vtkInteractorStyleUser.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkInteractorStyleUser.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00016 
00042 #ifndef __vtkInteractorStyleUser_h
00043 #define __vtkInteractorStyleUser_h
00044 
00045 #include "vtkInteractorStyle.h"
00046 
00047 // new motion flag
00048 #define VTKIS_USERINTERACTION 8 
00049 
00050 class VTK_RENDERING_EXPORT vtkInteractorStyleUser : public vtkInteractorStyle 
00051 {
00052 public:
00053   static vtkInteractorStyleUser *New();
00054   vtkTypeRevisionMacro(vtkInteractorStyleUser,vtkInteractorStyle);
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056   
00057 #ifndef VTK_REMOVE_LEGACY_CODE
00058 
00059 
00060   void SetMouseMoveMethod(void (*f)(void *), void *arg);
00061   void SetMouseMoveMethodArgDelete(void (*f)(void *));
00062   void SetButtonPressMethod(void (*f)(void *), void *arg);
00063   void SetButtonPressMethodArgDelete(void (*f)(void *));
00064   void SetButtonReleaseMethod(void (*f)(void *), void *arg);
00065   void SetButtonReleaseMethodArgDelete(void (*f)(void *));
00066   void SetKeyPressMethod(void (*f)(void *), void *arg);
00067   void SetKeyPressMethodArgDelete(void (*f)(void *));
00068   void SetKeyReleaseMethod(void (*f)(void *), void *arg);
00069   void SetKeyReleaseMethodArgDelete(void (*f)(void *));
00070   void SetCharMethod(void (*f)(void *), void *arg);
00071   void SetCharMethodArgDelete(void (*f)(void *));
00072   void SetConfigureMethod(void (*f)(void *), void *arg);
00073   void SetConfigureMethodArgDelete(void (*f)(void *));
00074   void SetExposeMethod(void (*f)(void *), void *arg);
00075   void SetExposeMethodArgDelete(void (*f)(void *));
00076   void SetEnterMethod(void (*f)(void *), void *arg);
00077   void SetEnterMethodArgDelete(void (*f)(void *));
00078   void SetLeaveMethod(void (*f)(void *), void *arg);
00079   void SetLeaveMethodArgDelete(void (*f)(void *));
00080   void SetTimerMethod(void (*f)(void *), void *arg);
00081   void SetTimerMethodArgDelete(void (*f)(void *));
00082   void SetUserInteractionMethod(void (*f)(void *), void *arg);
00083   void SetUserInteractionMethodArgDelete(void (*f)(void *));
00084   void StartUserInteraction();
00085   void EndUserInteraction();
00087 #endif
00088   
00090 
00094   vtkGetVector2Macro(LastPos,int);
00096 
00098 
00101   vtkGetVector2Macro(OldPos,int);
00103 
00105 
00107   vtkGetMacro(ShiftKey,int);
00108   vtkGetMacro(CtrlKey,int);
00110 
00112 
00113   vtkGetMacro(Char,int);
00115 
00117 
00119   vtkGetStringMacro(KeySym);
00121 
00123 
00125   vtkGetMacro(Button,int);
00127 
00129 
00130   virtual void OnMouseMove();
00131   virtual void OnLeftButtonDown();
00132   virtual void OnLeftButtonUp();
00133   virtual void OnMiddleButtonDown();
00134   virtual void OnMiddleButtonUp();
00135   virtual void OnRightButtonDown();
00136   virtual void OnRightButtonUp();
00138 
00140 
00141   virtual void OnChar();
00142   virtual void OnKeyPress();
00143   virtual void OnKeyRelease();
00145 
00147 
00148   virtual void OnExpose();
00149   virtual void OnConfigure();
00150   virtual void OnEnter();
00151   virtual void OnLeave();
00153 
00154   virtual void OnTimer();
00155 
00156 protected:
00157 
00158   vtkInteractorStyleUser();
00159   ~vtkInteractorStyleUser();
00160 
00161   int LastPos[2];
00162   int OldPos[2];
00163 
00164   int ShiftKey;
00165   int CtrlKey;
00166   int Char;
00167   char *KeySym;
00168   int Button;
00169 
00170   unsigned long MouseMoveTag;
00171   unsigned long KeyPressTag;
00172   unsigned long KeyReleaseTag;
00173   unsigned long CharTag;
00174   unsigned long EnterTag;
00175   unsigned long LeaveTag;
00176   unsigned long ExposeTag;
00177   unsigned long ConfigureTag;
00178   unsigned long TimerTag;
00179   unsigned long UserTag;
00180 
00181 #ifndef VTK_REMOVE_LEGACY_CODE
00182   void vtkSetOldCallback(unsigned long &tag, unsigned long event, 
00183                          void (*f)(void *), void *arg);
00184   void vtkSetOldDelete(unsigned long tag, void (*f)(void *));
00185 #endif
00186 private:
00187   vtkInteractorStyleUser(const vtkInteractorStyleUser&);  // Not implemented.
00188   void operator=(const vtkInteractorStyleUser&);  // Not implemented.
00189 };
00190 
00191 #endif