QMapControl  0.9.7.4
arrowpoint.h
1 /*
2 *
3 * This file is part of QMapControl,
4 * an open-source cross-platform map widget
5 *
6 * Copyright (C) 2010 Jeffery MacEachern
7 * Based on CirclePoint code by Kai Winter
8 *
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * Contact e-mail: kaiwinter@gmx.de
23 * Program URL : http://qmapcontrol.sourceforge.net/
24 *
25 */
26 
27 #ifndef ARROWPOINT_H
28 #define ARROWPOINT_H
29 
30 #include <QBrush>
31 
32 #include "qmapcontrol_global.h"
33 #include "math.h"
34 #include "point.h"
35 
36 namespace qmapcontrol
37 {
39 
45  class QMAPCONTROL_EXPORT ArrowPoint : public Point
46  {
47  public:
49 
59  ArrowPoint(qreal x, qreal y, int sideLength, qreal heading, QString name = QString(), Alignment alignment = Middle, QPen* pen=0);
60  virtual ~ArrowPoint();
61 
63 
68  virtual void setPen(QPen* pen);
69 
71 
74  void setHeading(qreal heading);
75 
77  qreal getHeading() const;
78  private:
79  void drawArrow();
80 
81  // Heading
82  qreal h;
83 
84  // Brush to fill the arrow with - solid colour, same as pen
85  QBrush mybrush;
86  };
87 }
88 #endif
Alignment
sets where the point should be aligned
Definition: point.h:75
A geometric point to draw objects into maps.
Definition: point.h:66
Draws a directed arrow (showing orientation) into the map.
Definition: arrowpoint.h:45
QMapControl namespace.
Definition: arrowpoint.cpp:28