Marble

GeoDataMultiGeometry.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2008 Patrick Spendrin <[email protected]>
4 //
5 
6 
7 #ifndef MARBLE_GEODATAMULTIGEOMETRY_H
8 #define MARBLE_GEODATAMULTIGEOMETRY_H
9 
10 
11 #include "geodata_export.h"
12 
13 #include "GeoDataGeometry.h"
14 #include <QVector>
15 
16 namespace Marble
17 {
18 
19 class GeoDataMultiGeometryPrivate;
20 
21 /**
22  * @short A class that can contain other GeoDataGeometry objects
23  *
24  * GeoDataMultiGeometry is a collection of other GeoDataGeometry objects.
25  * As one can add GeoDataMultiGeometry to itself, you can make up a collection
26  * of different objects to form one Placemark.
27  */
28 class GEODATA_EXPORT GeoDataMultiGeometry : public GeoDataGeometry
29 {
30  public:
32  explicit GeoDataMultiGeometry( const GeoDataGeometry& other );
33 
34  ~GeoDataMultiGeometry() override;
35 
36  const char *nodeType() const override;
37 
38  EnumGeometryId geometryId() const override;
39 
40  GeoDataGeometry *copy() const override;
41 
42  bool operator==(const GeoDataMultiGeometry &other) const;
43  bool operator!=(const GeoDataMultiGeometry &other) const { return !(*this == other); }
44 
45  const GeoDataLatLonAltBox& latLonAltBox() const override;
46 
47  int size() const;
48  GeoDataGeometry& at( int pos );
49  const GeoDataGeometry& at( int pos ) const;
50  GeoDataGeometry& operator[]( int pos );
51  const GeoDataGeometry& operator[]( int pos ) const;
52 
53  GeoDataGeometry& first();
54  const GeoDataGeometry& first() const;
55  GeoDataGeometry& last();
56  const GeoDataGeometry& last() const;
57 
58  /**
59  * @brief returns the requested child item
60  */
61  GeoDataGeometry* child( int );
62 
63  /**
64  * @brief returns the requested child item
65  */
66  const GeoDataGeometry* child( int ) const;
67 
68  /**
69  * @brief returns the position of an item in the list
70  */
71  int childPosition( const GeoDataGeometry *child ) const;
72 
73  /**
74  * @brief add an element
75  */
76  void append( GeoDataGeometry *other );
77 
78  GeoDataMultiGeometry& operator << ( const GeoDataGeometry& value );
79 
84  void clear();
86 
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 
96  private:
97  Q_DECLARE_PRIVATE(GeoDataMultiGeometry)
98 };
99 
100 }
101 
102 #endif
A class that defines a 3D bounding box for geographic data.
A base class for all geodata features.
Binds a QML item to a specific geodetic location in screen coordinates.
A class that can contain other GeoDataGeometry objects.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:53:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.