DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
mousemode.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // DISPLACE: DYNAMIC INDIVIDUAL VESSEL-BASED SPATIAL PLANNING
3 // AND EFFORT DISPLACEMENT
4 // Copyright (c) 2012-2019 Francois Bastardie <fba@aqua.dtu.dk>
5 
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // --------------------------------------------------------------------------
20 
21 /* --------------------------------------------------------------------------
22  * DISPLACE: DYNAMIC INDIVIDUAL VESSEL-BASED SPATIAL PLANNING
23  * AND EFFORT DISPLACEMENT
24  * Copyright (c) 2012, 2013, 2014 Francois Bastardie <fba@aqua.dtu.dk>
25  *
26  * This program is free software; you can redistribute it and/or modify
27  * it under the terms of the GNU General Public License as published by
28  * the Free Software Foundation; either version 2 of the License, or
29  * (at your option) any later version.
30  *
31  * This program is distributed in the hope that it will be useful,
32  * but WITHOUT ANY WARRANTY; without even the implied warranty of
33  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34  * GNU General Public License for more details.
35  *
36  * You should have received a copy of the GNU General Public License along
37  * with this program; if not, write to the Free Software Foundation, Inc.,
38  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
39  * --------------------------------------------------------------------------
40  */
41 #ifndef MOUSEMODE_H
42 #define MOUSEMODE_H
43 
44 #include <QObject>
45 #include <QPointF>
46 #include <QString>
47 
49 public:
50  virtual void showMessage(const QString &) = 0;
51 };
52 
61 class MouseMode : public QObject
62 {
63  Q_OBJECT
64 public:
65  MouseMode();
66  virtual ~MouseMode();
67 
71  virtual bool pressEvent(const QPointF &point);
72 
76  virtual bool releaseEvent(const QPointF &point);
77 
81  virtual bool moveEvent(const QPointF &point);
82 
86  virtual bool beginMode();
87 
91  virtual bool endMode(bool success) = 0;
92 
93  virtual QString getModeDescription() const = 0;
94 
96 
97 protected:
98  void showMessage(QString msg);
99 
100 private:
101  MouseModeInterface *mGui;
102 };
103 
104 #endif // MOUSEMODE_H
virtual QString getModeDescription() const =0
virtual bool moveEvent(const QPointF &point)
signals a mouse move event.
Definition: mousemode.cpp:47
Definition: mousemode.h:48
virtual bool beginMode()
Starts the mouse mode.
Definition: mousemode.cpp:53
virtual bool releaseEvent(const QPointF &point)
signals a mouse release event.
Definition: mousemode.cpp:41
virtual void showMessage(const QString &)=0
The MouseMode class.
Definition: mousemode.h:61
void showMessage(QString msg)
Definition: mousemode.cpp:63
virtual bool pressEvent(const QPointF &point)
signals a mouse press event.
Definition: mousemode.cpp:35
virtual void setMouseModeInterface(MouseModeInterface *)
Definition: mousemode.cpp:58
bg::model::point< double, 2, bg::cs::cartesian > point
Definition: diffusion.cpp:28
virtual ~MouseMode()
Definition: mousemode.cpp:30
virtual bool endMode(bool success)=0
Completes the mouse mode.
MouseMode()
Definition: mousemode.cpp:25