MouseInterface.hh 5.87 KB
Newer Older
1
/*===========================================================================*\
Jan Möbius's avatar
Jan Möbius committed
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 <http://www.gnu.org/licenses/>.                                       *
*                                                                            *
33 34 35
\*===========================================================================*/

/*===========================================================================*\
Jan Möbius's avatar
Jan Möbius committed
36 37 38 39 40
*                                                                            *
*   $Revision$                                                       *
*   $LastChangedBy$                                                *
*   $Date$                     *
*                                                                            *
41
\*===========================================================================*/
42 43 44 45 46 47 48




//
// C++ Interface: Basic Interface for mouse events
//
Jan Möbius's avatar
Jan Möbius committed
49
// Description:
50 51 52 53 54 55
//
//
// Author: Jan Moebius <moebius@informatik.rwth-aachen.de>, (C) 2007



Jan Möbius's avatar
Jan Möbius committed
56 57
#ifndef MOUSEINTERFACE_HH
#define MOUSEINTERFACE_HH
58 59

 #include <QtGui>
Jan Möbius's avatar
Jan Möbius committed
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
64
  * all plugins may get these signals. Therefore you hav to check if the current pickingMode
65 66 67
  * you want to react on is active before doing anything. Only the slotMouseEventIdentify is
  * independent of picking modes.
  *
68
  * The slotMouseWheelEvent and slotMouseEvent only get called when the system is in picking
69 70 71
  * mode.
  *
  * slotMouseEventIdentify will be used when question mode is active.
72 73 74
  *
  * See our tutorial \ref ex3 for an example of how to use mouse and keyboard events
  * within a plugin.
75
  */
76
class MouseInterface {
Jan Möbius's avatar
Jan Möbius committed
77

78
  private slots :
Jan Möbius's avatar
Jan Möbius committed
79

80
    /**  \brief Wheel Event from Main App
Jan Möbius's avatar
Jan Möbius committed
81
      *
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's avatar
Jan Möbius committed
84
      *  the Viewer by using the picking interface.
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's avatar
Dirk Wilden committed
89
    virtual void slotMouseWheelEvent(QWheelEvent * /*_event*/, const std::string & /*_mode*/) {};
Jan Möbius's avatar
Jan Möbius committed
90

91
    /**  \brief Mouse Event from Main App ( Picking Mode )
Jan Möbius's avatar
Jan Möbius committed
92 93 94
      *
      *  This slot is called if a mouse event occured in the Viewer
      *  This slot will only get called in pickingMode.
95
      *  Right button clicks will not be passed to the plugins as this is reserved for
Jan Möbius's avatar
Jan Möbius committed
96 97
      *  the context Menu.
      *
98 99
      *  @param _event Mousevent
    */
Dirk Wilden's avatar
Dirk Wilden committed
100
    virtual void slotMouseEvent( QMouseEvent* /*_event*/ ) {};
Jan Möbius's avatar
Jan Möbius committed
101

102
    /**  \brief Mouse Event from Main App ( Identify Mode )
Jan Möbius's avatar
Jan Möbius committed
103 104 105
      *
      *  This slot is called if a mouse event occured in the Viewer
      *  This slot will only get called in identifyMode.
106
      *  Right button clicks will not be passed to the plugins as this is reserved for
Jan Möbius's avatar
Jan Möbius committed
107 108
      *  the context Menu.
      *
109
      *  @param _event Mousevent
Jan Möbius's avatar
Jan Möbius committed
110
    */
Jan Möbius's avatar
Jan Möbius committed
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's avatar
Jan Möbius committed
123 124 125

  public :

126 127
    /// Destructor
    virtual ~MouseInterface() {};
Jan Möbius's avatar
Jan Möbius committed
128

129 130 131
};

Q_DECLARE_INTERFACE(MouseInterface,"OpenFlipper.MouseInterface/1.0")
Jan Möbius's avatar
Jan Möbius committed
132

133
#endif // MOUSEINTERFACE_HH