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

graphics/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 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00040 
00063 #ifndef __vtkInteractorStyleUser_h
00064 #define __vtkInteractorStyleUser_h
00065 
00066 #include "vtkInteractorStyleSwitch.h"
00067 
00068 // new motion flag
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

Generated on Wed Nov 21 12:26:59 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001