MouseInterface.hh 3.53 KB
Newer Older
Jan Möbius's avatar
 
Jan Möbius committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//=============================================================================
//
//                               OpenFlipper
//        Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
//                           www.openflipper.org
//
//-----------------------------------------------------------------------------
//
//                                License
//
//  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.
Jan Möbius's avatar
Jan Möbius committed
15
//
Jan Möbius's avatar
 
Jan Möbius committed
16
17
18
19
//  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.
Jan Möbius's avatar
Jan Möbius committed
20
//
Jan Möbius's avatar
 
Jan Möbius committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//  You should have received a copy of the GNU Lesser General Public License
//  along with OpenFlipper.  If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
//   $Revision$
//   $Author$
//   $Date$
//
//=============================================================================




//
// C++ Interface: Basic Interface for mouse events
//
Jan Möbius's avatar
Jan Möbius committed
38
// Description:
Jan Möbius's avatar
 
Jan Möbius committed
39
40
41
42
43
44
//
//
// Author: Jan Moebius <moebius@informatik.rwth-aachen.de>, (C) 2007



Jan Möbius's avatar
Jan Möbius committed
45
46
#ifndef MOUSEINTERFACE_HH
#define MOUSEINTERFACE_HH
Jan Möbius's avatar
 
Jan Möbius committed
47
48

 #include <QtGui>
Jan Möbius's avatar
Jan Möbius committed
49
50
51
52

/** \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's avatar
 
Jan Möbius committed
53
  * all plugins may get these signals. Therefore you hav to check if the current pickingMode
Jan Möbius's avatar
Jan Möbius committed
54
55
56
57
58
59
60
61
  * you want to react on is active before doing anything. Only the slotMouseEventIdentify is
  * independent of picking modes.
  *
  * The slotMouseWheelEvent anf slotMouseEvent Only get called when the system is in picking
  * mode.
  *
  * slotMouseEventIdentify will be used when question mode is active.
  */
Jan Möbius's avatar
 
Jan Möbius committed
62
class MouseInterface {
Jan Möbius's avatar
Jan Möbius committed
63

Jan Möbius's avatar
 
Jan Möbius committed
64
  private slots :
Jan Möbius's avatar
Jan Möbius committed
65

Jan Möbius's avatar
 
Jan Möbius committed
66
    /**  \brief Wheel Event from Main App
Jan Möbius's avatar
Jan Möbius committed
67
      *
Jan Möbius's avatar
 
Jan Möbius committed
68
69
      *  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
70
      *  the Viewer by using the picking interface.
Jan Möbius's avatar
 
Jan Möbius committed
71
72
73
74
      *  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
75
    virtual void slotMouseWheelEvent(QWheelEvent * /*_event*/, const std::string & /*_mode*/) {};
Jan Möbius's avatar
Jan Möbius committed
76

Jan Möbius's avatar
 
Jan Möbius committed
77
    /**  \brief Mouse Event from Main App ( Picking Mode )
Jan Möbius's avatar
Jan Möbius committed
78
79
80
      *
      *  This slot is called if a mouse event occured in the Viewer
      *  This slot will only get called in pickingMode.
Jan Möbius's avatar
 
Jan Möbius committed
81
      *  Right button clicks will not be passed to the plugins as this is reserved for
Jan Möbius's avatar
Jan Möbius committed
82
83
      *  the context Menu.
      *
Jan Möbius's avatar
 
Jan Möbius committed
84
85
      *  @param _event Mousevent
    */
Dirk Wilden's avatar
Dirk Wilden committed
86
    virtual void slotMouseEvent( QMouseEvent* /*_event*/ ) {};
Jan Möbius's avatar
Jan Möbius committed
87

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

  public :

Jan Möbius's avatar
 
Jan Möbius committed
101
102
    /// Destructor
    virtual ~MouseInterface() {};
Jan Möbius's avatar
Jan Möbius committed
103

Jan Möbius's avatar
 
Jan Möbius committed
104
105
106
};

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

Jan Möbius's avatar
 
Jan Möbius committed
108
#endif // MOUSEINTERFACE_HH