Marble

GeoDataLod.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2009 Torsten Rahn <[email protected]>
4 //
5 
6 
7 #include "GeoDataLod.h"
8 #include "GeoDataLod_p.h"
9 
10 #include <QDataStream>
11 
12 namespace Marble
13 {
15  : GeoDataObject(),
16  d( new GeoDataLodPrivate )
17 {
18 }
19 
21  : GeoDataObject( other ),
22  d( new GeoDataLodPrivate( *other.d ) )
23 {
24 }
25 
27 {
28  delete d;
29 }
30 
31 bool GeoDataLod::operator==(const GeoDataLod& other) const
32 {
33  return equals( other )
34  &&d->m_maxFadeExtent == other.d->m_maxFadeExtent
35  && d->m_maxLodPixels == other.d->m_maxLodPixels
36  && d->m_minFadeExtent == other.d->m_minFadeExtent
37  && d->m_minLodPixels == other.d->m_minLodPixels;
38 }
39 
40 bool GeoDataLod::operator!=(const GeoDataLod& other) const
41 {
42  return !this->operator==( other );
43 }
44 
45 const char* GeoDataLod::nodeType() const
46 {
47  return GeoDataTypes::GeoDataLodType;
48 }
49 
50 
52 {
53  return d->m_minLodPixels;
54 }
55 
56 
57 void GeoDataLod::setMinLodPixels( qreal pixels )
58 {
59  d->m_minLodPixels = pixels;
60 }
61 
62 
64 {
65  return d->m_maxLodPixels;
66 }
67 
68 
69 void GeoDataLod::setMaxLodPixels( qreal pixels )
70 {
71  d->m_maxLodPixels = pixels;
72 }
73 
74 
76 {
77  return d->m_minFadeExtent;
78 }
79 
80 
81 void GeoDataLod::setMinFadeExtent( qreal pixels )
82 {
83  d->m_minFadeExtent = pixels;
84 }
85 
86 
88 {
89  return d->m_maxFadeExtent;
90 }
91 
92 
93 void GeoDataLod::setMaxFadeExtent( qreal pixels )
94 {
95  d->m_maxFadeExtent = pixels;
96 }
97 
98 
99 void GeoDataLod::pack( QDataStream& stream ) const
100 {
101  GeoDataObject::pack( stream );
102 
103  stream << d->m_minLodPixels << d->m_maxLodPixels;
104  stream << d->m_minFadeExtent << d->m_maxFadeExtent;
105 }
106 
108 {
109  GeoDataObject::unpack( stream );
110 
111  stream >> d->m_minLodPixels >> d->m_maxLodPixels;
112  stream >> d->m_minFadeExtent >> d->m_maxFadeExtent;
113 }
114 
115 GeoDataLod &GeoDataLod::operator=( const GeoDataLod& other )
116 {
117  *d = *other.d;
118  return *this;
119 }
120 
121 }
122 
bool operator==(const GeoDataLod &other) const
Provides type information for downcasting a GeoNode.
Definition: GeoDataLod.cpp:31
qreal minFadeExtent() const
Returns how "quickly" the region fades when the region is far away. Returns the distance (counted fro...
Definition: GeoDataLod.cpp:75
qreal maxLodPixels() const
Returns the maximum size that is needed for the region to be active Returns the maximum number of pix...
Definition: GeoDataLod.cpp:63
qreal minLodPixels() const
Returns the minimum size that is needed for the region to be active Returns the minimum number of pix...
Definition: GeoDataLod.cpp:51
void setMinLodPixels(qreal pixels)
Sets the minimum size that is needed for the region to be active Sets the minimum number of pixels th...
Definition: GeoDataLod.cpp:57
A base class for all geodata objects.
Definition: GeoDataObject.h:43
void pack(QDataStream &stream) const override
Reimplemented from Serializable.
Binds a QML item to a specific geodetic location in screen coordinates.
virtual bool equals(const GeoDataObject &other) const
Compares the value of id and targetId of the two objects.
void setMinFadeExtent(qreal pixels)
Sets how "quickly" the region fades when the region is far away. Sets the distance (counted from minL...
Definition: GeoDataLod.cpp:81
void setMaxFadeExtent(qreal pixels)
Sets how "quickly" the region fades when the region is near. Sets the distance (counted from maxLodPi...
Definition: GeoDataLod.cpp:93
const char * nodeType() const override
Provides type information for downcasting a GeoNode.
Definition: GeoDataLod.cpp:45
void pack(QDataStream &stream) const override
Serialize the Lod to a stream.
Definition: GeoDataLod.cpp:99
~GeoDataLod() override
Destroys a Level of Detail object.
Definition: GeoDataLod.cpp:26
qreal maxFadeExtent() const
Returns how "quickly" the region fades when the region is near. Returns the distance (counted from ma...
Definition: GeoDataLod.cpp:87
void setMaxLodPixels(qreal pixels)
Sets the maximum size that is needed for the region to be active Sets the maximum number of pixels th...
Definition: GeoDataLod.cpp:69
void unpack(QDataStream &steam) override
Reimplemented from Serializable.
void unpack(QDataStream &stream) override
Unserialize the Lod from a stream.
Definition: GeoDataLod.cpp:107
The level of detail which indicates visibility and importance.
Definition: GeoDataLod.h:39
GeoDataLod()
Creates a new Level of Detail object.
Definition: GeoDataLod.cpp:14
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 04:09:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.