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
9#ifndef MARBLE_GEODATAGEOMETRY_H
10#define MARBLE_GEODATAGEOMETRY_H
11
12
13#include "GeoDataObject.h"
14#include "MarbleGlobal.h"
15
16#include "geodata_export.h"
17
18namespace Marble
19{
20
21class GeoDataGeometryPrivate;
22
23class GeoDataLatLonAltBox;
24class GeoDataLineString; // LinearRing is the same!
25class GeoDataMultiGeometry;
26
27/**
28 * @short A base class for all geodata features
29 *
30 * GeoDataGeometry is the base class for most geodata classes that
31 * deal with geometric data (points, linestrings, polygons, etc.)
32 *
33 * @see GeoDataLineString
34 * @see GeoDataLinearRing
35 * @see GeoDataPolygon
36 */
37
38class GEODATA_EXPORT GeoDataGeometry : public GeoDataObject
39{
40 public:
41 ~GeoDataGeometry() override;
42
43 virtual EnumGeometryId geometryId() const = 0;
44
45 virtual GeoDataGeometry *copy() const = 0;
46
47 bool operator==(const GeoDataGeometry &other) const;
48 inline bool operator!=(const GeoDataGeometry &other) const { return !(*this == other); }
49
50 bool extrude() const;
51 void setExtrude( bool extrude );
52
53 AltitudeMode altitudeMode() const;
54 void setAltitudeMode( const AltitudeMode altitudeMode );
55
56 virtual const GeoDataLatLonAltBox& latLonAltBox() const;
57
58 /// Serialize the contents of the feature to @p stream.
59 void pack( QDataStream& stream ) const override;
60 /// Unserialize the contents of the feature from @p stream.
61 void unpack( QDataStream& stream ) override;
62
63 void detach();
64
65 protected:
66 explicit GeoDataGeometry( GeoDataGeometryPrivate* priv );
67 explicit GeoDataGeometry(const GeoDataGeometry &other);
68 GeoDataGeometry& operator=(const GeoDataGeometry &other);
69
70 bool equals(const GeoDataGeometry &other) const;
71
72 using GeoDataObject::equals;
73
74 protected:
75 GeoDataGeometryPrivate *d_ptr;
76};
77
78}
79
80Q_DECLARE_METATYPE( Marble::GeoDataGeometry* )
81
82#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 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.