MouseInterface.hh 5.87 KB
 Jan Möbius committed Aug 05, 2009 1 /*===========================================================================*\  Jan Möbius committed Nov 25, 2010 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 * * * OpenFlipper * * Copyright (C) 2001-2010 by Computer Graphics Group, RWTH Aachen * * www.openflipper.org * * * *--------------------------------------------------------------------------- * * This file is part of OpenFlipper. * * * * OpenFlipper is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation, either version 3 of * * the License, or (at your option) any later version with the * * following exceptions: * * * * If other files instantiate templates or use macros * * or inline functions from this file, or you compile this file and * * link it with other files to produce an executable, this file does * * not by itself cause the resulting executable to be covered by the * * GNU Lesser General Public License. This exception does not however * * invalidate any other reasons why the executable file might be * * covered by the GNU Lesser General Public License. * * * * OpenFlipper is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * * You should have received a copy of the GNU LesserGeneral Public * * License along with OpenFlipper. If not, * * see . * * *  Jan Möbius committed Aug 05, 2009 33 34 35 \*===========================================================================*/ /*===========================================================================*\  Jan Möbius committed Nov 25, 2010 36 37 38 39 40 * * * $Revision$ * * $LastChangedBy$ * * $Date$ * * *  Jan Möbius committed Aug 05, 2009 41 \*===========================================================================*/  Jan Möbius committed Aug 29, 2008 42 43 44 45 46 47 48  // // C++ Interface: Basic Interface for mouse events //  Jan Möbius committed Jan 14, 2009 49 // Description:  Jan Möbius committed Aug 29, 2008 50 51 52 53 54 55 // // // Author: Jan Moebius , (C) 2007  Jan Möbius committed Jan 14, 2009 56 57 #ifndef MOUSEINTERFACE_HH #define MOUSEINTERFACE_HH  Jan Möbius committed Aug 29, 2008 58 59  #include  Jan Möbius committed Jan 14, 2009 60 61 62 63  /** \brief Interface for all plugins which have to react on mouse events * * When using mouse events in your plugins implement this interface. Remember that  Jan Möbius committed Aug 29, 2008 64  * all plugins may get these signals. Therefore you hav to check if the current pickingMode  Jan Möbius committed Jan 30, 2009 65 66 67  * you want to react on is active before doing anything. Only the slotMouseEventIdentify is * independent of picking modes. *  Mike Kremer committed Feb 04, 2009 68  * The slotMouseWheelEvent and slotMouseEvent only get called when the system is in picking  Jan Möbius committed Jan 30, 2009 69 70 71  * mode. * * slotMouseEventIdentify will be used when question mode is active.  Mike Kremer committed Mar 26, 2009 72 73 74  * * See our tutorial \ref ex3 for an example of how to use mouse and keyboard events * within a plugin.  Jan Möbius committed Jan 30, 2009 75  */  Jan Möbius committed Aug 29, 2008 76 class MouseInterface {  Jan Möbius committed Jan 14, 2009 77   Jan Möbius committed Aug 29, 2008 78  private slots :  Jan Möbius committed Jan 14, 2009 79   Jan Möbius committed Aug 29, 2008 80  /** \brief Wheel Event from Main App  Jan Möbius committed Jan 14, 2009 81  *  Jan Möbius committed Aug 29, 2008 82 83  * This slot is called if a wheel event occured in the Viewer and is extended by * the current Mode set in the Viewer. You can add additional Picking Modes to  Jan Möbius committed Jan 14, 2009 84  * the Viewer by using the picking interface.  Jan Möbius committed Aug 29, 2008 85 86 87 88  * This slot will only get called in pickingMode. * @param _event Mousevent * @param _mode Name of the current Picking Mode. */  Dirk Wilden committed Sep 30, 2008 89  virtual void slotMouseWheelEvent(QWheelEvent * /*_event*/, const std::string & /*_mode*/) {};  Jan Möbius committed Jan 14, 2009 90   Jan Möbius committed Aug 29, 2008 91  /** \brief Mouse Event from Main App ( Picking Mode )  Jan Möbius committed Jan 14, 2009 92 93 94  * * This slot is called if a mouse event occured in the Viewer * This slot will only get called in pickingMode.  Jan Möbius committed Aug 29, 2008 95  * Right button clicks will not be passed to the plugins as this is reserved for  Jan Möbius committed Jan 14, 2009 96 97  * the context Menu. *  Jan Möbius committed Aug 29, 2008 98 99  * @param _event Mousevent */  Dirk Wilden committed Sep 30, 2008 100  virtual void slotMouseEvent( QMouseEvent* /*_event*/ ) {};  Jan Möbius committed Jan 14, 2009 101   Jan Möbius committed Aug 29, 2008 102  /** \brief Mouse Event from Main App ( Identify Mode )  Jan Möbius committed Jan 14, 2009 103 104 105  * * This slot is called if a mouse event occured in the Viewer * This slot will only get called in identifyMode.  Jan Möbius committed Aug 29, 2008 106  * Right button clicks will not be passed to the plugins as this is reserved for  Jan Möbius committed Jan 14, 2009 107 108  * the context Menu. *  Jan Möbius committed Aug 29, 2008 109  * @param _event Mousevent  Jan Möbius committed Jan 14, 2009 110  */  Jan Möbius committed Jul 09, 2010 111 112 113 114 115 116 117 118 119 120 121 122  virtual void slotMouseEventIdentify( QMouseEvent* /*_event */) {}; /** \brief Mouse Event from Main App ( Light Mode ) * * This slot is called if a mouse event occured in the Viewer * This slot will only get called in LightMode. * Right button clicks will not be passed to the plugins as this is reserved for * the context Menu. * * @param _event Mousevent */ virtual void slotMouseEventLight( QMouseEvent* /* _event */) {};  Jan Möbius committed Jan 14, 2009 123 124 125  public :  Jan Möbius committed Aug 29, 2008 126 127  /// Destructor virtual ~MouseInterface() {};  Jan Möbius committed Jan 14, 2009 128   Jan Möbius committed Aug 29, 2008 129 130 131 }; Q_DECLARE_INTERFACE(MouseInterface,"OpenFlipper.MouseInterface/1.0")  Jan Möbius committed Jan 14, 2009 132   Jan Möbius committed Aug 29, 2008 133 #endif // MOUSEINTERFACE_HH