Marble

GeoDataGeometry.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2008 Torsten Rahn <rahn@kde.org>
4// SPDX-FileCopyrightText: 2008-2009 Patrick Spendrin <ps_ml@gmx.de>
5// SPDX-FileCopyrightText: 2008 Inge Wallin <inge@lysator.liu.se>
6//
7
8#ifndef MARBLE_GEODATAGEOMETRY_H
9#define MARBLE_GEODATAGEOMETRY_H
10
11#include "GeoDataObject.h"
12#include "MarbleGlobal.h"
13
14#include "geodata_export.h"
15
16namespace Marble
17{
18
19class GeoDataGeometryPrivate;
20
21class GeoDataLatLonAltBox;
22class GeoDataLineString; // LinearRing is the same!
23class GeoDataMultiGeometry;
24
25/**
26 * @short A base class for all geodata features
27 *
28 * GeoDataGeometry is the base class for most geodata classes that
29 * deal with geometric data (points, linestrings, polygons, etc.)
30 *
31 * @see GeoDataLineString
32 * @see GeoDataLinearRing
33 * @see GeoDataPolygon
34 */
35
36class GEODATA_EXPORT GeoDataGeometry : public GeoDataObject
37{
38public:
39 ~GeoDataGeometry() override;
40
41 virtual EnumGeometryId geometryId() const = 0;
42
43 virtual GeoDataGeometry *copy() const = 0;
44
45 bool operator==(const GeoDataGeometry &other) const;
46 inline bool operator!=(const GeoDataGeometry &other) const
47 {
48 return !(*this == other);
49 }
50
51 bool extrude() const;
52 void setExtrude(bool extrude);
53
54 AltitudeMode altitudeMode() const;
55 void setAltitudeMode(const AltitudeMode altitudeMode);
56
57 virtual const GeoDataLatLonAltBox &latLonAltBox() const;
58
59 /// Serialize the contents of the feature to @p stream.
60 void pack(QDataStream &stream) const override;
61 /// Unserialize the contents of the feature from @p stream.
62 void unpack(QDataStream &stream) override;
63
64 void detach();
65
66protected:
67 explicit GeoDataGeometry(GeoDataGeometryPrivate *priv);
68 explicit GeoDataGeometry(const GeoDataGeometry &other);
69 GeoDataGeometry &operator=(const GeoDataGeometry &other);
70
71 bool equals(const GeoDataGeometry &other) const;
72
73 using GeoDataObject::equals;
74
75protected:
76 GeoDataGeometryPrivate *d_ptr;
77};
78
79}
80
81Q_DECLARE_METATYPE(Marble::GeoDataGeometry *)
82
83#endif
A base class for all geodata features.
A class that defines a 3D bounding box for geographic data.
A base class for all geodata objects.
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 Fri Oct 11 2024 12:14:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.