Marble

GeoDataPoint.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 2006-2007 Torsten Rahn <[email protected]>
9 // Copyright 2007 Inge Wallin <[email protected]>
10 // Copyright 2008 Patrick Spendrin <[email protected]>
11 //
12 
13 
14 #ifndef MARBLE_GEODATAPOINT_H
15 #define MARBLE_GEODATAPOINT_H
16 
17 #include <QMetaType>
18 #include <QVector>
19 
20 #include <cmath>
21 
22 #include "geodata_export.h"
23 #include "GeoDataGeometry.h"
24 #include "GeoDataCoordinates.h"
25 
26 namespace Marble
27 {
28 
29 class GeoDataPointPrivate;
30 
31 /**
32  * @short A Geometry object representing a 3d point
33  *
34  * GeoDataPoint is the GeoDataGeometry class representing a single three
35  * dimensional point. It reflects the Point tag of KML spec and can be contained
36  * in objects holding GeoDataGeometry objects.
37  * Nevertheless GeoDataPoint shouldn't be used if you just want to store
38  * 3d coordinates of a point that doesn't need to be inherited from GeoDataGeometry
39  * In that case use GeoDataCoordinates instead which has nearly the same features
40  * and is much more light weight.
41  * Please consider this especially if you expect to have a high
42  * amount of points e.g. for line strings, linear rings and polygons.
43  * @see GeoDataCoordinates
44  * @see GeoDataGeometry
45 */
46 
47 class GEODATA_EXPORT GeoDataPoint : public GeoDataGeometry
48 {
49  public:
52 
53  GeoDataPoint( const GeoDataPoint& other );
54  explicit GeoDataPoint( const GeoDataCoordinates& other );
55  GeoDataPoint();
56 
57  /**
58  * @brief create a geopoint from longitude and latitude
59  * @param lon longitude
60  * @param lat latitude
61  * @param alt altitude (default: 0)
62  * @param _unit units that lon and lat get measured in
63  * (default for Radian: north pole at pi/2, southpole at -pi/2)
64  */
65  GeoDataPoint( qreal lon, qreal lat, qreal alt = 0,
66  GeoDataPoint::Unit _unit = GeoDataCoordinates::Radian );
67 
68  ~GeoDataPoint() override;
69 
70  EnumGeometryId geometryId() const override;
71 
72  GeoDataGeometry *copy() const override;
73 
74  bool operator==( const GeoDataPoint &other ) const;
75  bool operator!=( const GeoDataPoint &other ) const;
76 
77  void setCoordinates( const GeoDataCoordinates &coordinates );
78 
79  const GeoDataCoordinates& coordinates() const;
80 
81  /// Provides type information for downcasting a GeoData
82  const char* nodeType() const override;
83 
84  // Type definitions
86 
87 
88  // Serialize the Placemark to @p stream
89  void pack( QDataStream& stream ) const override;
90  // Unserialize the Placemark from @p stream
91  void unpack( QDataStream& stream ) override;
92 
93  virtual void detach();
94 
95  private:
96  Q_DECLARE_PRIVATE(GeoDataPoint)
97 };
98 
99 }
100 
101 Q_DECLARE_METATYPE( Marble::GeoDataPoint )
102 
103 #endif
Unit
enum used constructor to specify the units used
A Geometry object representing a 3d point.
Definition: GeoDataPoint.h:47
A 3d point representation.
Binds a QML item to a specific geodetic location in screen coordinates.
A base class for all geodata features.
Notation
enum used to specify the notation / numerical system
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jun 21 2021 23:20:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.