Marble

GeoDataGeometry.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2008 Torsten Rahn <[email protected]>
4 // SPDX-FileCopyrightText: 2008-2009 Patrick Spendrin <[email protected]>
5 // SPDX-FileCopyrightText: 2008 Inge Wallin <[email protected]>
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 
18 namespace Marble
19 {
20 
21 class GeoDataGeometryPrivate;
22 
23 class GeoDataLatLonAltBox;
24 class GeoDataLineString; // LinearRing is the same!
25 class 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 
38 class 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 
73 
74  protected:
75  GeoDataGeometryPrivate *d_ptr;
76 };
77 
78 }
79 
80 Q_DECLARE_METATYPE( Marble::GeoDataGeometry* )
81 
82 #endif
Binds a QML item to a specific geodetic location in screen coordinates.
A base class for all geodata objects.
Definition: GeoDataObject.h:43
A base class for all geodata features.
virtual bool equals(const GeoDataObject &other) const
Compares the value of id and targetId of the two objects.
A class that defines a 3D bounding box for geographic data.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jan 20 2022 23:11:30 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.