Marble

GeoDataLod.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2009 Torsten Rahn <rahn@kde.org>
4//
5
6
7#include "GeoDataLod.h"
8#include "GeoDataLod_p.h"
9
10#include <QDataStream>
11
12namespace 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
31bool 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
40bool GeoDataLod::operator!=(const GeoDataLod& other) const
41{
42 return !this->operator==( other );
43}
44
45const char* GeoDataLod::nodeType() const
46{
47 return GeoDataTypes::GeoDataLodType;
48}
49
50
52{
53 return d->m_minLodPixels;
54}
55
56
57void GeoDataLod::setMinLodPixels( qreal pixels )
58{
59 d->m_minLodPixels = pixels;
60}
61
62
64{
65 return d->m_maxLodPixels;
66}
67
68
69void GeoDataLod::setMaxLodPixels( qreal pixels )
70{
71 d->m_maxLodPixels = pixels;
72}
73
74
76{
77 return d->m_minFadeExtent;
78}
79
80
81void GeoDataLod::setMinFadeExtent( qreal pixels )
82{
83 d->m_minFadeExtent = pixels;
84}
85
86
88{
89 return d->m_maxFadeExtent;
90}
91
92
93void GeoDataLod::setMaxFadeExtent( qreal pixels )
94{
95 d->m_maxFadeExtent = pixels;
96}
97
98
99void 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
115GeoDataLod &GeoDataLod::operator=( const GeoDataLod& other )
116{
117 *d = *other.d;
118 return *this;
119}
120
121}
122
The level of detail which indicates visibility and importance.
Definition GeoDataLod.h:40
void setMaxFadeExtent(qreal pixels)
Sets how "quickly" the region fades when the region is near. Sets the distance (counted from maxLodPi...
qreal minLodPixels() const
Returns the minimum size that is needed for the region to be active Returns the minimum number of pix...
const char * nodeType() const override
Provides type information for downcasting a GeoNode.
void unpack(QDataStream &stream) override
Unserialize the Lod from a stream.
qreal maxFadeExtent() const
Returns how "quickly" the region fades when the region is near. Returns the distance (counted from ma...
qreal maxLodPixels() const
Returns the maximum size that is needed for the region to be active Returns the maximum number of pix...
void setMinLodPixels(qreal pixels)
Sets the minimum size that is needed for the region to be active Sets the minimum number of pixels th...
GeoDataLod()
Creates a new Level of Detail object.
void pack(QDataStream &stream) const override
Serialize the Lod to a stream.
void setMinFadeExtent(qreal pixels)
Sets how "quickly" the region fades when the region is far away. Sets the distance (counted from minL...
void setMaxLodPixels(qreal pixels)
Sets the maximum size that is needed for the region to be active Sets the maximum number of pixels th...
~GeoDataLod() override
Destroys a Level of Detail object.
bool operator==(const GeoDataLod &other) const
Provides type information for downcasting a GeoNode.
qreal minFadeExtent() const
Returns how "quickly" the region fades when the region is far away. Returns the distance (counted fro...
A base class for all geodata objects.
virtual bool equals(const GeoDataObject &other) const
Compares the value of id and targetId of the two objects.
void pack(QDataStream &stream) const override
Reimplemented from Serializable.
void unpack(QDataStream &steam) override
Reimplemented from Serializable.
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 Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.