• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • data
GeoDataLod.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2009 Torsten Rahn <rahn@kde.org>
9 //
10 
11 
12 #include "GeoDataLod.h"
13 #include "GeoDataLod_p.h"
14 
15 #include <QDataStream>
16 
17 namespace Marble
18 {
19 GeoDataLod::GeoDataLod()
20  : GeoDataObject(),
21  d( new GeoDataLodPrivate )
22 {
23 }
24 
25 GeoDataLod::GeoDataLod( const GeoDataLod& other )
26  : GeoDataObject( other ),
27  d( new GeoDataLodPrivate( *other.d ) )
28 {
29 }
30 
31 GeoDataLod::~GeoDataLod()
32 {
33  delete d;
34 }
35 
36 bool GeoDataLod::operator==(const GeoDataLod& other) const
37 {
38  return equals( other )
39  &&d->m_maxFadeExtent == other.d->m_maxFadeExtent
40  && d->m_maxLodPixels == other.d->m_maxLodPixels
41  && d->m_minFadeExtent == other.d->m_minFadeExtent
42  && d->m_minLodPixels == other.d->m_minLodPixels;
43 }
44 
45 bool GeoDataLod::operator!=(const GeoDataLod& other) const
46 {
47  return !this->operator==( other );
48 }
49 
50 const char* GeoDataLod::nodeType() const
51 {
52  return d->nodeType();
53 }
54 
55 
56 qreal GeoDataLod::minLodPixels() const
57 {
58  return d->m_minLodPixels;
59 }
60 
61 
62 void GeoDataLod::setMinLodPixels( qreal pixels )
63 {
64  d->m_minLodPixels = pixels;
65 }
66 
67 
68 qreal GeoDataLod::maxLodPixels() const
69 {
70  return d->m_maxLodPixels;
71 }
72 
73 
74 void GeoDataLod::setMaxLodPixels( qreal pixels )
75 {
76  d->m_maxLodPixels = pixels;
77 }
78 
79 
80 qreal GeoDataLod::minFadeExtent() const
81 {
82  return d->m_minFadeExtent;
83 }
84 
85 
86 void GeoDataLod::setMinFadeExtent( qreal pixels )
87 {
88  d->m_minFadeExtent = pixels;
89 }
90 
91 
92 qreal GeoDataLod::maxFadeExtent() const
93 {
94  return d->m_maxFadeExtent;
95 }
96 
97 
98 void GeoDataLod::setMaxFadeExtent( qreal pixels )
99 {
100  d->m_maxFadeExtent = pixels;
101 }
102 
103 
104 void GeoDataLod::pack( QDataStream& stream ) const
105 {
106  GeoDataObject::pack( stream );
107 
108  stream << d->m_minLodPixels << d->m_maxLodPixels;
109  stream << d->m_minFadeExtent << d->m_maxFadeExtent;
110 }
111 
112 void GeoDataLod::unpack( QDataStream& stream )
113 {
114  GeoDataObject::unpack( stream );
115 
116  stream >> d->m_minLodPixels >> d->m_maxLodPixels;
117  stream >> d->m_minFadeExtent >> d->m_maxFadeExtent;
118 }
119 
120 GeoDataLod &GeoDataLod::operator=( const GeoDataLod& other )
121 {
122  *d = *other.d;
123  return *this;
124 }
125 
126 }
127 
Marble::GeoDataLodPrivate::m_minLodPixels
qreal m_minLodPixels
Definition: GeoDataLod_p.h:37
QDataStream
Marble::GeoDataLod::setMinFadeExtent
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:86
Marble::GeoDataObject
A base class for all geodata objects.
Definition: GeoDataObject.h:48
Marble::GeoDataLod::setMaxLodPixels
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:74
Marble::GeoDataObject::equals
virtual bool equals(const GeoDataObject &other) const
Compares the value of id and targetId of the two objects.
Definition: GeoDataObject.cpp:126
Marble::GeoDataObject::pack
virtual void pack(QDataStream &stream) const
Reimplemented from Serializable.
Definition: GeoDataObject.cpp:114
Marble::GeoDataLod::~GeoDataLod
virtual ~GeoDataLod()
Destroys a Level of Detail object.
Definition: GeoDataLod.cpp:31
Marble::GeoDataLod::operator!=
bool operator!=(const GeoDataLod &other) const
Definition: GeoDataLod.cpp:45
Marble::GeoDataLodPrivate::m_minFadeExtent
qreal m_minFadeExtent
Definition: GeoDataLod_p.h:39
Marble::GeoDataLod::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataLod.cpp:50
Marble::GeoDataLodPrivate::nodeType
const char * nodeType() const
Definition: GeoDataLod_p.h:32
GeoDataLod.h
Marble::GeoDataLod
The level of detail which indicates visibility and importance.
Definition: GeoDataLod.h:44
Marble::GeoDataLod::operator=
GeoDataLod & operator=(const GeoDataLod &other)
Definition: GeoDataLod.cpp:120
Marble::GeoDataLod::GeoDataLod
GeoDataLod()
Creates a new Level of Detail object.
Definition: GeoDataLod.cpp:19
Marble::GeoDataLod::unpack
virtual void unpack(QDataStream &stream)
Unserialize the Lod from a stream.
Definition: GeoDataLod.cpp:112
Marble::GeoDataLod::maxFadeExtent
qreal maxFadeExtent() const
Returns how "quickly" the region fades when the region is near. Returns the distance (counted from ma...
Definition: GeoDataLod.cpp:92
Marble::GeoDataLodPrivate
Definition: GeoDataLod_p.h:21
Marble::GeoDataLod::minLodPixels
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:56
Marble::GeoDataLod::pack
virtual void pack(QDataStream &stream) const
Serialize the Lod to a stream.
Definition: GeoDataLod.cpp:104
GeoDataLod_p.h
Marble::GeoDataLod::d
GeoDataLodPrivate *const d
Definition: GeoDataLod.h:159
Marble::GeoDataLodPrivate::m_maxLodPixels
qreal m_maxLodPixels
Definition: GeoDataLod_p.h:38
Marble::GeoDataObject::unpack
virtual void unpack(QDataStream &steam)
Reimplemented from Serializable.
Definition: GeoDataObject.cpp:120
Marble::GeoDataLod::minFadeExtent
qreal minFadeExtent() const
Returns how "quickly" the region fades when the region is far away. Returns the distance (counted fro...
Definition: GeoDataLod.cpp:80
Marble::GeoDataLod::operator==
bool operator==(const GeoDataLod &other) const
Provides type information for downcasting a GeoNode.
Definition: GeoDataLod.cpp:36
Marble::GeoDataLod::setMinLodPixels
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:62
Marble::GeoDataLod::maxLodPixels
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:68
Marble::GeoDataLod::setMaxFadeExtent
void setMaxFadeExtent(qreal pixels)
Sets how "quickly" the region fades when the region is near. Sets the distance (counted from maxLodPi...
Definition: GeoDataLod.cpp:98
Marble::GeoDataLodPrivate::m_maxFadeExtent
qreal m_maxFadeExtent
Definition: GeoDataLod_p.h:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal