Marble

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

KDE's Doxygen guidelines are available online.