MouseInterface.hh 3.32 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
54
  * all plugins may get these signals. Therefore you hav to check if the current pickingMode
  * is active before doing anything. Only the slotMouseEventIdentify is independent of picking modes.
Jan Möbius's avatar
Jan Möbius committed
55
 */
Jan Möbius's avatar
 
Jan Möbius committed
56
class MouseInterface {
Jan Möbius's avatar
Jan Möbius committed
57

Jan Möbius's avatar
 
Jan Möbius committed
58
  private slots :
Jan Möbius's avatar
Jan Möbius committed
59

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

Jan Möbius's avatar
 
Jan Möbius committed
71
    /**  \brief Mouse Event from Main App ( Picking Mode )
Jan Möbius's avatar
Jan Möbius committed
72
73
74
      *
      *  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
75
      *  Right button clicks will not be passed to the plugins as this is reserved for
Jan Möbius's avatar
Jan Möbius committed
76
77
      *  the context Menu.
      *
Jan Möbius's avatar
 
Jan Möbius committed
78
79
      *  @param _event Mousevent
    */
Dirk Wilden's avatar
Dirk Wilden committed
80
    virtual void slotMouseEvent( QMouseEvent* /*_event*/ ) {};
Jan Möbius's avatar
Jan Möbius committed
81

Jan Möbius's avatar
 
Jan Möbius committed
82
    /**  \brief Mouse Event from Main App ( Identify Mode )
Jan Möbius's avatar
Jan Möbius committed
83
84
85
      *
      *  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
86
      *  Right button clicks will not be passed to the plugins as this is reserved for
Jan Möbius's avatar
Jan Möbius committed
87
88
      *  the context Menu.
      *
Jan Möbius's avatar
 
Jan Möbius committed
89
      *  @param _event Mousevent
Jan Möbius's avatar
Jan Möbius committed
90
    */
Jan Möbius's avatar
 
Jan Möbius committed
91
    virtual void slotMouseEventIdentify() {};
Jan Möbius's avatar
Jan Möbius committed
92
93
94

  public :

Jan Möbius's avatar
 
Jan Möbius committed
95
96
    /// Destructor
    virtual ~MouseInterface() {};
Jan Möbius's avatar
Jan Möbius committed
97

Jan Möbius's avatar
 
Jan Möbius committed
98
99
100
};

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

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