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
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
21namespace Marble
22{
23
24class 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
42class GEODATA_EXPORT GeoDataPoint : public GeoDataGeometry
43{
44 public:
47
48 GeoDataPoint( const GeoDataPoint& other );
49 explicit GeoDataPoint( const GeoDataCoordinates& other );
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
96Q_DECLARE_METATYPE( Marble::GeoDataPoint )
97
98#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 Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.