Marble

GeoDataLatLonQuad.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
4//
5
6#include "GeoDataLatLonQuad.h"
7#include "GeoDataTypes.h"
8
9namespace Marble
10{
11
12class GeoDataLatLonQuadPrivate
13{
14public:
15 GeoDataCoordinates m_bottomLeft;
16 GeoDataCoordinates m_bottomRight;
17 GeoDataCoordinates m_topRight;
18 GeoDataCoordinates m_topLeft;
19
20 GeoDataLatLonQuadPrivate();
21};
22
23GeoDataLatLonQuadPrivate::GeoDataLatLonQuadPrivate()
24 : m_bottomLeft()
25 , m_bottomRight()
26 , m_topRight()
27 , m_topLeft()
28{
29 // nothing to do
30}
31
32GeoDataLatLonQuad::GeoDataLatLonQuad()
33 : GeoDataObject()
34 , d(new GeoDataLatLonQuadPrivate)
35{
36 // nothing to do
37}
38
39GeoDataLatLonQuad::GeoDataLatLonQuad(const Marble::GeoDataLatLonQuad &other)
40 : GeoDataObject(other)
41 , d(new GeoDataLatLonQuadPrivate(*other.d))
42{
43 // nothing to do
44}
45
46GeoDataLatLonQuad &GeoDataLatLonQuad::operator=(const GeoDataLatLonQuad &other)
47{
48 *d = *other.d;
49 return *this;
50}
51
52bool GeoDataLatLonQuad::operator==(const GeoDataLatLonQuad &other) const
53{
54 return equals(other) && d->m_bottomLeft == other.d->m_bottomLeft && d->m_bottomRight == other.d->m_bottomRight && d->m_topLeft == other.d->m_topLeft
55 && d->m_topRight == other.d->m_topRight;
56}
57
58bool GeoDataLatLonQuad::operator!=(const GeoDataLatLonQuad &other) const
59{
60 return !this->operator==(other);
61}
62
63GeoDataLatLonQuad::~GeoDataLatLonQuad()
64{
65 delete d;
66}
67
68const char *GeoDataLatLonQuad::nodeType() const
69{
70 return GeoDataTypes::GeoDataLatLonQuadType;
71}
72
73qreal GeoDataLatLonQuad::bottomLeftLatitude(GeoDataCoordinates::Unit unit) const
74{
75 return d->m_bottomLeft.latitude(unit);
76}
77
78void GeoDataLatLonQuad::setBottomLeftLatitude(qreal latitude, GeoDataCoordinates::Unit unit)
79{
80 d->m_bottomLeft.setLatitude(latitude, unit);
81}
82
83qreal GeoDataLatLonQuad::bottomLeftLongitude(GeoDataCoordinates::Unit unit) const
84{
85 return d->m_bottomLeft.longitude(unit);
86}
87
88void GeoDataLatLonQuad::setBottomLeftLongitude(qreal longitude, GeoDataCoordinates::Unit unit)
89{
90 d->m_bottomLeft.setLongitude(longitude, unit);
91}
92
93qreal GeoDataLatLonQuad::bottomRightLatitude(GeoDataCoordinates::Unit unit) const
94{
95 return d->m_bottomRight.latitude(unit);
96}
97
98void GeoDataLatLonQuad::setBottomRightLatitude(qreal latitude, GeoDataCoordinates::Unit unit)
99{
100 d->m_bottomRight.setLatitude(latitude, unit);
101}
102
103qreal GeoDataLatLonQuad::bottomRightLongitude(GeoDataCoordinates::Unit unit) const
104{
105 return d->m_bottomRight.longitude(unit);
106}
107
108void GeoDataLatLonQuad::setBottomRightLongitude(qreal longitude, GeoDataCoordinates::Unit unit)
109{
110 d->m_bottomRight.setLongitude(longitude, unit);
111}
112
113qreal GeoDataLatLonQuad::topRightLatitude(GeoDataCoordinates::Unit unit) const
114{
115 return d->m_topRight.latitude(unit);
116}
117
118void GeoDataLatLonQuad::setTopRightLatitude(qreal latitude, GeoDataCoordinates::Unit unit)
119{
120 d->m_topRight.setLatitude(latitude, unit);
121}
122
123qreal GeoDataLatLonQuad::topRightLongitude(GeoDataCoordinates::Unit unit) const
124{
125 return d->m_topRight.longitude(unit);
126}
127
128void GeoDataLatLonQuad::setTopRightLongitude(qreal longitude, GeoDataCoordinates::Unit unit)
129{
130 d->m_topRight.setLongitude(longitude, unit);
131}
132
133qreal GeoDataLatLonQuad::topLeftLatitude(GeoDataCoordinates::Unit unit) const
134{
135 return d->m_topLeft.latitude(unit);
136}
137
138void GeoDataLatLonQuad::setTopLeftLatitude(qreal latitude, GeoDataCoordinates::Unit unit)
139{
140 d->m_topLeft.setLatitude(latitude, unit);
141}
142
143qreal GeoDataLatLonQuad::topLeftLongitude(GeoDataCoordinates::Unit unit) const
144{
145 return d->m_topLeft.longitude(unit);
146}
147
148void GeoDataLatLonQuad::setTopLeftLongitude(qreal longitude, GeoDataCoordinates::Unit unit)
149{
150 d->m_topLeft.setLongitude(longitude, unit);
151}
152
153GeoDataCoordinates &GeoDataLatLonQuad::bottomLeft() const
154{
155 return d->m_bottomLeft;
156}
157
158void GeoDataLatLonQuad::setBottomLeft(const GeoDataCoordinates &coordinates)
159{
160 d->m_bottomLeft = coordinates;
161}
162GeoDataCoordinates &GeoDataLatLonQuad::bottomRight() const
163{
164 return d->m_bottomRight;
165}
166
167void GeoDataLatLonQuad::setBottomRight(const GeoDataCoordinates &coordinates)
168{
169 d->m_bottomRight = coordinates;
170}
171
172GeoDataCoordinates &GeoDataLatLonQuad::topRight() const
173{
174 return d->m_topRight;
175}
176
177void GeoDataLatLonQuad::setTopRight(const GeoDataCoordinates &coordinates)
178{
179 d->m_topRight = coordinates;
180}
181
182GeoDataCoordinates &GeoDataLatLonQuad::topLeft() const
183{
184 return d->m_topLeft;
185}
186
187void GeoDataLatLonQuad::setTopLeft(const GeoDataCoordinates &coordinates)
188{
189 d->m_topLeft = coordinates;
190}
191
192bool GeoDataLatLonQuad::isValid() const
193{
194 return d->m_bottomLeft.isValid() && d->m_bottomRight.isValid() && d->m_topLeft.isValid() && d->m_topRight.isValid();
195}
196
197}
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.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.