• 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
GeoDataFeature.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 // Copyright 2009 Patrick Spendrin <ps_ml@gmx.de>
10 //
11 
12 
13 #include "GeoDataFeature.h"
14 #include "GeoDataFeature_p.h"
15 
16 #include <QDataStream>
17 #include <QSize>
18 #include <QPixmap>
19 
20 #include "MarbleDirs.h"
21 #include "MarbleDebug.h"
22 
23 #include "GeoDataStyle.h"
24 #include "GeoDataStyleMap.h"
25 
26 #include "GeoDataContainer.h"
27 #include "GeoDataDocument.h"
28 #include "GeoDataFolder.h"
29 #include "GeoDataPlacemark.h"
30 #include "GeoDataRegion.h"
31 #include "GeoDataCamera.h"
32 
33 namespace Marble
34 {
35 QFont GeoDataFeaturePrivate::s_defaultFont = QFont("Sans Serif");
36 QColor GeoDataFeaturePrivate::s_defaultLabelColor = QColor( Qt::black );
37 
38 bool GeoDataFeaturePrivate::s_defaultStyleInitialized = false;
39 GeoDataStyle* GeoDataFeaturePrivate::s_defaultStyle[GeoDataFeature::LastIndex];
40 QMap<QString, GeoDataFeature::GeoDataVisualCategory> GeoDataFeaturePrivate::s_visualCategories;
41 
42 GeoDataFeature::GeoDataFeature()
43  :d( new GeoDataFeaturePrivate() )
44 {
45  d->ref.ref();
46 }
47 
48 GeoDataFeature::GeoDataFeature( const GeoDataFeature& other )
49  : GeoDataObject( other ),
50  d( other.d )
51 {
52  d->ref.ref();
53 }
54 
55 GeoDataFeature::GeoDataFeature( const QString& name )
56  : d( new GeoDataFeaturePrivate() )
57 {
58  d->ref.ref();
59  d->m_name = name;
60 }
61 
62 GeoDataFeature::GeoDataFeature( GeoDataFeaturePrivate *priv )
63  : d( priv )
64 {
65  d->ref.ref();
66 }
67 
68 GeoDataFeature::~GeoDataFeature()
69 {
70  if (!d->ref.deref()) {
71  delete d;
72  }
73 }
74 
75 GeoDataFeaturePrivate* GeoDataFeature::p() const
76 {
77  return static_cast<GeoDataFeaturePrivate*>(d);
78 }
79 
80 GeoDataFeature& GeoDataFeature::operator=( const GeoDataFeature& other )
81 {
82  GeoDataObject::operator=( other );
83 
84  if (!d->ref.deref()) {
85  delete d;
86  }
87 
88  d = other.d;
89  d->ref.ref();
90 
91  return *this;
92 }
93 
94 bool GeoDataFeature::equals( const GeoDataFeature &other ) const
95 {
96  if ( !GeoDataObject::equals(other) ||
97  p()->m_name != other.p()->m_name ||
98  p()->m_snippet != other.p()->m_snippet ||
99  p()->m_description != other.p()->m_description ||
100  p()->m_descriptionCDATA != other.p()->m_descriptionCDATA ||
101  p()->m_address != other.p()->m_address ||
102  p()->m_phoneNumber != other.p()->m_phoneNumber ||
103  p()->m_styleUrl != other.p()->m_styleUrl ||
104  p()->m_popularity != other.p()->m_popularity ||
105  p()->m_zoomLevel != other.p()->m_zoomLevel ||
106  p()->m_visible != other.p()->m_visible ||
107  p()->m_role != other.p()->m_role ||
108  p()->m_extendedData != other.p()->m_extendedData ||
109  p()->m_timeSpan != other.p()->m_timeSpan ||
110  p()->m_timeStamp != other.p()->m_timeStamp ||
111  p()->m_region != other.p()->m_region ||
112  *style() != *other.style() ) {
113  return false;
114  }
115 
116  if ( (!p()->m_styleMap && other.p()->m_styleMap) ||
117  (p()->m_styleMap && !other.p()->m_styleMap) ) {
118  return false;
119  }
120 
121  if ( (p()->m_styleMap && other.p()->m_styleMap) &&
122  (*p()->m_styleMap != *other.p()->m_styleMap) ) {
123  return false;
124  }
125 
126  if ( !p()->m_abstractView && !other.p()->m_abstractView ) {
127  return true;
128  } else if ( (!p()->m_abstractView && other.p()->m_abstractView) ||
129  (p()->m_abstractView && !other.p()->m_abstractView) ) {
130  return false;
131  }
132 
133  if ( p()->m_abstractView->nodeType() != other.p()->m_abstractView->nodeType() ) {
134  return false;
135  }
136 
137  if ( p()->m_abstractView->nodeType() == GeoDataTypes::GeoDataCameraType ) {
138  GeoDataCamera *thisCam = dynamic_cast<GeoDataCamera*>( p()->m_abstractView );
139  GeoDataCamera *otherCam = dynamic_cast<GeoDataCamera*>( other.p()->m_abstractView );
140  Q_ASSERT(thisCam && otherCam);
141 
142  if ( *thisCam != *otherCam ) {
143  return false;
144  }
145  } else if ( p()->m_abstractView->nodeType() == GeoDataTypes::GeoDataLookAtType ) {
146  GeoDataLookAt *thisLookAt = dynamic_cast<GeoDataLookAt*>( p()->m_abstractView );
147  GeoDataLookAt *otherLookAt = dynamic_cast<GeoDataLookAt*>( other.p()->m_abstractView );
148  Q_ASSERT(thisLookAt && otherLookAt);
149 
150  if ( *thisLookAt != *otherLookAt ) {
151  return false;
152  }
153  }
154 
155  return true;
156 }
157 
158 const char* GeoDataFeature::nodeType() const
159 {
160  return p()->nodeType();
161 }
162 
163 EnumFeatureId GeoDataFeature::featureId() const
164 {
165  return d->featureId();
166 }
167 
168 void GeoDataFeaturePrivate::initializeDefaultStyles()
169 {
170  // We need to do this similar to the way KCmdLineOptions works in
171  // the future: Having a PlacemarkStyleProperty properties[] would
172  // help here greatly.
173 
174  QString defaultFamily = s_defaultFont.family();
175 
176 #ifdef Q_OS_MACX
177  int defaultSize = 10;
178 #else
179  int defaultSize = 8;
180 #endif
181 
182  s_defaultStyle[GeoDataFeature::None]
183  = new GeoDataStyle( QImage(),
184  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
185 
186  s_defaultStyle[GeoDataFeature::Default]
187  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/default_location.png" ) ),
188  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
189 
190  s_defaultStyle[GeoDataFeature::Unknown]
191  = new GeoDataStyle( QImage(),
192  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
193 
194  s_defaultStyle[GeoDataFeature::SmallCity]
195  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_4_white.png" ) ),
196  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
197 
198  s_defaultStyle[GeoDataFeature::SmallCountyCapital]
199  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_4_yellow.png" ) ),
200  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
201 
202  s_defaultStyle[GeoDataFeature::SmallStateCapital]
203  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_4_orange.png" ) ),
204  QFont( defaultFamily, defaultSize, 50, true ), s_defaultLabelColor );
205 
206  s_defaultStyle[GeoDataFeature::SmallNationCapital]
207  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_4_red.png" ) ),
208  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
209 
210  s_defaultStyle[GeoDataFeature::MediumCity]
211  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_3_white.png" ) ),
212  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
213 
214  s_defaultStyle[GeoDataFeature::MediumCountyCapital]
215  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_3_yellow.png" ) ),
216  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
217 
218  s_defaultStyle[GeoDataFeature::MediumStateCapital]
219  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_3_orange.png" ) ),
220  QFont( defaultFamily, defaultSize, 50, true ), s_defaultLabelColor );
221 
222  s_defaultStyle[GeoDataFeature::MediumNationCapital]
223  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_3_red.png" ) ),
224  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
225 
226  s_defaultStyle[GeoDataFeature::BigCity]
227  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_2_white.png" ) ),
228  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
229 
230  s_defaultStyle[GeoDataFeature::BigCountyCapital]
231  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_2_yellow.png" ) ),
232  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
233 
234  s_defaultStyle[GeoDataFeature::BigStateCapital]
235  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_2_orange.png" ) ),
236  QFont( defaultFamily, defaultSize, 50, true ), s_defaultLabelColor );
237 
238  s_defaultStyle[GeoDataFeature::BigNationCapital]
239  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_2_red.png" ) ),
240  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
241 
242  s_defaultStyle[GeoDataFeature::LargeCity]
243  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_1_white.png" ) ),
244  QFont( defaultFamily, defaultSize, 75, false ), s_defaultLabelColor );
245 
246  s_defaultStyle[GeoDataFeature::LargeCountyCapital]
247  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_1_yellow.png" ) ),
248  QFont( defaultFamily, defaultSize, 75, false ), s_defaultLabelColor );
249 
250  s_defaultStyle[GeoDataFeature::LargeStateCapital]
251  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_1_orange.png" ) ),
252  QFont( defaultFamily, defaultSize, 75, true ), s_defaultLabelColor );
253 
254  s_defaultStyle[GeoDataFeature::LargeNationCapital]
255  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/city_1_red.png" ) ),
256  QFont( defaultFamily, defaultSize, 75, false ), s_defaultLabelColor );
257 
258  s_defaultStyle[GeoDataFeature::Nation]
259  = new GeoDataStyle( QImage(),
260  QFont( defaultFamily, (int)(defaultSize * 1.2 ), 75, false ), QColor( "#404040" ) );
261  // Align area labels centered
262  s_defaultStyle[GeoDataFeature::Nation]->labelStyle().setAlignment( GeoDataLabelStyle::Center );
263 
264  s_defaultStyle[GeoDataFeature::Mountain]
265  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/mountain_1.png" ) ),
266  QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), s_defaultLabelColor );
267 
268  s_defaultStyle[GeoDataFeature::Volcano]
269  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/volcano_1.png" ) ),
270  QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), s_defaultLabelColor );
271 
272  s_defaultStyle[GeoDataFeature::Mons]
273  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/mountain_1.png" ) ),
274  QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), s_defaultLabelColor );
275 
276  s_defaultStyle[GeoDataFeature::Valley]
277  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/valley.png" ) ),
278  QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), s_defaultLabelColor );
279 
280  s_defaultStyle[GeoDataFeature::Continent]
281  = new GeoDataStyle( QImage(),
282  QFont( defaultFamily, (int)(defaultSize * 1.7 ), 50, false ), QColor( "#bf0303" ) );
283  // Align area labels centered
284  s_defaultStyle[GeoDataFeature::Continent]->labelStyle().setAlignment( GeoDataLabelStyle::Center );
285 
286  s_defaultStyle[GeoDataFeature::Ocean]
287  = new GeoDataStyle( QImage(),
288  QFont( defaultFamily, (int)(defaultSize * 1.7 ), 50, true ), QColor( "#2c72c7" ) );
289  // Align area labels centered
290  s_defaultStyle[GeoDataFeature::Ocean]->labelStyle().setAlignment( GeoDataLabelStyle::Center );
291 
292  s_defaultStyle[GeoDataFeature::OtherTerrain]
293  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/other.png" ) ),
294  QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), s_defaultLabelColor );
295 
296  s_defaultStyle[GeoDataFeature::Crater]
297  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/crater.png" ) ),
298  QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), s_defaultLabelColor );
299 
300  s_defaultStyle[GeoDataFeature::Mare]
301  = new GeoDataStyle( QImage(),
302  QFont( defaultFamily, (int)(defaultSize * 1.7 ), 50, false ), QColor( "#bf0303" ) );
303  // Align area labels centered
304  s_defaultStyle[GeoDataFeature::Mare]->labelStyle().setAlignment( GeoDataLabelStyle::Center );
305 
306  s_defaultStyle[GeoDataFeature::GeographicPole]
307  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/pole_1.png" ) ),
308  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
309 
310  s_defaultStyle[GeoDataFeature::MagneticPole]
311  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/pole_2.png" ) ),
312  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
313 
314  s_defaultStyle[GeoDataFeature::ShipWreck]
315  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/shipwreck.png" ) ),
316  QFont( defaultFamily, (int)(defaultSize * 0.8 ), 50, false ), s_defaultLabelColor );
317 
318  s_defaultStyle[GeoDataFeature::AirPort]
319  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/airport.png" ) ),
320  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
321 
322  s_defaultStyle[GeoDataFeature::Observatory]
323  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/observatory.png" ) ),
324  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
325 
326  s_defaultStyle[GeoDataFeature::Wikipedia]
327  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/wikipedia.png" ) ),
328  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
329 
330  s_defaultStyle[GeoDataFeature::OsmSite]
331  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/osm.png" ) ),
332  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
333 
334  s_defaultStyle[GeoDataFeature::Coordinate]
335  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/coordinate.png" ) ),
336  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
337 
338 
339  s_defaultStyle[GeoDataFeature::MannedLandingSite]
340  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/manned_landing.png" ) ),
341  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
342 
343  s_defaultStyle[GeoDataFeature::RoboticRover]
344  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/robotic_rover.png" ) ),
345  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
346 
347  s_defaultStyle[GeoDataFeature::UnmannedSoftLandingSite]
348  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/unmanned_soft_landing.png" ) ),
349  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
350 
351  s_defaultStyle[GeoDataFeature::UnmannedHardLandingSite]
352  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/unmanned_hard_landing.png" ) ),
353  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
354 
355  s_defaultStyle[GeoDataFeature::Folder]
356  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/folder.png" ) ),
357  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
358 
359  s_defaultStyle[GeoDataFeature::Bookmark]
360  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/bookmark.png" ) ),
361  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
362 
363  QFont const osmFont( defaultFamily, defaultSize, 50, false );
364  s_defaultStyle[GeoDataFeature::AccomodationCamping] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "accommodation_camping.p.16" );
365  s_defaultStyle[GeoDataFeature::AccomodationHostel] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "accommodation_hostel.p.16" );
366  s_defaultStyle[GeoDataFeature::AccomodationHotel] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "accommodation_hotel2.p.16" );
367  s_defaultStyle[GeoDataFeature::AccomodationMotel] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "accommodation_motel.p.16" );
368  s_defaultStyle[GeoDataFeature::AccomodationYouthHostel] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "accommodation_youth_hostel.p.16" );
369  s_defaultStyle[GeoDataFeature::AmenityLibrary] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "amenity_library.p.16" );
370  s_defaultStyle[GeoDataFeature::EducationCollege] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "education_college.p.16" );
371  s_defaultStyle[GeoDataFeature::EducationSchool] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "education_school.p.16" );
372  s_defaultStyle[GeoDataFeature::EducationUniversity] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "education_university.p.16" );
373  s_defaultStyle[GeoDataFeature::FoodBar] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "food_bar.p.16" );
374  s_defaultStyle[GeoDataFeature::FoodBiergarten] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "food_biergarten.p.16" );
375  s_defaultStyle[GeoDataFeature::FoodCafe] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "food_cafe.p.16" );
376  s_defaultStyle[GeoDataFeature::FoodFastFood] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "food_fastfood2.p.16" );
377  s_defaultStyle[GeoDataFeature::FoodPub] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "food_pub.p.16" );
378  s_defaultStyle[GeoDataFeature::FoodRestaurant] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "food_restaurant.p.16" );
379  s_defaultStyle[GeoDataFeature::HealthDoctors] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "health_doctors2.p.16" );
380  s_defaultStyle[GeoDataFeature::HealthHospital] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "health_hospital.p.16" );
381  s_defaultStyle[GeoDataFeature::HealthPharmacy] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "health_pharmacy.p.16" );
382  s_defaultStyle[GeoDataFeature::MoneyBank] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "money_bank2.p.16" );
383  s_defaultStyle[GeoDataFeature::ShoppingBeverages] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "shopping_alcohol.p.16" );
384  s_defaultStyle[GeoDataFeature::ShoppingHifi] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "shopping_hifi.p.16" );
385  s_defaultStyle[GeoDataFeature::ShoppingSupermarket] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "shopping_supermarket.p.16" );
386  s_defaultStyle[GeoDataFeature::TouristAttraction] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "tourist_attraction.p.16" );
387  s_defaultStyle[GeoDataFeature::TouristCastle] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "tourist_castle2.p.16" );
388  s_defaultStyle[GeoDataFeature::TouristCinema] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "tourist_cinema.p.16" );
389  s_defaultStyle[GeoDataFeature::TouristMonument] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "tourist_monument.p.16" );
390  s_defaultStyle[GeoDataFeature::TouristMuseum] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "tourist_museum.p.16" );
391  s_defaultStyle[GeoDataFeature::TouristRuin] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "tourist_ruin.p.16" );
392  s_defaultStyle[GeoDataFeature::TouristTheatre] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "tourist_theatre.p.16" );
393  s_defaultStyle[GeoDataFeature::TouristThemePark] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "tourist_theme_park.p.16" );
394  s_defaultStyle[GeoDataFeature::TouristViewPoint] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "tourist_view_point.p.16" );
395  s_defaultStyle[GeoDataFeature::TouristZoo] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "tourist_zoo.p.16" );
396  s_defaultStyle[GeoDataFeature::TransportAerodrome] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_aerodrome.p.16" );
397  s_defaultStyle[GeoDataFeature::TransportAirportTerminal] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_airport_terminal.p.16" );
398  s_defaultStyle[GeoDataFeature::TransportBusStation] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_bus_station.p.16" );
399  s_defaultStyle[GeoDataFeature::TransportBusStop] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_bus_stop.p.16" );
400  s_defaultStyle[GeoDataFeature::TransportCarShare] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_car_share.p.16" );
401  s_defaultStyle[GeoDataFeature::TransportFuel] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_fuel.p.16" );
402  s_defaultStyle[GeoDataFeature::TransportParking] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_parking.p.16", "#F6EEB6", QColor( "#F6EEB6" ).darker() );
403  s_defaultStyle[GeoDataFeature::TransportTrainStation] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_train_station.p.16" );
404  s_defaultStyle[GeoDataFeature::TransportTramStop] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_tram_stop.p.16" );
405  s_defaultStyle[GeoDataFeature::TransportRentalBicycle] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_rental_bicycle.p.16" );
406  s_defaultStyle[GeoDataFeature::TransportRentalCar] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_rental_car.p.16" );
407  s_defaultStyle[GeoDataFeature::TransportTaxiRank] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "transport_taxi_rank.p.16" );
408  s_defaultStyle[GeoDataFeature::ReligionPlaceOfWorship] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "place_of_worship_unknown3.p.16" );
409  s_defaultStyle[GeoDataFeature::ReligionBahai] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "place_of_worship_bahai3.p.16" );
410  s_defaultStyle[GeoDataFeature::ReligionBuddhist] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "place_of_worship_buddhist3.p.16" );
411  s_defaultStyle[GeoDataFeature::ReligionChristian] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "place_of_worship_christian3.p.16" );
412  s_defaultStyle[GeoDataFeature::ReligionHindu] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "place_of_worship_hindu3.p.16" );
413  s_defaultStyle[GeoDataFeature::ReligionJain] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "place_of_worship_jain3.p.16" );
414  s_defaultStyle[GeoDataFeature::ReligionJewish] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "place_of_worship_jewish3.p.16" );
415  s_defaultStyle[GeoDataFeature::ReligionShinto] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "place_of_worship_shinto3.p.16" );
416  s_defaultStyle[GeoDataFeature::ReligionSikh] = GeoDataFeaturePrivate::createOsmPOIStyle( osmFont, "place_of_worship_sikh3.p.16" );
417 
418  s_defaultStyle[GeoDataFeature::HighwaySteps] = GeoDataFeaturePrivate::createStyle( 1, 5, "#F98072", "#F98072", true, true,
419  Qt::SolidPattern, Qt::CustomDashLine, Qt::FlatCap,
420  false, QVector< qreal >() << 0.2 << 0.2 );
421 
422  s_defaultStyle[GeoDataFeature::HighwayUnknown] = GeoDataFeaturePrivate::createHighwayStyle( "highway_unclassified", "#808080" );
423  s_defaultStyle[GeoDataFeature::HighwayPath] = GeoDataFeaturePrivate::createHighwayStyle( "highway_path", "#F98072", 1.0, 2, Qt::DashLine );
424  s_defaultStyle[GeoDataFeature::HighwayTrack] = GeoDataFeaturePrivate::createHighwayStyle( "highway_track", "#986600", 1.0, 3, Qt::DashLine );
425  s_defaultStyle[GeoDataFeature::HighwayPedestrian] = GeoDataFeaturePrivate::createHighwayStyle( "highway_footway", "#F98072", 1.0, 2, Qt::DashLine );
426  s_defaultStyle[GeoDataFeature::HighwayService] = GeoDataFeaturePrivate::createHighwayStyle( "highway_unclassified", "#FEFEFE", 1.0, 6 );
427  s_defaultStyle[GeoDataFeature::HighwayRoad] = GeoDataFeaturePrivate::createHighwayStyle( "highway_unclassified", "#FEFEFE", 1.5, 9 );
428  s_defaultStyle[GeoDataFeature::HighwayTertiary] = GeoDataFeaturePrivate::createHighwayStyle( "highway_tertiary", "#FEFEB3", 2.0, 11 );
429  s_defaultStyle[GeoDataFeature::HighwaySecondary] = GeoDataFeaturePrivate::createHighwayStyle( "highway_secondary", "#FDD6A4", 2.0, 13 );
430  s_defaultStyle[GeoDataFeature::HighwayPrimary] = GeoDataFeaturePrivate::createHighwayStyle( "highway_primary", "#EB989A", 3.0, 15 );
431  s_defaultStyle[GeoDataFeature::HighwayTrunk] = GeoDataFeaturePrivate::createHighwayStyle( "highway_trunk", "#A9DAA9", 3.0, 18 );
432  s_defaultStyle[GeoDataFeature::HighwayMotorway] = GeoDataFeaturePrivate::createHighwayStyle( "highway_motorway", "#809BC0", 3.0, 20 );
433 
434  s_defaultStyle[GeoDataFeature::HighwayTertiaryLink] = GeoDataFeaturePrivate::createHighwayStyle( "highway_tertiary", "#FEFEB3", 2.0, 9 );
435  s_defaultStyle[GeoDataFeature::HighwaySecondaryLink] = GeoDataFeaturePrivate::createHighwayStyle( "highway_secondary", "#FDD6A4", 2.0, 11 );
436  s_defaultStyle[GeoDataFeature::HighwayPrimaryLink] = GeoDataFeaturePrivate::createHighwayStyle( "highway_primary", "#EB989A", 2.0, 13 );
437  s_defaultStyle[GeoDataFeature::HighwayTrunkLink] = GeoDataFeaturePrivate::createHighwayStyle( "highway_trunk", "#A9DAA9", 3.0, 15 );
438  s_defaultStyle[GeoDataFeature::HighwayMotorwayLink] = GeoDataFeaturePrivate::createHighwayStyle( "highway_motorway", "#809BC0", 3.0, 18 );
439 
440  s_defaultStyle[GeoDataFeature::NaturalWater] = GeoDataFeaturePrivate::createStyle( 2, 10, "#B5D0D0", "#B5D0D0",
441  true, true, Qt::SolidPattern, Qt::SolidLine, Qt::RoundCap, false );
442  s_defaultStyle[GeoDataFeature::NaturalWood] = GeoDataFeaturePrivate::createWayStyle( "#8DC46C", "#8DC46C" );
443 
444  s_defaultStyle[GeoDataFeature::LeisurePark] = GeoDataFeaturePrivate::createWayStyle( "#CDF6CA", "#CDF6CA" );
445 
446  s_defaultStyle[GeoDataFeature::LanduseAllotments] = GeoDataFeaturePrivate::createWayStyle( "#E4C6AA", "#E4C6AA" );
447  s_defaultStyle[GeoDataFeature::LanduseBasin] = GeoDataFeaturePrivate::createWayStyle( QColor(0xB5, 0xD0, 0xD0, 0x80 ), QColor( 0xB5, 0xD0, 0xD0 ) );
448  s_defaultStyle[GeoDataFeature::LanduseCemetery] = GeoDataFeaturePrivate::createWayStyle( "#A9C9AE", "#A9C9AE" );
449  s_defaultStyle[GeoDataFeature::LanduseCommercial] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
450  s_defaultStyle[GeoDataFeature::LanduseConstruction] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
451  s_defaultStyle[GeoDataFeature::LanduseFarmland] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
452  s_defaultStyle[GeoDataFeature::LanduseFarmyard] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
453  s_defaultStyle[GeoDataFeature::LanduseGarages] = GeoDataFeaturePrivate::createWayStyle( "#E0DDCD", "#E0DDCD" );
454  s_defaultStyle[GeoDataFeature::LanduseGrass] = GeoDataFeaturePrivate::createWayStyle( "#A8C8A5", "#A8C8A5" );
455  s_defaultStyle[GeoDataFeature::LanduseIndustrial] = GeoDataFeaturePrivate::createWayStyle( "#DED0D5", "#DED0D5" );
456  s_defaultStyle[GeoDataFeature::LanduseLandfill] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
457  s_defaultStyle[GeoDataFeature::LanduseMeadow] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
458  s_defaultStyle[GeoDataFeature::LanduseMilitary] = GeoDataFeaturePrivate::createWayStyle( "#F3D8D2", "#F3D8D2", true, true, Qt::BDiagPattern );
459  s_defaultStyle[GeoDataFeature::LanduseQuarry] = GeoDataFeaturePrivate::createWayStyle( "#C4C2C2", "#C4C2C2" );
460  s_defaultStyle[GeoDataFeature::LanduseRailway] = GeoDataFeaturePrivate::createWayStyle( "#DED0D5", "#DED0D5" );
461  s_defaultStyle[GeoDataFeature::LanduseReservoir] = GeoDataFeaturePrivate::createWayStyle( "#B5D0D0", "#B5D0D0" );
462  s_defaultStyle[GeoDataFeature::LanduseResidential] = GeoDataFeaturePrivate::createWayStyle( "#DCDCDC", "#DCDCDC" );
463  s_defaultStyle[GeoDataFeature::LanduseRetail] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
464 
465  s_defaultStyle[GeoDataFeature::RailwayRail] = GeoDataFeaturePrivate::createStyle( 2, 5, "#989898", "#E1E1E1", true, true, Qt::SolidPattern, Qt::DashLine, Qt::FlatCap, true );
466  s_defaultStyle[GeoDataFeature::RailwayTram] = GeoDataFeaturePrivate::createStyle( 1, 4, "#989898", "#989898", true, true, Qt::SolidPattern, Qt::SolidLine, Qt::RoundCap, false );
467  s_defaultStyle[GeoDataFeature::RailwayLightRail] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
468  s_defaultStyle[GeoDataFeature::RailwayAbandoned] = GeoDataFeaturePrivate::createStyle( 2, 5, Qt::transparent, "#989898", false, false, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false );
469  s_defaultStyle[GeoDataFeature::RailwaySubway] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
470  s_defaultStyle[GeoDataFeature::RailwayPreserved] = GeoDataFeaturePrivate::createStyle( 2, 5, "#E1E1E1", "#989898", true, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, true );
471  s_defaultStyle[GeoDataFeature::RailwayMiniature] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
472  s_defaultStyle[GeoDataFeature::RailwayConstruction] = GeoDataFeaturePrivate::createStyle( 2, 5, "#E1E1E1", "#989898", true, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, true );
473  s_defaultStyle[GeoDataFeature::RailwayMonorail] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
474  s_defaultStyle[GeoDataFeature::RailwayFunicular] = GeoDataFeaturePrivate::createWayStyle( Qt::transparent, Qt::transparent, false, false );
475 
476  s_defaultStyle[GeoDataFeature::Building] = GeoDataFeaturePrivate::createStyle( 1, 0, QColor( 0xBE, 0xAD, 0xAD ), QColor( 0xBE, 0xAD, 0xAD ).darker(),
477  true, true, Qt::SolidPattern, Qt::SolidLine, Qt::RoundCap, false );
478 
479  s_defaultStyle[GeoDataFeature::Satellite]
480  = new GeoDataStyle( QImage( MarbleDirs::path( "bitmaps/satellite.png" ) ),
481  QFont( defaultFamily, defaultSize, 50, false ), s_defaultLabelColor );
482 
483  s_defaultStyleInitialized = true;
484  s_defaultFont = QFont("Sans Serif");
485 
486  QFont tmp;
487 
488 
489  // Fonts for areas ...
490  tmp = s_defaultStyle[GeoDataFeature::Continent]->labelStyle().font();
491  tmp.setLetterSpacing( QFont::AbsoluteSpacing, 2 );
492  tmp.setCapitalization( QFont::SmallCaps );
493  tmp.setBold( true );
494  s_defaultStyle[GeoDataFeature::Continent]->labelStyle().setFont( tmp );
495 
496  // Fonts for areas ...
497  tmp = s_defaultStyle[GeoDataFeature::Mare]->labelStyle().font();
498  tmp.setLetterSpacing( QFont::AbsoluteSpacing, 2 );
499  tmp.setCapitalization( QFont::SmallCaps );
500  tmp.setBold( true );
501  s_defaultStyle[GeoDataFeature::Mare]->labelStyle().setFont( tmp );
502 
503  // Now we need to underline the capitals ...
504 
505  tmp = s_defaultStyle[GeoDataFeature::SmallNationCapital]->labelStyle().font();
506  tmp.setUnderline( true );
507  s_defaultStyle[GeoDataFeature::SmallNationCapital]->labelStyle().setFont( tmp );
508 
509  tmp = s_defaultStyle[GeoDataFeature::MediumNationCapital]->labelStyle().font();
510  tmp.setUnderline( true );
511  s_defaultStyle[GeoDataFeature::MediumNationCapital]->labelStyle().setFont( tmp );
512 
513  tmp = s_defaultStyle[GeoDataFeature::BigNationCapital]->labelStyle().font();
514  tmp.setUnderline( true );
515  s_defaultStyle[GeoDataFeature::BigNationCapital]->labelStyle().setFont( tmp );
516 
517  tmp = s_defaultStyle[GeoDataFeature::LargeNationCapital]->labelStyle().font();
518  tmp.setUnderline( true );
519  s_defaultStyle[GeoDataFeature::LargeNationCapital]->labelStyle().setFont( tmp );
520 }
521 
522 QFont GeoDataFeature::defaultFont()
523 {
524  return GeoDataFeaturePrivate::s_defaultFont;
525 }
526 
527 void GeoDataFeature::setDefaultFont( const QFont& font )
528 {
529  GeoDataFeaturePrivate::s_defaultFont = font;
530  GeoDataFeaturePrivate::s_defaultStyleInitialized = false;
531 }
532 
533 QColor GeoDataFeature::defaultLabelColor()
534 {
535  return GeoDataFeaturePrivate::s_defaultLabelColor;
536 }
537 
538 void GeoDataFeature::setDefaultLabelColor( const QColor& color )
539 {
540  GeoDataFeaturePrivate::s_defaultLabelColor = color;
541  GeoDataFeaturePrivate::s_defaultStyleInitialized = false;
542 }
543 
544 QString GeoDataFeature::name() const
545 {
546  return d->m_name;
547 }
548 
549 void GeoDataFeature::setName( const QString &value )
550 {
551  detach();
552  d->m_name = value;
553 }
554 
555 GeoDataSnippet GeoDataFeature::snippet() const
556 {
557  return d->m_snippet;
558 }
559 
560 void GeoDataFeature::setSnippet( const GeoDataSnippet &snippet )
561 {
562  detach();
563  d->m_snippet = snippet;
564 }
565 
566 QString GeoDataFeature::address() const
567 {
568  return d->m_address;
569 }
570 
571 void GeoDataFeature::setAddress( const QString &value)
572 {
573  detach();
574  d->m_address = value;
575 }
576 
577 QString GeoDataFeature::phoneNumber() const
578 {
579  return d->m_phoneNumber;
580 }
581 
582 void GeoDataFeature::setPhoneNumber( const QString &value)
583 {
584  detach();
585  d->m_phoneNumber = value;
586 }
587 
588 QString GeoDataFeature::description() const
589 {
590  return d->m_description;
591 }
592 
593 void GeoDataFeature::setDescription( const QString &value)
594 {
595  detach();
596  d->m_description = value;
597 }
598 
599 bool GeoDataFeature::descriptionIsCDATA() const
600 {
601  return d->m_descriptionCDATA;
602 }
603 
604 void GeoDataFeature::setDescriptionCDATA( bool cdata )
605 {
606  detach();
607  d->m_descriptionCDATA = cdata;
608 }
609 
610 const GeoDataAbstractView* GeoDataFeature::abstractView() const
611 {
612  return d->m_abstractView;
613 }
614 
615 GeoDataAbstractView *GeoDataFeature::abstractView()
616 {
617  return d->m_abstractView;
618 }
619 
620 void GeoDataFeature::setAbstractView( GeoDataAbstractView *abstractView )
621 {
622  detach();
623  d->m_abstractView = abstractView;
624 }
625 
626 QString GeoDataFeature::styleUrl() const
627 {
628  return d->m_styleUrl;
629 }
630 
631 void GeoDataFeature::setStyleUrl( const QString &value)
632 {
633  detach();
634  d->m_styleUrl = value;
635  QString styleUrl = value;
636  styleUrl.remove('#');
637  GeoDataObject *object = parent();
638  bool found = false;
639  while ( object && !found ) {
640  if( object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
641  GeoDataDocument *doc = static_cast<GeoDataDocument*> ( object );
642  GeoDataStyleMap &styleMap = doc->styleMap( styleUrl );
643  if( !styleMap.value( QString( "normal" ) ).isEmpty() ) {
644  styleUrl = styleMap.value( QString( "normal" ) );
645  styleUrl.remove('#');
646  }
647  // Not calling setStyle here because we don't want
648  // re-parenting of the style
649  d->m_style = &doc->style( styleUrl );
650  found = true;
651  }
652  object = object->parent();
653  }
654 }
655 
656 bool GeoDataFeature::isVisible() const
657 {
658  return d->m_visible;
659 }
660 
661 void GeoDataFeature::setVisible( bool value )
662 {
663  detach();
664  d->m_visible = value;
665 }
666 
667 bool GeoDataFeature::isGloballyVisible() const
668 {
669  if ( parent() == 0 ) {
670  return d->m_visible;
671  }
672  GeoDataContainer *container = static_cast<GeoDataContainer*>( parent() );
673  return d->m_visible && container->isGloballyVisible();
674 }
675 
676 
677 const GeoDataTimeSpan &GeoDataFeature::timeSpan() const
678 {
679  return d->m_timeSpan;
680 }
681 
682 GeoDataTimeSpan &GeoDataFeature::timeSpan()
683 {
684  return d->m_timeSpan;
685 }
686 
687 void GeoDataFeature::setTimeSpan( const GeoDataTimeSpan &timeSpan )
688 {
689  detach();
690  d->m_timeSpan = timeSpan;
691 }
692 
693 const GeoDataTimeStamp &GeoDataFeature::timeStamp() const
694 {
695  return d->m_timeStamp;
696 }
697 
698 GeoDataTimeStamp &GeoDataFeature::timeStamp()
699 {
700  return d->m_timeStamp;
701 }
702 
703 void GeoDataFeature::setTimeStamp( const GeoDataTimeStamp &timeStamp )
704 {
705  detach();
706  d->m_timeStamp = timeStamp;
707 }
708 
709 const GeoDataStyle* GeoDataFeature::style() const
710 {
711  if ( d->m_style != 0 ) {
712  return d->m_style;
713  } else
714  {
715  if ( GeoDataFeaturePrivate::s_defaultStyleInitialized == false )
716  GeoDataFeaturePrivate::initializeDefaultStyles();
717 
718  if ( d->m_visualCategory != None
719  && GeoDataFeaturePrivate::s_defaultStyle[ d->m_visualCategory] )
720  {
721  return GeoDataFeaturePrivate::s_defaultStyle[ d->m_visualCategory ];
722  }
723  else
724  {
725  return GeoDataFeaturePrivate::s_defaultStyle[ GeoDataFeature::Default];
726  }
727  }
728 }
729 
730 const GeoDataStyle *GeoDataFeature::customStyle() const
731 {
732  return d->m_style;
733 }
734 
735 void GeoDataFeature::setStyle( GeoDataStyle* style )
736 {
737  detach();
738  if (style)
739  style->setParent( this );
740  d->m_style = style;
741 }
742 
743 GeoDataExtendedData& GeoDataFeature::extendedData() const
744 {
745  return d->m_extendedData;
746 }
747 
748 void GeoDataFeature::setExtendedData( const GeoDataExtendedData& extendedData )
749 {
750  detach();
751  d->m_extendedData = extendedData;
752 }
753 
754 GeoDataRegion& GeoDataFeature::region() const
755 {
756  return d->m_region;
757 }
758 
759 void GeoDataFeature::setRegion( const GeoDataRegion& region )
760 {
761  detach();
762  d->m_region = region;
763 }
764 
765 GeoDataFeature::GeoDataVisualCategory GeoDataFeature::visualCategory() const
766 {
767  return d->m_visualCategory;
768 }
769 
770 void GeoDataFeature::setVisualCategory( GeoDataFeature::GeoDataVisualCategory index )
771 {
772  detach();
773  d->m_visualCategory = index;
774 }
775 
776 const QString GeoDataFeature::role() const
777 {
778  return d->m_role;
779 }
780 
781 void GeoDataFeature::setRole( const QString &role )
782 {
783  detach();
784  d->m_role = role;
785 }
786 
787 const GeoDataStyleMap* GeoDataFeature::styleMap() const
788 {
789  return d->m_styleMap;
790 }
791 
792 void GeoDataFeature::setStyleMap( const GeoDataStyleMap* styleMap )
793 {
794  d->m_styleMap = styleMap;
795 }
796 
797 int GeoDataFeature::zoomLevel() const
798 {
799  return d->m_zoomLevel;
800 }
801 
802 void GeoDataFeature::setZoomLevel( int zoomLevel )
803 {
804  detach();
805  d->m_zoomLevel = zoomLevel;
806 }
807 
808 qint64 GeoDataFeature::popularity() const
809 {
810  return d->m_popularity;
811 }
812 
813 void GeoDataFeature::setPopularity( qint64 popularity )
814 {
815  detach();
816  d->m_popularity = popularity;
817 }
818 
819 void GeoDataFeature::resetDefaultStyles()
820 {
821  GeoDataFeaturePrivate::s_defaultStyleInitialized = false;
822 }
823 
824 void GeoDataFeature::detach()
825 {
826 #if QT_VERSION < 0x050000
827  if(d->ref == 1)
828 #else
829  if(d->ref.load() == 1)
830 #endif
831  return;
832 
833  GeoDataFeaturePrivate* new_d = d->copy();
834 
835  if (!d->ref.deref()) {
836  delete d;
837  }
838 
839  d = new_d;
840 
841  d->ref.ref();
842 }
843 
844 void GeoDataFeature::pack( QDataStream& stream ) const
845 {
846  GeoDataObject::pack( stream );
847 
848  stream << d->m_name;
849  stream << d->m_address;
850  stream << d->m_phoneNumber;
851  stream << d->m_description;
852  stream << d->m_visible;
853 // stream << d->m_visualCategory;
854  stream << d->m_role;
855  stream << d->m_popularity;
856  stream << d->m_zoomLevel;
857 }
858 
859 void GeoDataFeature::unpack( QDataStream& stream )
860 {
861  detach();
862  GeoDataObject::unpack( stream );
863 
864  stream >> d->m_name;
865  stream >> d->m_address;
866  stream >> d->m_phoneNumber;
867  stream >> d->m_description;
868  stream >> d->m_visible;
869 // stream >> (int)d->m_visualCategory;
870  stream >> d->m_role;
871  stream >> d->m_popularity;
872  stream >> d->m_zoomLevel;
873 }
874 
875 GeoDataFeature::GeoDataVisualCategory GeoDataFeature::OsmVisualCategory(const QString &keyValue )
876 {
877  if( GeoDataFeaturePrivate::s_visualCategories.isEmpty() ) {
878  GeoDataFeaturePrivate::initializeOsmVisualCategories();
879  }
880  return GeoDataFeaturePrivate::s_visualCategories.value( keyValue );
881 }
882 
883 void GeoDataFeaturePrivate::initializeOsmVisualCategories()
884 {
885  s_visualCategories["admin_level=1"] = GeoDataFeature::OtherTerrain;
886  s_visualCategories["admin_level=2"] = GeoDataFeature::OtherTerrain;
887  s_visualCategories["admin_level=3"] = GeoDataFeature::OtherTerrain;
888  s_visualCategories["admin_level=4"] = GeoDataFeature::OtherTerrain;
889  s_visualCategories["admin_level=5"] = GeoDataFeature::OtherTerrain;
890  s_visualCategories["admin_level=6"] = GeoDataFeature::OtherTerrain;
891  s_visualCategories["admin_level=7"] = GeoDataFeature::OtherTerrain;
892  s_visualCategories["admin_level=8"] = GeoDataFeature::OtherTerrain;
893 
894  s_visualCategories["amenity=restaurant"] = GeoDataFeature::FoodRestaurant;
895  s_visualCategories["amenity=fast_food"] = GeoDataFeature::FoodFastFood;
896  s_visualCategories["amenity=pub"] = GeoDataFeature::FoodPub;
897  s_visualCategories["amenity=bar"] = GeoDataFeature::FoodBar;
898  s_visualCategories["amenity=cafe"] = GeoDataFeature::FoodCafe;
899  s_visualCategories["amenity=biergarten"] = GeoDataFeature::FoodBiergarten;
900  s_visualCategories["amenity=school"] = GeoDataFeature::EducationSchool;
901  s_visualCategories["amenity=college"] = GeoDataFeature::EducationCollege;
902  s_visualCategories["amenity=library"] = GeoDataFeature::AmenityLibrary;
903  s_visualCategories["amenity=university"] = GeoDataFeature::EducationUniversity;
904  s_visualCategories["amenity=bus_station"] = GeoDataFeature::TransportBusStation;
905  s_visualCategories["amenity=car_sharing"] = GeoDataFeature::TransportCarShare;
906  s_visualCategories["amenity=fuel"] = GeoDataFeature::TransportFuel;
907  s_visualCategories["amenity=parking"] = GeoDataFeature::TransportParking;
908  s_visualCategories["amenity=bank"] = GeoDataFeature::MoneyBank;
909  s_visualCategories["amenity=pharmacy"] = GeoDataFeature::HealthPharmacy;
910  s_visualCategories["amenity=hospital"] = GeoDataFeature::HealthHospital;
911  s_visualCategories["amenity=doctors"] = GeoDataFeature::HealthDoctors;
912  s_visualCategories["amenity=cinema"] = GeoDataFeature::TouristCinema;
913  s_visualCategories["amenity=theatre"] = GeoDataFeature::TouristTheatre;
914  s_visualCategories["amenity=place_of_worship"] = GeoDataFeature::ReligionPlaceOfWorship;
915 
916  //FIXME: alcohol != beverages
917  s_visualCategories["shop=alcohol"] = GeoDataFeature::ShoppingBeverages;
918  s_visualCategories["shop=hifi"] = GeoDataFeature::ShoppingHifi;
919  s_visualCategories["shop=supermarket"] = GeoDataFeature::ShoppingSupermarket;
920 
921  s_visualCategories["religion"] = GeoDataFeature::ReligionPlaceOfWorship;
922  s_visualCategories["religion=bahai"] = GeoDataFeature::ReligionBahai;
923  s_visualCategories["religion=buddhist"] = GeoDataFeature::ReligionBuddhist;
924  s_visualCategories["religion=christian"] = GeoDataFeature::ReligionChristian;
925  s_visualCategories["religion=hindu"] = GeoDataFeature::ReligionHindu;
926  s_visualCategories["religion=jain"] = GeoDataFeature::ReligionJain;
927  s_visualCategories["religion=jewish"] = GeoDataFeature::ReligionJewish;
928  s_visualCategories["religion=shinto"] = GeoDataFeature::ReligionShinto;
929  s_visualCategories["religion=sikh"] = GeoDataFeature::ReligionSikh;
930 
931  s_visualCategories["tourism=attraction"] = GeoDataFeature::TouristAttraction;
932  s_visualCategories["tourism=camp_site"] = GeoDataFeature::AccomodationCamping;
933  s_visualCategories["tourism=hostel"] = GeoDataFeature::AccomodationHostel;
934  s_visualCategories["tourism=hotel"] = GeoDataFeature::AccomodationHotel;
935  s_visualCategories["tourism=motel"] = GeoDataFeature::AccomodationMotel;
936  s_visualCategories["tourism=museum"] = GeoDataFeature::TouristMuseum;
937  s_visualCategories["tourism=theme_park"] = GeoDataFeature::TouristThemePark;
938  s_visualCategories["tourism=viewpoint"] = GeoDataFeature::TouristViewPoint;
939  s_visualCategories["tourism=zoo"] = GeoDataFeature::TouristZoo;
940 
941  s_visualCategories["historic=castle"] = GeoDataFeature::TouristCastle;
942  s_visualCategories["historic=fort"] = GeoDataFeature::TouristCastle;
943  s_visualCategories["historic=monument"] = GeoDataFeature::TouristMonument;
944  s_visualCategories["historic=ruins"] = GeoDataFeature::TouristRuin;
945 
946 
947  s_visualCategories["highway"] = GeoDataFeature::HighwayUnknown;
948  s_visualCategories["highway=steps"] = GeoDataFeature::HighwaySteps;
949  s_visualCategories["highway=footway"] = GeoDataFeature::HighwayPedestrian;
950  s_visualCategories["highway=path"] = GeoDataFeature::HighwayPath;
951  s_visualCategories["highway=track"] = GeoDataFeature::HighwayTrack;
952  s_visualCategories["highway=pedestrian"] = GeoDataFeature::HighwayPedestrian;
953  s_visualCategories["highway=service"] = GeoDataFeature::HighwayService;
954  s_visualCategories["highway=living_street"] = GeoDataFeature::HighwayRoad;
955  s_visualCategories["highway=unclassified"] = GeoDataFeature::HighwayRoad;
956  s_visualCategories["highway=residential"] = GeoDataFeature::HighwayRoad;
957  s_visualCategories["highway=tertiary_link"] = GeoDataFeature::HighwayTertiaryLink;
958  s_visualCategories["highway=tertiary"] = GeoDataFeature::HighwayTertiary;
959  s_visualCategories["highway=secondary_link"] = GeoDataFeature::HighwaySecondaryLink;
960  s_visualCategories["highway=secondary"] = GeoDataFeature::HighwaySecondary;
961  s_visualCategories["highway=primary_link"] = GeoDataFeature::HighwayPrimaryLink;
962  s_visualCategories["highway=primary"] = GeoDataFeature::HighwayPrimary;
963  s_visualCategories["highway=trunk_link"] = GeoDataFeature::HighwayTrunkLink;
964  s_visualCategories["highway=trunk"] = GeoDataFeature::HighwayTrunk;
965  s_visualCategories["highway=motorway_link"] = GeoDataFeature::HighwayMotorwayLink;
966  s_visualCategories["highway=motorway"] = GeoDataFeature::HighwayMotorway;
967  s_visualCategories["highway=bus_stop"] = GeoDataFeature::TransportBusStop;
968 
969 
970  s_visualCategories["natural=water"] = GeoDataFeature::NaturalWater;
971  s_visualCategories["waterway=stream"] = GeoDataFeature::NaturalWater;
972  s_visualCategories["waterway=river"] = GeoDataFeature::NaturalWater;
973  s_visualCategories["waterway=riverbank"] = GeoDataFeature::NaturalWater;
974  s_visualCategories["waterway=canal"] = GeoDataFeature::NaturalWater;
975 
976  s_visualCategories["natural=wood"] = GeoDataFeature::NaturalWood;
977 
978  s_visualCategories["landuse=forest"] = GeoDataFeature::NaturalWood;
979  s_visualCategories["landuse=allotments"] = GeoDataFeature::LanduseAllotments;
980  s_visualCategories["landuse=basin"] = GeoDataFeature::LanduseBasin;
981  s_visualCategories["landuse=brownfield"] = GeoDataFeature::LanduseConstruction;
982  s_visualCategories["landuse=cemetery"] = GeoDataFeature::LanduseCemetery;
983  s_visualCategories["landuse=commercial"] = GeoDataFeature::LanduseCommercial;
984  s_visualCategories["landuse=construction"] = GeoDataFeature::LanduseConstruction;
985  s_visualCategories["landuse=farm"] = GeoDataFeature::LanduseFarmland;
986  s_visualCategories["landuse=farmland"] = GeoDataFeature::LanduseFarmland;
987  s_visualCategories["landuse=farmyard"] = GeoDataFeature::LanduseFarmyard;
988  s_visualCategories["landuse=garages"] = GeoDataFeature::LanduseGarages;
989  s_visualCategories["landuse=greenfield"] = GeoDataFeature::LanduseConstruction;
990  s_visualCategories["landuse=industrial"] = GeoDataFeature::LanduseIndustrial;
991  s_visualCategories["landuse=landfill"] = GeoDataFeature::LanduseLandfill;
992  s_visualCategories["landuse=meadow"] = GeoDataFeature::LanduseMeadow;
993  s_visualCategories["landuse=military"] = GeoDataFeature::LanduseMilitary;
994  s_visualCategories["landuse=orchard"] = GeoDataFeature::LanduseFarmland;
995  s_visualCategories["landuse=quarry"] = GeoDataFeature::LanduseQuarry;
996  s_visualCategories["landuse=railway"] = GeoDataFeature::LanduseRailway;
997  s_visualCategories["landuse=reservoir"] = GeoDataFeature::LanduseReservoir;
998  s_visualCategories["landuse=residential"] = GeoDataFeature::LanduseResidential;
999  s_visualCategories["landuse=retail"] = GeoDataFeature::LanduseRetail;
1000 
1001  s_visualCategories["leisure=park"] = GeoDataFeature::LeisurePark;
1002  s_visualCategories["leisure=pitch"] = GeoDataFeature::LeisurePark;
1003  s_visualCategories["leisure=playgound"] = GeoDataFeature::LeisurePark;
1004 
1005  s_visualCategories["railway=rail"] = GeoDataFeature::RailwayRail;
1006  s_visualCategories["railway=tram"] = GeoDataFeature::RailwayTram;
1007  s_visualCategories["railway=light_rail"] = GeoDataFeature::RailwayLightRail;
1008  s_visualCategories["railway=preserved"] = GeoDataFeature::RailwayPreserved;
1009  s_visualCategories["railway=abandoned"] = GeoDataFeature::RailwayAbandoned;
1010  s_visualCategories["railway=disused"] = GeoDataFeature::RailwayAbandoned;
1011  s_visualCategories["railway=subway"] = GeoDataFeature::RailwaySubway;
1012  s_visualCategories["railway=miniature"] = GeoDataFeature::RailwayMiniature;
1013  s_visualCategories["railway=construction"] = GeoDataFeature::RailwayConstruction;
1014  s_visualCategories["railway=monorail"] = GeoDataFeature::RailwayMonorail;
1015  s_visualCategories["railway=funicular"] = GeoDataFeature::RailwayFunicular;
1016  s_visualCategories["railway=station"] = GeoDataFeature::TransportTrainStation;
1017 
1018  s_visualCategories["transport=aerodrome"] = GeoDataFeature::TransportAerodrome;
1019  s_visualCategories["transport=airpor_terminal"] = GeoDataFeature::TransportAirportTerminal;
1020  s_visualCategories["transport=bus_station"] = GeoDataFeature::TransportBusStation;
1021  s_visualCategories["transport=bus_stop"] = GeoDataFeature::TransportBusStop;
1022  s_visualCategories["transport=car_share"] = GeoDataFeature::TransportCarShare;
1023  s_visualCategories["transport=fuel"] = GeoDataFeature::TransportFuel;
1024  s_visualCategories["transport=parking"] = GeoDataFeature::TransportParking;
1025  s_visualCategories["transport=rental_bicycle"] = GeoDataFeature::TransportRentalBicycle;
1026  s_visualCategories["transport=rental_car"] = GeoDataFeature::TransportRentalCar;
1027  s_visualCategories["transport=taxi_rank"] = GeoDataFeature::TransportTaxiRank;
1028  s_visualCategories["transport=train_station"] = GeoDataFeature::TransportTrainStation;
1029  s_visualCategories["transport=tram_stop"] = GeoDataFeature::TransportTramStop;
1030 
1031  s_visualCategories["place=city"] = GeoDataFeature::LargeCity;
1032  s_visualCategories["place=hamlet"] = GeoDataFeature::SmallCity;
1033  s_visualCategories["place=locality"] = GeoDataFeature::SmallCity;
1034  s_visualCategories["place=town"] = GeoDataFeature::BigCity;
1035  s_visualCategories["place=village"] = GeoDataFeature::MediumCity;
1036 
1037  // Default for buildings
1038  s_visualCategories["building=yes"] = GeoDataFeature::Building;
1039 
1040 }
1041 
1042 }
GeoDataDocument.h
Marble::GeoDataFeature::TouristAttraction
Definition: GeoDataFeature.h:199
Marble::GeoDataFeature::LastIndex
Definition: GeoDataFeature.h:271
Marble::GeoDataFeature::customStyle
const GeoDataStyle * customStyle() const
Return the style assigned to the placemark with setStyle (can be 0)
Definition: GeoDataFeature.cpp:730
Marble::GeoDataFeature::TransportTrainStation
Definition: GeoDataFeature.h:221
Marble::GeoDataFeature::RailwaySubway
Definition: GeoDataFeature.h:260
Marble::GeoDataFeature::OsmVisualCategory
static GeoDataVisualCategory OsmVisualCategory(const QString &keyValue)
Convenience categorization of placemarks for Osm key=value pairs.
Definition: GeoDataFeature.cpp:875
Marble::GeoDataFeature::LargeCountyCapital
Definition: GeoDataFeature.h:97
Marble::GeoDataFeaturePrivate::initializeDefaultStyles
static void initializeDefaultStyles()
Definition: GeoDataFeature.cpp:168
Marble::GeoDataFeature::HighwayMotorwayLink
Definition: GeoDataFeature.h:155
Marble::GeoDataFeature::FoodPub
Definition: GeoDataFeature.h:181
Marble::GeoDataFeature::TransportCarShare
Definition: GeoDataFeature.h:215
Marble::GeoDataAbstractView
Definition: GeoDataAbstractView.h:30
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:65
Marble::GeoDataTimeStamp
Definition: GeoDataTimeStamp.h:27
Marble::GeoDataFeature::AccomodationCamping
Definition: GeoDataFeature.h:162
Marble::GeoDataFeature::HighwayMotorway
Definition: GeoDataFeature.h:156
Marble::GeoDataFeature::TransportTramStop
Definition: GeoDataFeature.h:222
Marble::GeoDataFeature::LanduseReservoir
Definition: GeoDataFeature.h:252
Marble::GeoDataFeaturePrivate::s_defaultStyleInitialized
static bool s_defaultStyleInitialized
Definition: GeoDataFeature_p.h:218
Marble::GeoDataTypes::GeoDataLookAtType
const char * GeoDataLookAtType
Definition: GeoDataTypes.cpp:58
Marble::GeoDataDocument::styleMap
GeoDataStyleMap & styleMap(const QString &styleId)
Return a style in the style storage.
Definition: GeoDataDocument.cpp:179
Marble::GeoDataFeature::ReligionHindu
Definition: GeoDataFeature.h:229
Marble::MarbleDirs::path
static QString path(const QString &relativePath)
Definition: MarbleDirs.cpp:59
Marble::GeoDataFeature::RailwayMiniature
Definition: GeoDataFeature.h:262
Marble::GeoDataFeature::HighwayPedestrian
Definition: GeoDataFeature.h:144
Marble::GeoDataFeature::Continent
Definition: GeoDataFeature.h:107
Marble::GeoDataFeature::MediumStateCapital
Definition: GeoDataFeature.h:90
Marble::GeoDataFeature::TransportTaxiRank
Definition: GeoDataFeature.h:220
Marble::GeoDataFeature::HighwayTertiaryLink
Definition: GeoDataFeature.h:147
Marble::GeoDataFeature::Unknown
Definition: GeoDataFeature.h:80
Marble::GeoDataFeature::Mons
Definition: GeoDataFeature.h:105
GeoDataContainer.h
Marble::GeoDataFeature::SmallNationCapital
Definition: GeoDataFeature.h:87
Marble::GeoDataFeature::role
const QString role() const
Return the role of the placemark.
Definition: GeoDataFeature.cpp:776
Marble::GeoDataFeature::TouristViewPoint
Definition: GeoDataFeature.h:207
Marble::GeoDataFeature::setVisualCategory
void setVisualCategory(GeoDataVisualCategory category)
Sets the symbol index of the placemark.
Definition: GeoDataFeature.cpp:770
Marble::GeoDataFeature::featureId
EnumFeatureId featureId() const
Definition: GeoDataFeature.cpp:163
QDataStream
Marble::GeoDataFeature::OsmSite
Definition: GeoDataFeature.h:124
Marble::GeoDataFeaturePrivate::m_name
QString m_name
Definition: GeoDataFeature_p.h:184
Marble::GeoDataFeature::Default
Definition: GeoDataFeature.h:79
Marble::GeoDataFeaturePrivate::m_role
QString m_role
Definition: GeoDataFeature_p.h:199
QFont
Marble::defaultSize
static const int defaultSize
Definition: GeoDataLabelStyle.cpp:23
Marble::GeoDataFeature::defaultLabelColor
static QColor defaultLabelColor()
Definition: GeoDataFeature.cpp:533
Marble::GeoDataObject
A base class for all geodata objects.
Definition: GeoDataObject.h:48
Marble::GeoDataFeature::Folder
Definition: GeoDataFeature.h:133
Marble::GeoDataFeature::setDescription
void setDescription(const QString &value)
Set the description of this feature to value.
Definition: GeoDataFeature.cpp:593
Marble::GeoDataFeature::HighwayRoad
Definition: GeoDataFeature.h:146
Marble::GeoDataFeature::Mountain
Definition: GeoDataFeature.h:103
QMap
Marble::GeoDataFeature::setExtendedData
void setExtendedData(const GeoDataExtendedData &extendedData)
Sets the ExtendedData of the feature.
Definition: GeoDataFeature.cpp:748
Marble::GeoDataTypes::GeoDataDocumentType
const char * GeoDataDocumentType
Definition: GeoDataTypes.cpp:38
Marble::GeoDataFeature::RailwayLightRail
Definition: GeoDataFeature.h:258
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
QFont::setUnderline
void setUnderline(bool enable)
Marble::GeoDataObject::parent
virtual GeoDataObject * parent() const
Provides the parent of the object in GeoDataContainers.
Definition: GeoDataObject.cpp:65
Marble::GeoDataFeature::HealthHospital
Definition: GeoDataFeature.h:186
Marble::GeoDataFeature::equals
bool equals(const GeoDataFeature &other) const
Definition: GeoDataFeature.cpp:94
GeoDataStyle.h
Marble::GeoDataFeature::isVisible
bool isVisible() const
Return whether this feature is visible or not.
Definition: GeoDataFeature.cpp:656
Marble::GeoDataObject::pack
virtual void pack(QDataStream &stream) const
Reimplemented from Serializable.
Definition: GeoDataObject.cpp:114
Marble::GeoDataFeature::Crater
Definition: GeoDataFeature.h:112
Marble::GeoDataFeature::HighwayUnknown
Definition: GeoDataFeature.h:141
QAtomicInt::ref
bool ref()
Marble::GeoDataContainer
A base class that can hold GeoDataFeatures.
Definition: GeoDataContainer.h:47
Marble::GeoDataFeature::description
QString description() const
Return the text description of the feature.
Definition: GeoDataFeature.cpp:588
Marble::GeoDataCamera
Definition: GeoDataCamera.h:22
Marble::GeoDataFeaturePrivate::m_region
GeoDataRegion m_region
Definition: GeoDataFeature_p.h:209
Marble::GeoDataFeature::style
const GeoDataStyle * style() const
Return the style assigned to the placemark, or a default style if none has been set.
Definition: GeoDataFeature.cpp:709
Marble::GeoDataFeature::RailwayFunicular
Definition: GeoDataFeature.h:265
Marble::GeoDataFeaturePrivate::m_timeSpan
GeoDataTimeSpan m_timeSpan
Definition: GeoDataFeature_p.h:206
Marble::GeoDataFeature::ReligionPlaceOfWorship
Definition: GeoDataFeature.h:225
Marble::GeoDataFeature::zoomLevel
int zoomLevel() const
Return the popularity index of the placemark.
Definition: GeoDataFeature.cpp:797
Marble::GeoDataFeature::setSnippet
void setSnippet(const GeoDataSnippet &value)
Set a new name for this feature.
Definition: GeoDataFeature.cpp:560
Marble::GeoDataStyleMap
a class to map different styles to one style
Definition: GeoDataStyleMap.h:38
Marble::GeoDataFeature::setPhoneNumber
void setPhoneNumber(const QString &value)
Set the phone number of this feature to value.
Definition: GeoDataFeature.cpp:582
Marble::GeoDataFeature::OtherTerrain
Definition: GeoDataFeature.h:109
Marble::GeoDataFeature::ShoppingBeverages
Definition: GeoDataFeature.h:194
Marble::GeoDataFeature::Coordinate
Definition: GeoDataFeature.h:125
Marble::GeoDataFeaturePrivate::m_style
const GeoDataStyle * m_style
Definition: GeoDataFeature_p.h:201
Marble::GeoDataFeature::styleUrl
QString styleUrl() const
Return the styleUrl of the feature.
Definition: GeoDataFeature.cpp:626
Marble::GeoDataFeature::AmenityLibrary
Definition: GeoDataFeature.h:169
Marble::GeoDataFeature::Valley
Definition: GeoDataFeature.h:106
Marble::GeoDataFeature::ReligionBuddhist
Definition: GeoDataFeature.h:227
QString::remove
QString & remove(int position, int n)
Marble::GeoDataFeature::Bookmark
Definition: GeoDataFeature.h:134
Marble::GeoDataFeature::pack
virtual void pack(QDataStream &stream) const
Serialize the contents of the feature to stream.
Definition: GeoDataFeature.cpp:844
Marble::GeoDataFeaturePrivate::m_timeStamp
GeoDataTimeStamp m_timeStamp
Definition: GeoDataFeature_p.h:207
Marble::GeoDataFeature::AirPort
Definition: GeoDataFeature.h:119
Marble::GeoDataFeature::Nation
Definition: GeoDataFeature.h:100
MarbleDebug.h
Marble::GeoDataFeature::AccomodationMotel
Definition: GeoDataFeature.h:165
Marble::GeoDataFeature::ReligionJain
Definition: GeoDataFeature.h:230
Marble::GeoDataFeature::Wikipedia
Definition: GeoDataFeature.h:123
Marble::GeoDataFeature::RailwayPreserved
Definition: GeoDataFeature.h:261
Marble::GeoDataExtendedData
a class which allows to add custom data to KML Feature.
Definition: GeoDataExtendedData.h:35
Marble::GeoDataFeature::AccomodationYouthHostel
Definition: GeoDataFeature.h:166
Marble::GeoDataObject::nodeType
virtual const char * nodeType() const =0
Provides type information for downcasting a GeoNode.
Marble::GeoDataFeature::HighwayTrack
Definition: GeoDataFeature.h:143
Marble::GeoDataFeature::LargeStateCapital
Definition: GeoDataFeature.h:98
Marble::GeoDataFeature::popularity
qint64 popularity() const
Return the popularity of the feature.
Definition: GeoDataFeature.cpp:808
GeoDataCamera.h
Marble::GeoDataObject::setParent
virtual void setParent(GeoDataObject *parent)
Sets the parent of the object.
Definition: GeoDataObject.cpp:70
Marble::GeoDataFeature::LanduseQuarry
Definition: GeoDataFeature.h:250
QFont::setBold
void setBold(bool enable)
Marble::GeoDataFeaturePrivate::m_phoneNumber
QString m_phoneNumber
Definition: GeoDataFeature_p.h:189
Marble::GeoDataFeature::SmallStateCapital
Definition: GeoDataFeature.h:86
Marble::GeoDataFeature::HighwaySteps
Definition: GeoDataFeature.h:140
Marble::GeoDataFeature::abstractView
const GeoDataAbstractView * abstractView() const
Get the Abstract view of the feature.
Definition: GeoDataFeature.cpp:610
Marble::GeoDataFeature::MediumCountyCapital
Definition: GeoDataFeature.h:89
Marble::GeoDataFeature::LanduseBasin
Definition: GeoDataFeature.h:238
Marble::GeoDataFeature::styleMap
const GeoDataStyleMap * styleMap() const
Return a pointer to a GeoDataStyleMap object which represents the styleMap of this feature...
Definition: GeoDataFeature.cpp:787
Marble::GeoDataFeaturePrivate::m_styleUrl
QString m_styleUrl
Definition: GeoDataFeature_p.h:190
Marble::GeoDataFeature::LanduseMeadow
Definition: GeoDataFeature.h:248
Marble::GeoDataFeature::MoneyBank
Definition: GeoDataFeature.h:191
Marble::GeoDataFeature::FoodCafe
Definition: GeoDataFeature.h:179
Marble::GeoDataStyle
an addressable style group
Definition: GeoDataStyle.h:55
Marble::GeoDataFeature::AccomodationHostel
Definition: GeoDataFeature.h:163
GeoDataFeature.h
Marble::GeoDataFeature::LanduseResidential
Definition: GeoDataFeature.h:253
GeoDataRegion.h
Marble::GeoDataFeature::setPopularity
void setPopularity(qint64 popularity)
Sets the popularity of the feature.
Definition: GeoDataFeature.cpp:813
Marble::GeoDataFeature::setTimeStamp
void setTimeStamp(const GeoDataTimeStamp &timeStamp)
Set the timestamp of the feature.
Definition: GeoDataFeature.cpp:703
Marble::GeoDataFeaturePrivate
Definition: GeoDataFeature_p.h:31
Marble::GeoDataFeaturePrivate::m_description
QString m_description
Definition: GeoDataFeature_p.h:186
Marble::GeoDataFeature::HighwayTertiary
Definition: GeoDataFeature.h:148
Marble::GeoDataFeature::HighwayPrimary
Definition: GeoDataFeature.h:152
Marble::GeoDataFeature::descriptionIsCDATA
bool descriptionIsCDATA() const
test if the description is CDATA or not CDATA allows for special characters to be included in XML and...
Definition: GeoDataFeature.cpp:599
Marble::GeoDataFeaturePrivate::m_abstractView
GeoDataAbstractView * m_abstractView
Definition: GeoDataFeature_p.h:191
Marble::GeoDataFeature::MannedLandingSite
Definition: GeoDataFeature.h:128
Marble::GeoDataFeature::setName
void setName(const QString &value)
Set a new name for this feature.
Definition: GeoDataFeature.cpp:549
Marble::GeoDataFeature::ReligionShinto
Definition: GeoDataFeature.h:232
GeoDataFeature_p.h
Marble::GeoDataFeaturePrivate::initializeOsmVisualCategories
static void initializeOsmVisualCategories()
Definition: GeoDataFeature.cpp:883
Marble::GeoDataFeature::Volcano
Definition: GeoDataFeature.h:104
Marble::GeoDataFeature::TransportAerodrome
Definition: GeoDataFeature.h:211
Marble::GeoDataFeature::AccomodationHotel
Definition: GeoDataFeature.h:164
Marble::GeoDataFeature::Ocean
Definition: GeoDataFeature.h:108
Marble::GeoDataFeature::HighwayTrunk
Definition: GeoDataFeature.h:154
Marble::GeoDataFeature::timeSpan
const GeoDataTimeSpan & timeSpan() const
Return the timespan of the feature.
Definition: GeoDataFeature.cpp:677
Marble::GeoDataFeature::RailwayTram
Definition: GeoDataFeature.h:257
Marble::GeoDataFeature::region
GeoDataRegion & region() const
Return the region assigned to the placemark.
Definition: GeoDataFeature.cpp:754
MarbleDirs.h
Marble::GeoDataFeature::RailwayRail
Definition: GeoDataFeature.h:256
Marble::GeoDataLabelStyle::setFont
void setFont(const QFont &font)
Set the font of the label.
Definition: GeoDataLabelStyle.cpp:128
Marble::GeoDataFeature::TransportBusStation
Definition: GeoDataFeature.h:213
Marble::GeoDataFeaturePrivate::s_defaultStyle
static GeoDataStyle * s_defaultStyle[GeoDataFeature::LastIndex]
Definition: GeoDataFeature_p.h:217
Marble::GeoDataFeature::unpack
virtual void unpack(QDataStream &stream)
Unserialize the contents of the feature from stream.
Definition: GeoDataFeature.cpp:859
Marble::GeoDataFeature::TransportRentalBicycle
Definition: GeoDataFeature.h:218
Marble::GeoDataFeaturePrivate::featureId
virtual EnumFeatureId featureId() const
Definition: GeoDataFeature_p.h:113
Marble::GeoDataFeature::resetDefaultStyles
static void resetDefaultStyles()
Return the label font of the placemark.
Definition: GeoDataFeature.cpp:819
Marble::GeoDataFeaturePrivate::m_snippet
GeoDataSnippet m_snippet
Definition: GeoDataFeature_p.h:185
Marble::GeoDataFeature::TouristCinema
Definition: GeoDataFeature.h:201
Marble::GeoDataFeaturePrivate::nodeType
virtual const char * nodeType() const
Definition: GeoDataFeature_p.h:122
Marble::GeoDataFeature::phoneNumber
QString phoneNumber() const
Return the phone number of the feature.
Definition: GeoDataFeature.cpp:577
Marble::GeoDataFeaturePrivate::s_defaultLabelColor
static QColor s_defaultLabelColor
Definition: GeoDataFeature_p.h:215
Marble::GeoDataFeature::setDefaultLabelColor
static void setDefaultLabelColor(const QColor &color)
Definition: GeoDataFeature.cpp:538
Marble::GeoDataFeature::LanduseIndustrial
Definition: GeoDataFeature.h:246
Marble::GeoDataFeature::HealthDoctors
Definition: GeoDataFeature.h:185
Marble::GeoDataFeature::ShoppingSupermarket
Definition: GeoDataFeature.h:196
Marble::GeoDataFeaturePrivate::createOsmPOIStyle
static GeoDataStyle * createOsmPOIStyle(const QFont &font, const QString &bitmap, const QColor &color=QColor(0xBE, 0xAD, 0xAD), const QColor &outline=QColor(0xBE, 0xAD, 0xAD).darker())
Definition: GeoDataFeature_p.h:130
Marble::GeoDataFeature::d
GeoDataFeaturePrivate * d
Definition: GeoDataFeature.h:506
Marble::GeoDataFeature::FoodFastFood
Definition: GeoDataFeature.h:180
Marble::GeoDataFeature::LanduseAllotments
Definition: GeoDataFeature.h:237
QString
QColor
Marble::GeoDataFeature::TouristRuin
Definition: GeoDataFeature.h:204
Marble::GeoDataFeature::RailwayConstruction
Definition: GeoDataFeature.h:263
GeoDataPlacemark.h
Marble::GeoDataFeature::ReligionBahai
Definition: GeoDataFeature.h:226
Marble::GeoDataFeature::LanduseGrass
Definition: GeoDataFeature.h:245
Marble::GeoDataFeature::NaturalWood
Definition: GeoDataFeature.h:137
QAtomicInt::deref
bool deref()
GeoDataStyleMap.h
Marble::GeoDataFeature::isGloballyVisible
bool isGloballyVisible() const
Return whether this feature is visible or not in the context of its parenting.
Definition: GeoDataFeature.cpp:667
Marble::GeoDataFeature::NaturalWater
Definition: GeoDataFeature.h:136
Marble::GeoDataFeature::MediumNationCapital
Definition: GeoDataFeature.h:91
Marble::GeoDataFeature::TransportFuel
Definition: GeoDataFeature.h:216
Marble::GeoDataFeaturePrivate::m_extendedData
GeoDataExtendedData m_extendedData
Definition: GeoDataFeature_p.h:204
Marble::GeoDataFeature::BigCity
Definition: GeoDataFeature.h:92
Marble::GeoDataFeature::setStyleUrl
void setStyleUrl(const QString &value)
Set the styleUrl of this feature to value.
Definition: GeoDataFeature.cpp:631
Marble::GeoDataFeature::setDefaultFont
static void setDefaultFont(const QFont &font)
Definition: GeoDataFeature.cpp:527
Marble::GeoDataFeaturePrivate::m_visualCategory
GeoDataFeature::GeoDataVisualCategory m_visualCategory
Definition: GeoDataFeature_p.h:196
Marble::GeoDataLabelStyle::Center
Definition: GeoDataLabelStyle.h:39
Marble::GeoDataFeaturePrivate::createHighwayStyle
static GeoDataStyle * createHighwayStyle(const QString &bitmap, const QColor &color, qreal width=1, qreal realWidth=0.0, Qt::PenStyle penStyle=Qt::SolidLine, Qt::PenCapStyle capStyle=Qt::RoundCap)
Definition: GeoDataFeature_p.h:141
Marble::GeoDataFeature::TouristZoo
Definition: GeoDataFeature.h:208
Marble::GeoDataFeature::LanduseLandfill
Definition: GeoDataFeature.h:247
Marble::GeoDataFeature::MagneticPole
Definition: GeoDataFeature.h:117
Marble::GeoDataFeaturePrivate::ref
QAtomicInt ref
Definition: GeoDataFeature_p.h:211
Marble::GeoDataFeature::setAddress
void setAddress(const QString &value)
Set the address of this feature to value.
Definition: GeoDataFeature.cpp:571
Marble::GeoDataFeature::HighwaySecondary
Definition: GeoDataFeature.h:150
Marble::GeoDataFeature::GeoDataFeature
GeoDataFeature()
Definition: GeoDataFeature.cpp:42
Marble::EnumFeatureId
EnumFeatureId
Definition: Serializable.h:30
QImage
Marble::GeoDataFeature::HighwayTrunkLink
Definition: GeoDataFeature.h:153
Marble::GeoDataLookAt
Definition: GeoDataLookAt.h:23
Marble::GeoDataFeature::LargeCity
Definition: GeoDataFeature.h:96
Marble::GeoDataFeature::snippet
GeoDataSnippet snippet() const
A short description of the feature.
Definition: GeoDataFeature.cpp:555
Marble::GeoDataFeature::LanduseGarages
Definition: GeoDataFeature.h:244
Marble::GeoDataFeature::setTimeSpan
void setTimeSpan(const GeoDataTimeSpan &timeSpan)
Set the timespan of the feature.
Definition: GeoDataFeature.cpp:687
Marble::GeoDataFeature::TouristTheatre
Definition: GeoDataFeature.h:205
Marble::GeoDataFeature::setVisible
void setVisible(bool value)
Set a new value for visibility.
Definition: GeoDataFeature.cpp:661
Marble::GeoDataFeature::ReligionSikh
Definition: GeoDataFeature.h:233
Marble::GeoDataFeature::ReligionJewish
Definition: GeoDataFeature.h:231
Marble::GeoDataFeature::RailwayAbandoned
Definition: GeoDataFeature.h:259
Marble::GeoDataTypes::GeoDataCameraType
const char * GeoDataCameraType
Definition: GeoDataTypes.cpp:31
Marble::GeoDataTimeSpan
Definition: GeoDataTimeSpan.h:28
GeoDataFolder.h
Marble::GeoDataFeaturePrivate::s_visualCategories
static QMap< QString, GeoDataFeature::GeoDataVisualCategory > s_visualCategories
Definition: GeoDataFeature_p.h:220
Marble::GeoDataFeature::BigNationCapital
Definition: GeoDataFeature.h:95
Marble::GeoDataFeature::EducationUniversity
Definition: GeoDataFeature.h:174
Marble::GeoDataFeature::BigCountyCapital
Definition: GeoDataFeature.h:93
Marble::GeoDataFeature::RoboticRover
Definition: GeoDataFeature.h:129
Marble::GeoDataFeature::setStyleMap
void setStyleMap(const GeoDataStyleMap *map)
Sets the styleMap of the feature.
Definition: GeoDataFeature.cpp:792
Marble::GeoDataFeature::visualCategory
GeoDataVisualCategory visualCategory() const
Return the symbol index of the placemark.
Definition: GeoDataFeature.cpp:765
Marble::GeoDataFeature::EducationCollege
Definition: GeoDataFeature.h:172
QVector< qreal >
Marble::GeoDataFeature::FoodBar
Definition: GeoDataFeature.h:177
Marble::GeoDataFeature::address
QString address() const
Return the address of the feature.
Definition: GeoDataFeature.cpp:566
Marble::GeoDataFeature::setDescriptionCDATA
void setDescriptionCDATA(bool cdata)
Set the description to be CDATA See:
Definition: GeoDataFeature.cpp:604
Marble::GeoDataFeaturePrivate::m_popularity
qint64 m_popularity
Definition: GeoDataFeature_p.h:192
Marble::GeoDataFeature::UnmannedHardLandingSite
Definition: GeoDataFeature.h:131
Marble::GeoDataFeature::LanduseCommercial
Definition: GeoDataFeature.h:240
Marble::GeoDataFeaturePrivate::m_styleMap
const GeoDataStyleMap * m_styleMap
Definition: GeoDataFeature_p.h:202
Marble::GeoDataFeature::Building
Definition: GeoDataFeature.h:159
Marble::GeoDataFeature
A base class for all geodata features.
Definition: GeoDataFeature.h:57
Marble::GeoDataFeature::LanduseConstruction
Definition: GeoDataFeature.h:241
Marble::GeoDataFeature::name
QString name() const
The name of the feature.
Definition: GeoDataFeature.cpp:544
QFont::family
QString family() const
Marble::GeoDataObject::operator=
GeoDataObject & operator=(const GeoDataObject &)
Definition: GeoDataObject.cpp:54
Marble::GeoDataFeature::Satellite
Definition: GeoDataFeature.h:267
Marble::GeoDataFeature::GeographicPole
Definition: GeoDataFeature.h:116
Marble::GeoDataFeature::setRegion
void setRegion(const GeoDataRegion &region)
Sets the region of the placemark.
Definition: GeoDataFeature.cpp:759
Marble::GeoDataFeature::ReligionChristian
Definition: GeoDataFeature.h:228
Marble::GeoDataFeature::MediumCity
Definition: GeoDataFeature.h:88
Marble::GeoDataFeature::SmallCountyCapital
Definition: GeoDataFeature.h:85
Marble::GeoDataFeaturePrivate::s_defaultFont
static QFont s_defaultFont
Definition: GeoDataFeature_p.h:214
Marble::GeoDataFeature::LanduseFarmland
Definition: GeoDataFeature.h:242
Marble::GeoDataFeature::TouristCastle
Definition: GeoDataFeature.h:200
Marble::GeoDataFeaturePrivate::m_visible
bool m_visible
Definition: GeoDataFeature_p.h:195
Marble::GeoDataFeature::HighwayPath
Definition: GeoDataFeature.h:142
QFont::setCapitalization
void setCapitalization(Capitalization caps)
Marble::GeoDataFeature::TransportRentalCar
Definition: GeoDataFeature.h:219
Marble::GeoDataFeature::LanduseRetail
Definition: GeoDataFeature.h:254
Marble::GeoDataRegion
GeoDataRegion describes the visibility and extent of a feature.
Definition: GeoDataRegion.h:49
Marble::GeoDataObject::unpack
virtual void unpack(QDataStream &steam)
Reimplemented from Serializable.
Definition: GeoDataObject.cpp:120
Marble::GeoDataFeature::TransportBusStop
Definition: GeoDataFeature.h:214
Marble::GeoDataFeature::setRole
void setRole(const QString &role)
Sets the role of the placemark.
Definition: GeoDataFeature.cpp:781
Marble::GeoDataFeature::UnmannedSoftLandingSite
Definition: GeoDataFeature.h:130
Marble::GeoDataFeature::HighwaySecondaryLink
Definition: GeoDataFeature.h:149
Marble::GeoDataLabelStyle::setAlignment
void setAlignment(GeoDataLabelStyle::Alignment alignment)
Set the alignment of the label.
Definition: GeoDataLabelStyle.cpp:108
Marble::GeoDataFeature::setZoomLevel
void setZoomLevel(int index)
Sets the popularity index of the placemark.
Definition: GeoDataFeature.cpp:802
Marble::GeoDataLabelStyle::font
QFont font() const
Return the current font of the label.
Definition: GeoDataLabelStyle.cpp:133
Marble::GeoDataFeature::setStyle
void setStyle(GeoDataStyle *style)
Sets the style of the placemark.
Definition: GeoDataFeature.cpp:735
Marble::GeoDataSnippet
Definition: GeoDataSnippet.h:20
Marble::GeoDataDocument::style
GeoDataStyle & style(const QString &styleId)
Return a style in the style storage.
Definition: GeoDataDocument.cpp:147
Marble::GeoDataFeature::None
Definition: GeoDataFeature.h:78
Marble::GeoDataFeaturePrivate::m_descriptionCDATA
bool m_descriptionCDATA
Definition: GeoDataFeature_p.h:187
Marble::GeoDataFeature::GeoDataVisualCategory
GeoDataVisualCategory
A categorization of a placemark as defined by ...FIXME.
Definition: GeoDataFeature.h:77
Marble::GeoDataFeature::Observatory
Definition: GeoDataFeature.h:120
Marble::GeoDataFeature::extendedData
GeoDataExtendedData & extendedData() const
Return the ExtendedData assigned to the feature.
Definition: GeoDataFeature.cpp:743
Marble::GeoDataFeature::ShoppingHifi
Definition: GeoDataFeature.h:195
Marble::GeoDataFeature::timeStamp
const GeoDataTimeStamp & timeStamp() const
Return the timestamp of the feature.
Definition: GeoDataFeature.cpp:693
Marble::GeoDataFeature::setAbstractView
void setAbstractView(GeoDataAbstractView *abstractView)
Set the abstract view of the feature.
Definition: GeoDataFeature.cpp:620
Marble::GeoDataFeature::HighwayService
Definition: GeoDataFeature.h:145
Marble::GeoDataFeature::LargeNationCapital
Definition: GeoDataFeature.h:99
Marble::GeoDataFeaturePrivate::createStyle
static GeoDataStyle * createStyle(qreal width, qreal realWidth, const QColor &color, const QColor &outlineColor, bool fill, bool outline, Qt::BrushStyle brushStyle, Qt::PenStyle penStyle, Qt::PenCapStyle capStyle, bool lineBackground, const QVector< qreal > &dashPattern=QVector< qreal >())
Definition: GeoDataFeature_p.h:160
Marble::GeoDataFeature::LeisurePark
Definition: GeoDataFeature.h:235
Marble::GeoDataFeature::defaultFont
static QFont defaultFont()
Definition: GeoDataFeature.cpp:522
Marble::GeoDataFeaturePrivate::copy
virtual GeoDataFeaturePrivate * copy()
Definition: GeoDataFeature_p.h:106
Marble::GeoDataFeature::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoData.
Definition: GeoDataFeature.cpp:158
Marble::GeoDataFeaturePrivate::createWayStyle
static GeoDataStyle * createWayStyle(const QColor &color, const QColor &outlineColor, bool fill=true, bool outline=true, Qt::BrushStyle brushStyle=Qt::SolidPattern)
Definition: GeoDataFeature_p.h:153
QFont::setLetterSpacing
void setLetterSpacing(SpacingType type, qreal spacing)
Marble::GeoDataFeature::~GeoDataFeature
virtual ~GeoDataFeature()
Definition: GeoDataFeature.cpp:68
Marble::GeoDataStyle::labelStyle
GeoDataLabelStyle & labelStyle()
Return the label style of this style.
Definition: GeoDataStyle.cpp:163
Marble::GeoDataFeature::TouristMuseum
Definition: GeoDataFeature.h:203
Marble::GeoDataFeaturePrivate::m_address
QString m_address
Definition: GeoDataFeature_p.h:188
Marble::GeoDataFeature::LanduseFarmyard
Definition: GeoDataFeature.h:243
Marble::GeoDataFeature::TouristMonument
Definition: GeoDataFeature.h:202
Marble::GeoDataFeature::ShipWreck
Definition: GeoDataFeature.h:118
Marble::GeoDataFeaturePrivate::m_zoomLevel
int m_zoomLevel
Definition: GeoDataFeature_p.h:193
Marble::GeoDataFeature::LanduseCemetery
Definition: GeoDataFeature.h:239
Marble::GeoDataFeature::detach
virtual void detach()
Definition: GeoDataFeature.cpp:824
Marble::GeoDataFeature::HealthPharmacy
Definition: GeoDataFeature.h:187
Marble::GeoDataFeature::Mare
Definition: GeoDataFeature.h:113
Marble::GeoDataFeature::LanduseRailway
Definition: GeoDataFeature.h:251
Marble::GeoDataFeature::TransportAirportTerminal
Definition: GeoDataFeature.h:212
Marble::GeoDataFeature::LanduseMilitary
Definition: GeoDataFeature.h:249
Marble::GeoDataFeature::operator=
GeoDataFeature & operator=(const GeoDataFeature &other)
Definition: GeoDataFeature.cpp:80
Marble::GeoDataFeature::HighwayPrimaryLink
Definition: GeoDataFeature.h:151
Marble::GeoDataFeature::EducationSchool
Definition: GeoDataFeature.h:173
Marble::GeoDataFeature::BigStateCapital
Definition: GeoDataFeature.h:94
Marble::GeoDataFeature::FoodBiergarten
Definition: GeoDataFeature.h:178
Marble::GeoDataFeature::FoodRestaurant
Definition: GeoDataFeature.h:182
Marble::GeoDataFeature::TransportParking
Definition: GeoDataFeature.h:217
Marble::GeoDataFeature::TouristThemePark
Definition: GeoDataFeature.h:206
QMap::value
const T value(const Key &key) const
Marble::GeoDataFeature::RailwayMonorail
Definition: GeoDataFeature.h:264
Marble::GeoDataFeature::SmallCity
Definition: GeoDataFeature.h:84
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