Marble

GeoDataScreenOverlay.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2012 Mohammed Nafees <nafees.technocool@gmail.com>
4//
5
6#include "GeoDataScreenOverlay.h"
7#include "GeoDataScreenOverlay_p.h"
8#include "GeoDataTypes.h"
9
10namespace Marble
11{
12
13GeoDataScreenOverlay::GeoDataScreenOverlay()
14 : GeoDataOverlay(new GeoDataScreenOverlayPrivate)
15{
16}
17
18GeoDataScreenOverlay::GeoDataScreenOverlay(const Marble::GeoDataScreenOverlay &other)
19 : GeoDataOverlay(other, new GeoDataScreenOverlayPrivate(*other.d_func()))
20{
21}
22
23GeoDataScreenOverlay::~GeoDataScreenOverlay() = default;
24
25GeoDataScreenOverlay &GeoDataScreenOverlay::operator=(const GeoDataScreenOverlay &other)
26{
27 if (this != &other) {
28 Q_D(GeoDataScreenOverlay);
29 *d = *other.d_func();
30 }
31
32 return *this;
33}
34
35bool GeoDataScreenOverlay::operator==(const GeoDataScreenOverlay &other) const
36{
37 Q_D(const GeoDataScreenOverlay);
38 const GeoDataScreenOverlayPrivate *const other_d = other.d_func();
39
40 return equals(other) && d->m_overlayXY == other_d->m_overlayXY && d->m_screenXY == other_d->m_screenXY && d->m_rotationXY == other_d->m_rotationXY
41 && d->m_size == other_d->m_size && d->m_rotation == other_d->m_rotation;
42}
43
44bool GeoDataScreenOverlay::operator!=(const GeoDataScreenOverlay &other) const
45{
46 return !this->operator==(other);
47}
48
49GeoDataFeature *GeoDataScreenOverlay::clone() const
50{
51 return new GeoDataScreenOverlay(*this);
52}
53
54const char *GeoDataScreenOverlay::nodeType() const
55{
56 return GeoDataTypes::GeoDataScreenOverlayType;
57}
58
59GeoDataVec2 GeoDataScreenOverlay::overlayXY() const
60{
61 Q_D(const GeoDataScreenOverlay);
62 return d->m_overlayXY;
63}
64
65void GeoDataScreenOverlay::setOverlayXY(const GeoDataVec2 &vec2)
66{
67 Q_D(GeoDataScreenOverlay);
68 d->m_overlayXY = vec2;
69}
70
71void GeoDataScreenOverlay::setOverlayXY(qreal x, qreal y, GeoDataVec2::Unit xunit, GeoDataVec2::Unit yunit)
72{
73 Q_D(GeoDataScreenOverlay);
74 d->m_screenXY.setX(x);
75 d->m_screenXY.setY(y);
76 d->m_screenXY.setXunits(xunit);
77 d->m_screenXY.setYunits(yunit);
78}
79
80GeoDataVec2 GeoDataScreenOverlay::screenXY() const
81{
82 Q_D(const GeoDataScreenOverlay);
83 return d->m_screenXY;
84}
85
86void GeoDataScreenOverlay::setScreenXY(const GeoDataVec2 &vec2)
87{
88 Q_D(GeoDataScreenOverlay);
89 d->m_screenXY = vec2;
90}
91
92void GeoDataScreenOverlay::setScreenXY(qreal x, qreal y, GeoDataVec2::Unit xunit, GeoDataVec2::Unit yunit)
93{
94 Q_D(GeoDataScreenOverlay);
95 d->m_screenXY.setX(x);
96 d->m_screenXY.setY(y);
97 d->m_screenXY.setXunits(xunit);
98 d->m_screenXY.setYunits(yunit);
99}
100
101GeoDataVec2 GeoDataScreenOverlay::rotationXY() const
102{
103 Q_D(const GeoDataScreenOverlay);
104 return d->m_rotationXY;
105}
106
107void GeoDataScreenOverlay::setRotationXY(const GeoDataVec2 &vec2)
108{
109 Q_D(GeoDataScreenOverlay);
110 d->m_rotationXY = vec2;
111}
112
113void GeoDataScreenOverlay::setRotationXY(qreal x, qreal y, GeoDataVec2::Unit xunit, GeoDataVec2::Unit yunit)
114{
115 Q_D(GeoDataScreenOverlay);
116 d->m_rotationXY.setX(x);
117 d->m_rotationXY.setY(y);
118 d->m_rotationXY.setXunits(xunit);
119 d->m_rotationXY.setYunits(yunit);
120}
121
122GeoDataVec2 GeoDataScreenOverlay::size() const
123{
124 Q_D(const GeoDataScreenOverlay);
125 return d->m_size;
126}
127
128void GeoDataScreenOverlay::setSize(const GeoDataVec2 &vec2)
129{
130 Q_D(GeoDataScreenOverlay);
131 d->m_size = vec2;
132}
133
134void GeoDataScreenOverlay::setSize(qreal x, qreal y, GeoDataVec2::Unit xunit, GeoDataVec2::Unit yunit)
135{
136 Q_D(GeoDataScreenOverlay);
137 d->m_size.setX(x);
138 d->m_size.setY(y);
139 d->m_size.setXunits(xunit);
140 d->m_size.setYunits(yunit);
141}
142
143qreal GeoDataScreenOverlay::rotation() const
144{
145 Q_D(const GeoDataScreenOverlay);
146 return d->m_rotation;
147}
148
149void GeoDataScreenOverlay::setRotation(qreal rotation)
150{
151 Q_D(GeoDataScreenOverlay);
152 d->m_rotation = rotation;
153}
154
155}
bool equals(const QVariant &lhs, const QVariant &rhs)
bool operator==(const StyleDelim &l, const StyleDelim &r)
Binds a QML item to a specific geodetic location in screen coordinates.
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.