Marble

GeoDataRegion.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2009 Torsten Rahn <tackat@kde.org>
4//
5
6#ifndef MARBLE_GEODATAREGION_H
7#define MARBLE_GEODATAREGION_H
8
9#include "GeoDataObject.h"
10
11namespace Marble
12{
13
14class GeoDataFeature;
15class GeoDataLatLonAltBox;
16class GeoDataLod;
17class GeoDataRegionPrivate;
18
19/*!
20 \class GeoDataRegion
21 \brief GeoDataRegion describes the visibility and extent of a feature.
22
23 GeoDataRegion is a tool class that implements the Region tag/class
24 of the Open Geospatial Consortium standard KML 2.2.
25
26 GeoDataRegion provides all aspects that can be taken into account to find
27 out whether a GeoDataFeature (or a GeoDataLink) is visible on the map:
28
29 \li On one hand GeoDataRegion owns a GeoDataLatLon(Alt)Box object.
30 GeoDataLatLon(Alt)Box is a bounding box in geodesic coordinates.
31 As such GeoDataLatLon(Alt)Box allows to determine whether the feature is
32 located inside the area that the observer/camera is looking at
33 ("viewLatLonAltBox").
34 \li Additionally GeoDataRegion has got a GeoDataLod ("Level of Detail")
35 object. GeoDataLod describes the least and maximum size on the
36 screen that is required to consider a feature to be active.
37
38 A feature is visible if it's active and if its latLonAltBox covers the area
39 that is being looked at by the observer.
40*/
41
42class GEODATA_EXPORT GeoDataRegion : public GeoDataObject
43{
44public:
45 /*!
46 \brief Creates a new GeoDataRegion object that is not assigned to a \a feature.
47 Naturally it's recommended to assign a feature or a link to the region (and
48 therefore it's recommended to use one of the other constructors instead).
49 This constructor allows to create a stand alone region which can get
50 assigned to the feature or link later on.
51 */
53
54 /*!
55 \brief Creates a new GeoDataRegion as a copy of \p other.
56 */
57 GeoDataRegion(const GeoDataRegion &other);
58
59 /*!
60 \brief Creates a new GeoDataRegion object that is associated to a \a feature.
61 In the model the feature represents the parent object of the region.
62 */
63 explicit GeoDataRegion(GeoDataFeature *feature);
64
65 /*!
66 \brief Destroys a Region object.
67 */
68 ~GeoDataRegion() override;
69
70 /*!
71 \brief Provides type information for downcasting a GeoNode
72 */
73 const char *nodeType() const override;
74
75 bool operator==(const GeoDataRegion &other) const;
76 bool operator!=(const GeoDataRegion &other) const;
77
78 /*!
79 \brief Returns a geodesic bounding box ("latLonAltBox") of the region.
80 Returns a geodesic bounding box that describes the extent of a feature or
81 a link.
82 If no latLonAltBox has been set then a GeoDataLatLonAltBox object
83 will be calculated automatically: If the associated parent object is
84 a feature then the geometry that might be associated to the feature
85 will be used to calculate the GeoDataLatLonAltBox. Otherwise the
86 coordinate will be used to create a GeoDataLatLonAltBox (in case that
87 there is no geometry assigned to the feature or if the parent object of the
88 region is a GeoDataLink).
89 */
90 const GeoDataLatLonAltBox &latLonAltBox() const;
91
92 /*!
93 \brief Sets the \a latLonAltBox of the region.
94 Sets the geodesic bounding box that describes the extent of a feature or
95 a link.
96 */
97 void setLatLonAltBox(const GeoDataLatLonAltBox &latLonAltBox);
98
99 /*!
100 \brief Returns the region's level of detail.
101 The level of detail is returned as a \a lod object.
102 If no \a lod has been set then a GeoDataLod object with default values
103 is being returned.
104 */
105 GeoDataLod &lod() const;
106
107 /*!
108 \brief Sets a region's level of detail.
109 The level of detail is set as a \a lod object.
110 */
111 void setLod(const GeoDataLod &lod);
112
113 // Serialization
114 /*!
115 \brief Serialize the Region to a stream.
116 \param stream the stream.
117 */
118 void pack(QDataStream &stream) const override;
119
120 /*!
121 \brief Unserialize the Region from a stream.
122 \param stream the stream.
123 */
124 void unpack(QDataStream &stream) override;
125
126 GeoDataRegion &operator=(const GeoDataRegion &other);
127
128private:
129 void swap(GeoDataRegion &other);
130 GeoDataRegionPrivate *d;
131};
132
133}
134
135#endif
A base class for all geodata features.
A class that defines a 3D bounding box for geographic data.
The level of detail which indicates visibility and importance.
Definition GeoDataLod.h:38
A base class for all geodata objects.
GeoDataRegion describes the visibility and extent of a feature.
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 Nov 8 2024 12:02:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.