Marble

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

KDE's Doxygen guidelines are available online.