DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
edgeaddmousemode.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, 2013, 2014 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 #ifndef EDGEADDMOUSEMODE_H
22 #define EDGEADDMOUSEMODE_H
23 
24 #include "mousemode.h"
25 #include <QObject>
26 
27 class DisplaceModel;
28 
30 {
31  Q_OBJECT
32 public:
33  explicit EdgeAddMouseMode(DisplaceModel *model);
34 
35  bool releaseEvent(const QPointF &point);
36 
37  bool beginMode();
38  bool endMode(bool success);
39 
40  QString getModeDescription() const;
41 signals:
42  void edgeAdded (int from_idx, int to_idx);
43 
44 private:
45  DisplaceModel *mModel;
46  int mStatus;
47  int mNodeFrom, mNodeTo;
48 };
49 
50 #endif // EDGEADDMOUSEMODE_H
bool endMode(bool success)
Completes the mouse mode.
Definition: edgeaddmousemode.cpp:63
EdgeAddMouseMode(DisplaceModel *model)
Definition: edgeaddmousemode.cpp:25
QString getModeDescription() const
Definition: edgeaddmousemode.cpp:69
Definition: edgeaddmousemode.h:29
The MouseMode class.
Definition: mousemode.h:61
Definition: displacemodel.h:71
bg::model::point< double, 2, bg::cs::cartesian > point
Definition: diffusion.cpp:28
void edgeAdded(int from_idx, int to_idx)
Definition: moc_edgeaddmousemode.cpp:126
bool beginMode()
Starts the mouse mode.
Definition: edgeaddmousemode.cpp:57
bool releaseEvent(const QPointF &point)
signals a mouse release event.
Definition: edgeaddmousemode.cpp:32