Marble

GeoDataLatLonBox.h
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2007 Andrew Manson <[email protected]>
9 // Copyright 2008-2009 Torsten Rahn <[email protected]>
10 //
11 
12 
13 #ifndef MARBLE_GEODATALATLONBOX_H
14 #define MARBLE_GEODATALATLONBOX_H
15 
16 
17 #include "MarbleGlobal.h"
18 
19 #include "GeoDataObject.h"
20 #include "GeoDataCoordinates.h"
21 
22 #include "geodata_export.h"
23 
24 namespace Marble
25 {
26 
27 class GeoDataLatLonBoxPrivate;
28 
29 class GeoDataLineString;
30 
51 class GEODATA_EXPORT GeoDataLatLonBox : public GeoDataObject
52 {
53  friend bool GEODATA_EXPORT operator==( GeoDataLatLonBox const& lhs, GeoDataLatLonBox const& rhs );
54  friend bool GEODATA_EXPORT operator!=( GeoDataLatLonBox const& lhs, GeoDataLatLonBox const& rhs );
55 
56  public:
58  GeoDataLatLonBox( qreal north, qreal south, qreal east, qreal west, GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
60  ~GeoDataLatLonBox() override;
61 
62  GeoDataLatLonBox& operator=( const GeoDataLatLonBox& other );
63 
65  const char* nodeType() const override;
66 
71  qreal north( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian ) const;
72  void setNorth( const qreal north, GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
73 
78  qreal south( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian ) const;
79  void setSouth( const qreal south, GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
80 
85  qreal east( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian ) const;
86  void setEast( const qreal east, GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
87 
92  qreal west( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian ) const;
93  void setWest( const qreal west, GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
94 
99  qreal rotation( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian ) const;
100  void setRotation( const qreal rotation, GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
101 
102  void boundaries( qreal &north, qreal &south, qreal &east, qreal &west, GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian ) const;
103  void setBoundaries( qreal north, qreal south, qreal east, qreal west, GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
104 
110  void scale(qreal verticalFactor, qreal horizontalFactor) const;
111  GeoDataLatLonBox scaled(qreal verticalFactor, qreal horizontalFactor) const;
112 
117  qreal width( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian ) const;
118 
123  static qreal width( qreal east, qreal west, GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
124 
129  qreal height( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian ) const;
130 
135  static qreal height( qreal north, qreal south, GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
136 
142  bool crossesDateLine() const;
143 
151  static bool crossesDateLine(qreal east, qreal west);
152 
157  virtual GeoDataCoordinates center() const;
158 
164  bool containsPole( Pole pole = AnyPole ) const;
165 
166  virtual bool contains( const GeoDataCoordinates & ) const;
167  bool contains( const GeoDataLatLonBox & ) const;
168 
175  bool contains(qreal lon, qreal lat) const; //Optimized version for overlay painting
176 
177  virtual bool intersects( const GeoDataLatLonBox & ) const;
178 
182  GeoDataLatLonBox united( const GeoDataLatLonBox& other) const;
183 
187  GeoDataLatLonBox toCircumscribedRectangle() const;
188 
193  static GeoDataLatLonBox fromLineString( const GeoDataLineString& lineString );
194 
199  virtual bool isNull() const;
200 
205  virtual bool isEmpty() const;
206 
213  static bool fuzzyCompare(const GeoDataLatLonBox& lhs,
214  const GeoDataLatLonBox& rhs,
215  const qreal factor = 0.01);
216 
220  virtual void clear();
221 
222  GeoDataLatLonBox operator|( const GeoDataLatLonBox& other ) const;
223 
228  GeoDataLatLonBox& operator |=( const GeoDataLatLonBox& other) ;
229 
231  void pack( QDataStream& stream ) const override;
233  void unpack( QDataStream& stream ) override;
234 
235  private:
236  GeoDataLatLonBoxPrivate * const d;
237  static const GeoDataLatLonBox empty;
238 };
239 
240 }
241 
242 Q_DECLARE_METATYPE( Marble::GeoDataLatLonBox )
243 
244 #endif
Unit
enum used constructor to specify the units used
Any pole.
Definition: MarbleGlobal.h:144
A 3d point representation.
Binds a QML item to a specific geodetic location in screen coordinates.
A base class for all geodata objects.
Definition: GeoDataObject.h:48
A LineString that allows to store a contiguous set of line segments.
A class that defines a 2D bounding box for geographic data.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 8 2020 23:18:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.