DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
fishfarmobject.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 FISHFARMMAPOBJECT_H
22 #define FISHFARMMAPOBJECT_H
23 
24 #include <QObject>
25 
26 #include <mapobjects/mapobject.h>
29 
30 #include <QMapControl/GeometryPointShapeScaled.h>
31 
32 #include <QBrush>
33 
34 namespace qmapcontrol {
35  class RectWorldCoord;
36 }
37 
39 
40 class FishfarmMapObject : public QObject, public MapObject
41 {
42  Q_OBJECT
43 
44  class FishfarmGraphics : public qmapcontrol::GeometryPointShapeScaled {
45  static QBrush *color;
46 
47  FishfarmData *mFishfarm;
48  public:
49  FishfarmGraphics (FishfarmData *fishfarm);
50 
51  void updated();
52  protected:
53  virtual void drawShape(QPainter &painter, const qmapcontrol::RectWorldPx &rect);
54  };
55 
56 public:
57  FishfarmMapObject(MapObjectsController *controller, FishfarmData *fishfarm);
58 
59  std::shared_ptr<qmapcontrol::Geometry> getGeometryEntity() const {
60  return mGeometry;
61  }
62 
63  virtual bool showProperties();
64  virtual void updateProperties();
65 
66  void fishfarmUpdated();
67 
68 private slots:
69  void widgetClosed();
70 
71 private:
72  MapObjectsController *mController;
73 
74  FishfarmData *mFishfarm;
75  std::shared_ptr<FishfarmGraphics> mGeometry;
76 
77  NodeDetailsWidget *mWidget;
78 };
79 
80 #endif // FISHFARMMAPOBJECT_H
void fishfarmUpdated()
Definition: fishfarmobject.cpp:75
FishfarmGraphics(float lat, float lon)
Definition: fishfarmgraphics.cpp:5
virtual bool showProperties()
Definition: fishfarmobject.cpp:45
Definition: nodedetailswidget.h:30
Definition: mapobject.h:30
std::shared_ptr< qmapcontrol::Geometry > getGeometryEntity() const
Definition: fishfarmobject.h:59
Definition: fishfarmdata.h:31
Definition: mapobjectscontroller.h:91
virtual void updateProperties()
Definition: fishfarmobject.cpp:58
FishfarmMapObject(MapObjectsController *controller, FishfarmData *fishfarm)
Definition: fishfarmobject.cpp:35
Definition: fishfarmobject.h:40
Definition: csvspecspage.h:20