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

KDE's Doxygen guidelines are available online.