dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
mapcircle.h
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 #ifndef MAPCIRCLE_H
28 #define MAPCIRCLE_H
29 
30 #include "mappointitem.h"
31 #include "../core/corecommon.h"
32 
33 namespace mapcontrol
34 {
35 
36 class HomeItem;
37 
38 class TLMAPWIDGET_EXPORT MapCircle: public QObject, public QGraphicsEllipseItem
39 {
40  Q_OBJECT
41  Q_INTERFACES(QGraphicsItem)
42 public:
43  enum { Type = UserType + 9 };
44  MapCircle(MapPointItem *center, MapPointItem *radius, bool clockwise, MapGraphicItem *map, QColor color=Qt::green);
45  MapCircle(HomeItem *center, MapPointItem *radius, bool clockwise, MapGraphicItem *map, QColor color=Qt::green);
46  int type() const;
47  void setColor(const QColor &color)
48  { myColor = color; }
49 private:
50  QGraphicsItem *my_center;
51  QGraphicsItem *my_radius;
52  MapGraphicItem *my_map;
53  QPolygonF arrowHead;
54  QColor myColor;
55  bool myClockWise;
56  QLineF line;
57 protected:
58  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
59 public slots:
60  void refreshLocations();
61  void pointdeleted();
62  void setOpacitySlot(qreal opacity);
63 };
64 }
65 
66 #endif // MAPCIRCLE_H
A graphicsItem representing a MapPointItem.
The main graphicsItem used on the widget, contains the map and map logic.
A QGraphicsItem representing a MapPointItem.
Definition: mappointitem.h:56