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#include "GeoDataLod.h"
7#include "GeoDataLod_p.h"
8
9#include <QDataStream>
10
11namespace Marble
12{
15 , d(new GeoDataLodPrivate)
16{
17}
18
20 : GeoDataObject(other)
21 , d(new GeoDataLodPrivate(*other.d))
22{
23}
24
26{
27 delete d;
28}
29
30bool GeoDataLod::operator==(const GeoDataLod &other) const
31{
32 return equals(other) && d->m_maxFadeExtent == other.d->m_maxFadeExtent && d->m_maxLodPixels == other.d->m_maxLodPixels
33 && d->m_minFadeExtent == other.d->m_minFadeExtent && d->m_minLodPixels == other.d->m_minLodPixels;
34}
35
36bool GeoDataLod::operator!=(const GeoDataLod &other) const
37{
38 return !this->operator==(other);
39}
40
41const char *GeoDataLod::nodeType() const
42{
43 return GeoDataTypes::GeoDataLodType;
44}
45
47{
48 return d->m_minLodPixels;
49}
50
52{
53 d->m_minLodPixels = pixels;
54}
55
57{
58 return d->m_maxLodPixels;
59}
60
62{
63 d->m_maxLodPixels = pixels;
64}
65
67{
68 return d->m_minFadeExtent;
69}
70
72{
73 d->m_minFadeExtent = pixels;
74}
75
77{
78 return d->m_maxFadeExtent;
79}
80
82{
83 d->m_maxFadeExtent = pixels;
84}
85
86void GeoDataLod::pack(QDataStream &stream) const
87{
88 GeoDataObject::pack(stream);
89
90 stream << d->m_minLodPixels << d->m_maxLodPixels;
91 stream << d->m_minFadeExtent << d->m_maxFadeExtent;
92}
93
95{
97
98 stream >> d->m_minLodPixels >> d->m_maxLodPixels;
99 stream >> d->m_minFadeExtent >> d->m_maxFadeExtent;
100}
101
102GeoDataLod &GeoDataLod::operator=(const GeoDataLod &other)
103{
104 *d = *other.d;
105 return *this;
106}
107
108}
The level of detail which indicates visibility and importance.
Definition GeoDataLod.h:38
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 Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.