• 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
GeoDataStyle.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 2007 Murad Tagirov <tmurad@gmail.com>
9 //
10 
11 
12 #include "GeoDataStyle.h"
13 
14 #include "GeoDataTypes.h"
15 
16 namespace Marble
17 {
18 
19 class GeoDataStylePrivate
20 {
21  public:
22  GeoDataStylePrivate()
23  {
24  }
25 
26  GeoDataStylePrivate(const QImage& icon,
27  const QFont &font, const QColor &color )
28  : m_iconStyle( icon ),
29  m_labelStyle( font, color ),
30  m_lineStyle( color ),
31  m_polyStyle( color ),
32  m_balloonStyle()
33  {
34  }
35 
36  const char* nodeType() const
37  {
38  return GeoDataTypes::GeoDataStyleType;
39  }
40 
41  GeoDataIconStyle m_iconStyle;
42  GeoDataLabelStyle m_labelStyle;
43  GeoDataLineStyle m_lineStyle;
44  GeoDataPolyStyle m_polyStyle;
45  GeoDataBalloonStyle m_balloonStyle;
46  GeoDataListStyle m_listStyle;
47 };
48 
49 GeoDataStyle::GeoDataStyle()
50  : d( new GeoDataStylePrivate )
51 {
52 }
53 
54 GeoDataStyle::GeoDataStyle( const GeoDataStyle& other )
55  : GeoDataStyleSelector( other ), d( new GeoDataStylePrivate( *other.d ) )
56 {
57 }
58 
59 GeoDataStyle::GeoDataStyle( const QImage& icon,
60  const QFont &font, const QColor &color )
61  : d( new GeoDataStylePrivate( icon, font, color ) )
62 {
63 }
64 
65 GeoDataStyle::~GeoDataStyle()
66 {
67  delete d;
68 }
69 
70 GeoDataStyle& GeoDataStyle::operator=( const GeoDataStyle& other )
71 {
72  GeoDataStyleSelector::operator=( other );
73  *d = *other.d;
74  return *this;
75 }
76 
77 bool GeoDataStyle::operator==( const GeoDataStyle &other ) const
78 {
79  if ( GeoDataStyleSelector::operator!=( other ) ) {
80  return false;
81  }
82 
83  return d->m_iconStyle == other.d->m_iconStyle &&
84  d->m_labelStyle == other.d->m_labelStyle &&
85  d->m_listStyle == other.d->m_listStyle &&
86  d->m_polyStyle == other.d->m_polyStyle &&
87  d->m_balloonStyle == other.d->m_balloonStyle &&
88  d->m_listStyle == other.d->m_listStyle;
89 }
90 
91 bool GeoDataStyle::operator!=( const GeoDataStyle &other ) const
92 {
93  return !this->operator==( other );
94 }
95 
96 const char* GeoDataStyle::nodeType() const
97 {
98  return d->nodeType();
99 }
100 
101 void GeoDataStyle::setIconStyle( const GeoDataIconStyle& style )
102 {
103  d->m_iconStyle = style;
104  d->m_iconStyle.setParent( this );
105 }
106 
107 void GeoDataStyle::setLineStyle( const GeoDataLineStyle& style )
108 {
109  d->m_lineStyle = style;
110 }
111 
112 void GeoDataStyle::setLabelStyle( const GeoDataLabelStyle& style )
113 {
114  d->m_labelStyle = style;
115 }
116 
117 void GeoDataStyle::setPolyStyle( const GeoDataPolyStyle& style )
118 {
119  d->m_polyStyle = style;
120 }
121 
122 void GeoDataStyle::setBalloonStyle( const GeoDataBalloonStyle& style )
123 {
124  d->m_balloonStyle = style;
125 }
126 
127 void GeoDataStyle::setListStyle( const GeoDataListStyle& style )
128 {
129  d->m_listStyle = style;
130  d->m_listStyle.setParent( this );
131 }
132 
133 GeoDataIconStyle& GeoDataStyle::iconStyle()
134 {
135  return d->m_iconStyle;
136 }
137 
138 const GeoDataIconStyle& GeoDataStyle::iconStyle() const
139 {
140  return d->m_iconStyle;
141 }
142 
143 GeoDataLineStyle& GeoDataStyle::lineStyle()
144 {
145  return d->m_lineStyle;
146 }
147 
148 const GeoDataLineStyle& GeoDataStyle::lineStyle() const
149 {
150  return d->m_lineStyle;
151 }
152 
153 GeoDataPolyStyle& GeoDataStyle::polyStyle()
154 {
155  return d->m_polyStyle;
156 }
157 
158 const GeoDataPolyStyle& GeoDataStyle::polyStyle() const
159 {
160  return d->m_polyStyle;
161 }
162 
163 GeoDataLabelStyle& GeoDataStyle::labelStyle()
164 {
165  return d->m_labelStyle;
166 }
167 
168 const GeoDataLabelStyle& GeoDataStyle::labelStyle() const
169 {
170  return d->m_labelStyle;
171 }
172 
173 GeoDataBalloonStyle& GeoDataStyle::balloonStyle()
174 {
175  return d->m_balloonStyle;
176 }
177 
178 const GeoDataBalloonStyle& GeoDataStyle::balloonStyle() const
179 {
180  return d->m_balloonStyle;
181 }
182 
183 GeoDataListStyle& GeoDataStyle::listStyle()
184 {
185  return d->m_listStyle;
186 }
187 
188 const GeoDataListStyle& GeoDataStyle::listStyle() const
189 {
190  return d->m_listStyle;
191 }
192 
193 void GeoDataStyle::pack( QDataStream& stream ) const
194 {
195  GeoDataStyleSelector::pack( stream );
196 
197  d->m_iconStyle.pack( stream );
198  d->m_labelStyle.pack( stream );
199  d->m_polyStyle.pack( stream );
200  d->m_lineStyle.pack( stream );
201  d->m_balloonStyle.pack( stream );
202  d->m_listStyle.pack( stream );
203 }
204 
205 void GeoDataStyle::unpack( QDataStream& stream )
206 {
207  GeoDataStyleSelector::unpack( stream );
208 
209  d->m_iconStyle.unpack( stream );
210  d->m_labelStyle.unpack( stream );
211  d->m_lineStyle.unpack( stream );
212  d->m_polyStyle.unpack( stream );
213  d->m_balloonStyle.unpack( stream );
214  d->m_listStyle.unpack( stream );
215 }
216 
217 }
Marble::GeoDataIconStyle
Definition: GeoDataIconStyle.h:29
Marble::GeoDataLineStyle
specifies the style how lines are drawn
Definition: GeoDataLineStyle.h:36
Marble::GeoDataStyle::operator=
GeoDataStyle & operator=(const GeoDataStyle &other)
assignment operator
Definition: GeoDataStyle.cpp:70
QDataStream
QFont
Marble::GeoDataStyle::polyStyle
GeoDataPolyStyle & polyStyle()
Return the label style of this style.
Definition: GeoDataStyle.cpp:153
Marble::GeoDataStyle::setIconStyle
void setIconStyle(const GeoDataIconStyle &style)
set the icon style
Definition: GeoDataStyle.cpp:101
Marble::GeoDataStyle::setListStyle
void setListStyle(const GeoDataListStyle &style)
set the list style
Definition: GeoDataStyle.cpp:127
Marble::GeoDataStyle::setBalloonStyle
void setBalloonStyle(const GeoDataBalloonStyle &style)
set the balloon style
Definition: GeoDataStyle.cpp:122
Marble::GeoDataStyle::iconStyle
GeoDataIconStyle & iconStyle()
Return the icon style of this style.
Definition: GeoDataStyle.cpp:133
GeoDataStyle.h
Marble::GeoDataStyle::lineStyle
GeoDataLineStyle & lineStyle()
Return the label style of this style.
Definition: GeoDataStyle.cpp:143
Marble::GeoDataStyle::pack
virtual void pack(QDataStream &stream) const
Serialize the style to a stream.
Definition: GeoDataStyle.cpp:193
Marble::GeoDataStyle::GeoDataStyle
GeoDataStyle()
Construct a default style.
Definition: GeoDataStyle.cpp:49
Marble::GeoDataStyle
an addressable style group
Definition: GeoDataStyle.h:55
Marble::GeoDataStyleSelector::unpack
virtual void unpack(QDataStream &stream)
Unserialize the styleselector from a stream.
Definition: GeoDataStyleSelector.cpp:66
Marble::GeoDataStyleSelector::operator=
GeoDataStyleSelector & operator=(const GeoDataStyleSelector &other)
assignment operator
Definition: GeoDataStyleSelector.cpp:39
QColor
Marble::GeoDataBalloonStyle
Definition: GeoDataBalloonStyle.h:23
Marble::GeoDataStyleSelector::pack
virtual void pack(QDataStream &stream) const
Serialize the styleselector to a stream.
Definition: GeoDataStyleSelector.cpp:61
QImage
Marble::GeoDataLabelStyle
specifies how the name of a GeoDataFeature is drawn
Definition: GeoDataLabelStyle.h:36
Marble::GeoDataStyle::setLineStyle
void setLineStyle(const GeoDataLineStyle &style)
set the line style
Definition: GeoDataStyle.cpp:107
Marble::GeoDataTypes::GeoDataStyleType
const char * GeoDataStyleType
Definition: GeoDataTypes.cpp:77
Marble::GeoDataStyle::operator==
bool operator==(const GeoDataStyle &other) const
Definition: GeoDataStyle.cpp:77
Marble::GeoDataStyle::balloonStyle
GeoDataBalloonStyle & balloonStyle()
Return the balloon style of this style.
Definition: GeoDataStyle.cpp:173
Marble::GeoDataStyle::listStyle
GeoDataListStyle & listStyle()
Return the list style of this style.
Definition: GeoDataStyle.cpp:183
Marble::GeoDataStyle::operator!=
bool operator!=(const GeoDataStyle &other) const
Definition: GeoDataStyle.cpp:91
Marble::GeoDataStyle::~GeoDataStyle
~GeoDataStyle()
Definition: GeoDataStyle.cpp:65
Marble::GeoDataStyle::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataStyle.cpp:96
Marble::GeoDataStyle::unpack
virtual void unpack(QDataStream &stream)
Unserialize the style from a stream.
Definition: GeoDataStyle.cpp:205
Marble::GeoDataStyle::setLabelStyle
void setLabelStyle(const GeoDataLabelStyle &style)
set the label style
Definition: GeoDataStyle.cpp:112
GeoDataTypes.h
Marble::GeoDataStyleSelector
a base class for the style classes
Definition: GeoDataStyleSelector.h:40
Marble::GeoDataPolyStyle
specifies the style how polygons are drawn
Definition: GeoDataPolyStyle.h:34
Marble::GeoDataStyle::labelStyle
GeoDataLabelStyle & labelStyle()
Return the label style of this style.
Definition: GeoDataStyle.cpp:163
Marble::GeoDataStyle::setPolyStyle
void setPolyStyle(const GeoDataPolyStyle &style)
set the poly style
Definition: GeoDataStyle.cpp:117
Marble::GeoDataListStyle
Definition: GeoDataListStyle.h:28
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