Marble

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

KDE's Doxygen guidelines are available online.