DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
edgelayer.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 EDGELAYER_H
22 #define EDGELAYER_H
23 
24 #include <QObject>
25 
26 #include <QMapControl/LayerGeometry.h>
27 #include <mapobjectscontroller.h>
28 
29 class EdgeMapObject;
30 
31 class EdgeLayer : public QObject
32 {
33  Q_OBJECT
34 public:
35  explicit EdgeLayer(MapObjectsController *controller, const QString &name, QObject *parent = 0);
36 
37  void setVisible(bool vi) { mLayer->setVisible(vi); }
38  void addEdge (EdgeMapObject *edge, bool disable_redraw = false);
40  void clear();
41 
42  std::shared_ptr<qmapcontrol::LayerGeometry> layer() const { return mLayer; }
43 
44  const QList<EdgeMapObject *>selection() const { return mSelection; }
45 
46 private:
47  MapObjectsController *mController;
48  std::shared_ptr<qmapcontrol::LayerGeometry> mLayer;
49 
50  QList<EdgeMapObject *> mSelection;
51 };
52 
53 #endif // EDGELAYER_H
void addEdge(EdgeMapObject *edge, bool disable_redraw=false)
Definition: edgelayer.cpp:33
void clear()
Definition: edgelayer.cpp:43
void removeEdge(EdgeMapObject *edge)
Definition: edgelayer.cpp:38
Definition: myutils.h:206
EdgeLayer(MapObjectsController *controller, const QString &name, QObject *parent=0)
Definition: edgelayer.cpp:26
void setVisible(bool vi)
Definition: edgelayer.h:37
const QList< EdgeMapObject * > selection() const
Definition: edgelayer.h:44
Definition: edgelayer.h:31
Definition: mapobjectscontroller.h:91
std::shared_ptr< qmapcontrol::LayerGeometry > layer() const
Definition: edgelayer.h:42
Definition: edgemapobject.h:56