MouseInterface.hh 5.72 KB
 Jan Möbius committed Aug 05, 2009 1 /*===========================================================================*\ Jan Möbius committed Nov 25, 2010 2 3 * * * OpenFlipper * Jan Möbius committed Jan 26, 2011 4 * Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen * Jan Möbius committed Nov 25, 2010 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 * 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 Jan Möbius committed Jan 14, 2009 44 45 #ifndef MOUSEINTERFACE_HH #define MOUSEINTERFACE_HH Jan Möbius committed Aug 29, 2008 46 47 #include Jan Möbius committed Jan 14, 2009 48 49 50 51 /** \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 52 * all plugins may get these signals. Therefore you hav to check if the current pickingMode Jan Möbius committed Jan 30, 2009 53 54 55 * you want to react on is active before doing anything. Only the slotMouseEventIdentify is * independent of picking modes. * Mike Kremer committed Feb 04, 2009 56 * The slotMouseWheelEvent and slotMouseEvent only get called when the system is in picking Jan Möbius committed Jan 30, 2009 57 58 59 * mode. * * slotMouseEventIdentify will be used when question mode is active. Mike Kremer committed Mar 26, 2009 60 61 62 * * 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 63 */ Jan Möbius committed Aug 29, 2008 64 class MouseInterface { Jan Möbius committed Jan 14, 2009 65 Jan Möbius committed Aug 29, 2008 66 private slots : Jan Möbius committed Jan 14, 2009 67 Jan Möbius committed Aug 29, 2008 68 /** \brief Wheel Event from Main App Jan Möbius committed Jan 14, 2009 69 * Jan Möbius committed Aug 29, 2008 70 71 * 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 72 * the Viewer by using the picking interface. Jan Möbius committed Aug 29, 2008 73 74 75 76 * 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 77 virtual void slotMouseWheelEvent(QWheelEvent * /*_event*/, const std::string & /*_mode*/) {}; Jan Möbius committed Jan 14, 2009 78 Jan Möbius committed Aug 29, 2008 79 /** \brief Mouse Event from Main App ( Picking Mode ) Jan Möbius committed Jan 14, 2009 80 81 82 * * 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 83 * Right button clicks will not be passed to the plugins as this is reserved for Jan Möbius committed Jan 14, 2009 84 85 * the context Menu. * Jan Möbius committed Aug 29, 2008 86 87 * @param _event Mousevent */ Dirk Wilden committed Sep 30, 2008 88 virtual void slotMouseEvent( QMouseEvent* /*_event*/ ) {}; Jan Möbius committed Jan 14, 2009 89 Jan Möbius committed Aug 29, 2008 90 /** \brief Mouse Event from Main App ( Identify Mode ) Jan Möbius committed Jan 14, 2009 91 92 93 * * 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 94 * Right button clicks will not be passed to the plugins as this is reserved for Jan Möbius committed Jan 14, 2009 95 96 * the context Menu. * Jan Möbius committed Aug 29, 2008 97 * @param _event Mousevent Jan Möbius committed Jan 14, 2009 98 */ Jan Möbius committed Jul 09, 2010 99 100 101 102 103 104 105 106 107 108 109 110 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 111 112 113 public : Jan Möbius committed Aug 29, 2008 114 115 /// Destructor virtual ~MouseInterface() {}; Jan Möbius committed Jan 14, 2009 116 Jan Möbius committed Aug 29, 2008 117 118 119 }; Q_DECLARE_INTERFACE(MouseInterface,"OpenFlipper.MouseInterface/1.0") Jan Möbius committed Jan 14, 2009 120 Jan Möbius committed Aug 29, 2008 121 #endif // MOUSEINTERFACE_HH