Marble

GeoDataMultiGeometry.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2008 Patrick Spendrin <ps_ml@gmx.de>
4//
5
6#ifndef MARBLE_GEODATAMULTIGEOMETRY_H
7#define MARBLE_GEODATAMULTIGEOMETRY_H
8
9#include "geodata_export.h"
10
11#include "GeoDataGeometry.h"
12#include <QList>
13
14namespace Marble
15{
16
17class GeoDataMultiGeometryPrivate;
18
19/**
20 * @short A class that can contain other GeoDataGeometry objects
21 *
22 * GeoDataMultiGeometry is a collection of other GeoDataGeometry objects.
23 * As one can add GeoDataMultiGeometry to itself, you can make up a collection
24 * of different objects to form one Placemark.
25 */
26class GEODATA_EXPORT GeoDataMultiGeometry : public GeoDataGeometry
27{
28public:
30 explicit GeoDataMultiGeometry(const GeoDataGeometry &other);
31
32 ~GeoDataMultiGeometry() override;
33
34 const char *nodeType() const override;
35
36 EnumGeometryId geometryId() const override;
37
38 GeoDataGeometry *copy() const override;
39
40 bool operator==(const GeoDataMultiGeometry &other) const;
41 bool operator!=(const GeoDataMultiGeometry &other) const
42 {
43 return !(*this == other);
44 }
45
46 const GeoDataLatLonAltBox &latLonAltBox() const override;
47
48 int size() const;
49 GeoDataGeometry &at(int pos);
50 const GeoDataGeometry &at(int pos) const;
51 GeoDataGeometry &operator[](int pos);
52 const GeoDataGeometry &operator[](int pos) const;
53
54 GeoDataGeometry &first();
55 const GeoDataGeometry &first() const;
56 GeoDataGeometry &last();
57 const GeoDataGeometry &last() const;
58
59 /**
60 * @brief returns the requested child item
61 */
62 GeoDataGeometry *child(int);
63
64 /**
65 * @brief returns the requested child item
66 */
67 const GeoDataGeometry *child(int) const;
68
69 /**
70 * @brief returns the position of an item in the list
71 */
72 int childPosition(const GeoDataGeometry *child) const;
73
74 /**
75 * @brief add an element
76 */
77 void append(GeoDataGeometry *other);
78
79 GeoDataMultiGeometry &operator<<(const GeoDataGeometry &value);
80
85 void clear();
87
90
91 // Serialize the Placemark to @p stream
92 void pack(QDataStream &stream) const override;
93 // Unserialize the Placemark from @p stream
94 void unpack(QDataStream &stream) override;
95
96private:
97 Q_DECLARE_PRIVATE(GeoDataMultiGeometry)
98};
99
100}
101
102#endif
A base class for all geodata features.
A class that defines a 3D bounding box for geographic data.
A class that can contain other GeoDataGeometry 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 Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.