map2d_widget
homeitem.h
Go to the documentation of this file.
1 
12 /*
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 */
27 #ifndef HOMEITEM_H
28 #define HOMEITEM_H
29 
30 #include <QGraphicsItem>
31 #include <QPainter>
32 #include <QLabel>
33 #include "../internals/pointlatlng.h"
34 #include <QObject>
35 #include "opmapwidget.h"
36 namespace mapcontrol
37 {
38 
39  class HomeItem:public QObject,public QGraphicsItem
40  {
41  Q_OBJECT
42  Q_INTERFACES(QGraphicsItem)
43  public:
44  enum { Type = UserType + 4 };
45  HomeItem(MapGraphicItem* map,OPMapWidget* parent);
46  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
47  QWidget *widget);
48  QRectF boundingRect() const;
49  int type() const;
50  void RefreshPos();
51  bool ShowSafeArea()const{return showsafearea;}
52  void SetShowSafeArea(bool const& value){showsafearea=value;}
53  int SafeArea()const{return safearea;}
54  void SetSafeArea(int const& value){safearea=value;}
55  bool safe;
56  void SetCoord(internals::PointLatLng const& value){coord=value;}
57  internals::PointLatLng Coord()const{return coord;}
58  void SetAltitude(int const& value){altitude=value;}
59  int Altitude()const{return altitude;}
60  private:
61  MapGraphicItem* map;
62  OPMapWidget* mapwidget;
63  QPixmap pic;
64  core::Point localposition;
66  bool showsafearea;
67  int safearea;
68  int localsafearea;
69  int altitude;
70 
71  public slots:
72 
73  signals:
74 
75  };
76 }
77 #endif // HOMEITEM_H
Definition: opmapwidget.h:150
int type() const
Definition: homeitem.cpp:66
void SetCoord(internals::PointLatLng const &value)
Definition: homeitem.h:56
HomeItem(MapGraphicItem *map, OPMapWidget *parent)
Definition: homeitem.cpp:30
Definition: pointlatlng.h:35
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition: homeitem.cpp:41
The Map Widget, this is the part exposed to the user.
int Altitude() const
Definition: homeitem.h:59
void SetShowSafeArea(bool const &value)
Definition: homeitem.h:52
Definition: point.h:35
Definition: homeitem.h:39
void RefreshPos()
Definition: homeitem.cpp:70
bool ShowSafeArea() const
Definition: homeitem.h:51
void SetSafeArea(int const &value)
Definition: homeitem.h:54
QRectF boundingRect() const
Definition: homeitem.cpp:57
void SetAltitude(int const &value)
Definition: homeitem.h:58
int SafeArea() const
Definition: homeitem.h:53
Definition: homeitem.h:44
internals::PointLatLng Coord() const
Definition: homeitem.h:57
bool safe
Definition: homeitem.h:55
The main graphicsItem used on the widget, contains the map and map logic.
Definition: mapgraphicitem.h:51