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

KDE's Doxygen guidelines are available online.