Marble

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

KDE's Doxygen guidelines are available online.