Minor changes here and there.
[aesalon.git] / include / artisan / gviewport / Point.h
blob22cd139ac7e6a3c0130d8d627adaf7794abd1d83
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file include/artisan/gviewport/Point.h
8 */
10 #ifndef AesalonArtisan_GViewport_Point_H
11 #define AesalonArtisan_GViewport_Point_H
13 #include <QPoint>
15 namespace Artisan {
16 namespace GViewport {
18 class Point {
19 private:
20 double m_x, m_y;
21 public:
22 Point();
23 Point(double x, double y) : m_x(x), m_y(y) {}
24 Point(const QPoint &point) : m_x(point.x()), m_y(point.y()) {}
26 double &x() { return m_x; }
27 double x() const { return m_x; }
28 double &y() { return m_y; }
29 double y() const { return m_y; }
31 Point operator+(const Point &other) const {
32 return Point(m_x + other.m_x, m_y + other.m_y);
35 QPointF toQPoint() const {
36 return QPointF(m_x, m_y);
40 } // namespace GViewport
41 } // namespace Artisan
43 #endif