File indexing completed on 2024-05-12 03:50:14

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2009 Torsten Rahn <rahn@kde.org>
0004 //
0005 
0006 
0007 #include "GeoDataLod.h"
0008 #include "GeoDataLod_p.h"
0009 
0010 #include <QDataStream>
0011 
0012 namespace Marble
0013 {
0014 GeoDataLod::GeoDataLod()
0015     : GeoDataObject(),
0016       d( new GeoDataLodPrivate )
0017 {
0018 }
0019 
0020 GeoDataLod::GeoDataLod( const GeoDataLod& other )
0021     : GeoDataObject( other ),
0022       d( new GeoDataLodPrivate( *other.d ) )
0023 {
0024 }
0025 
0026 GeoDataLod::~GeoDataLod()
0027 {
0028     delete d;
0029 }
0030 
0031 bool GeoDataLod::operator==(const GeoDataLod& other) const
0032 {
0033     return equals( other )
0034            &&d->m_maxFadeExtent == other.d->m_maxFadeExtent
0035            && d->m_maxLodPixels == other.d->m_maxLodPixels
0036            && d->m_minFadeExtent == other.d->m_minFadeExtent
0037            && d->m_minLodPixels == other.d->m_minLodPixels;
0038 }
0039 
0040 bool GeoDataLod::operator!=(const GeoDataLod& other) const
0041 {
0042     return !this->operator==( other );
0043 }
0044 
0045 const char* GeoDataLod::nodeType() const
0046 {
0047     return GeoDataTypes::GeoDataLodType;
0048 }
0049 
0050 
0051 qreal GeoDataLod::minLodPixels() const
0052 {
0053     return d->m_minLodPixels;
0054 }
0055 
0056 
0057 void GeoDataLod::setMinLodPixels( qreal pixels )
0058 {
0059     d->m_minLodPixels = pixels;
0060 }
0061 
0062 
0063 qreal GeoDataLod::maxLodPixels() const
0064 {
0065     return d->m_maxLodPixels;
0066 }
0067 
0068 
0069 void GeoDataLod::setMaxLodPixels( qreal pixels )
0070 {
0071     d->m_maxLodPixels = pixels;
0072 }
0073 
0074 
0075 qreal GeoDataLod::minFadeExtent() const
0076 {
0077     return d->m_minFadeExtent;
0078 }
0079 
0080 
0081 void GeoDataLod::setMinFadeExtent( qreal pixels )
0082 {
0083     d->m_minFadeExtent = pixels;
0084 }
0085 
0086 
0087 qreal GeoDataLod::maxFadeExtent() const
0088 {
0089     return d->m_maxFadeExtent;
0090 }
0091 
0092 
0093 void GeoDataLod::setMaxFadeExtent( qreal pixels )
0094 {
0095     d->m_maxFadeExtent = pixels;
0096 }
0097 
0098 
0099 void GeoDataLod::pack( QDataStream& stream ) const
0100 {
0101     GeoDataObject::pack( stream );
0102 
0103     stream << d->m_minLodPixels << d->m_maxLodPixels;
0104     stream << d->m_minFadeExtent << d->m_maxFadeExtent;
0105 }
0106 
0107 void GeoDataLod::unpack( QDataStream& stream )
0108 {
0109     GeoDataObject::unpack( stream );
0110 
0111     stream >> d->m_minLodPixels >> d->m_maxLodPixels;
0112     stream >> d->m_minFadeExtent >> d->m_maxFadeExtent;
0113 }
0114 
0115 GeoDataLod &GeoDataLod::operator=( const GeoDataLod& other )
0116 {
0117     *d = *other.d;
0118     return *this;
0119 }
0120 
0121 }
0122