diff --git a/src/lib/marble/declarative/Placemark.cpp b/src/lib/marble/declarative/Placemark.cpp index d931b9dfa..608c9634d 100644 --- a/src/lib/marble/declarative/Placemark.cpp +++ b/src/lib/marble/declarative/Placemark.cpp @@ -1,532 +1,238 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2011 Dennis Nienhüser // #include "Placemark.h" #ifdef HAVE_QT5_POSITIONING #include #include #endif // HAVE_QT5_POSITIONING #include #include "GeoDataStyle.h" #include "GeoDataIconStyle.h" namespace Marble { Placemark::Placemark(QObject *parent ) : QObject( parent ) { // nothing to do } void Placemark::setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark ) { m_placemark = placemark; m_address = QString(); m_description = QString(); m_website = QString(); m_wikipedia = QString(); m_fuelDetails = QString(); m_openingHours = QString(); emit coordinatesChanged(); emit nameChanged(); emit descriptionChanged(); emit addressChanged(); emit websiteChanged(); emit wikipediaChanged(); emit openingHoursChanged(); if (m_placemark.visualCategory() == GeoDataFeature::TransportFuel) { emit fuelDetailsChanged(); } } Marble::GeoDataPlacemark & Placemark::placemark() { return m_placemark; } const GeoDataPlacemark &Placemark::placemark() const { return m_placemark; } QString Placemark::name() const { return m_placemark.name(); } QString Placemark::description() const { if (m_description.isEmpty()) { auto const category = m_placemark.visualCategory(); - m_description = categoryName(category); + m_description = m_placemark.categoryName(); if (category >= GeoDataFeature::FoodBar && category <= GeoDataFeature::FoodRestaurant) { addTagValue(m_description, "brand"); addTagValue(m_description, "cuisine"); addTagDescription(m_description, "self_service", "yes", "Self Service"); addTagDescription(m_description, "takeaway", "yes", "Take Away"); addTagDescription(m_description, "outdoor_seating", "yes", "Outdoor Seating"); addTagDescription(m_description, "ice_cream", "yes", "Ice Cream"); addTagDescription(m_description, "smoking", "dedicated", "Smoking (dedicated)"); addTagDescription(m_description, "smoking", "yes", "Smoking allowed"); addTagDescription(m_description, "smoking", "separated", "Smoking (separated)"); addTagDescription(m_description, "smoking", "isolated", "Smoking (isolated)"); addTagDescription(m_description, "smoking", "no", "No smoking"); addTagDescription(m_description, "smoking", "outside", "Smoking (outside)"); addTagDescription(m_description, "smoking:outside", "yes", "Smoking (outside)"); addTagDescription(m_description, "smoking:outside", "separated", "Smoking (outside separated)"); addTagDescription(m_description, "smoking:outside", "no", "No smoking outside"); } else if (category >= GeoDataFeature::ShopBeverages && category <= GeoDataFeature::Shop) { addTagValue(m_description, "operator"); } else if (category == GeoDataFeature::TransportBusStop) { addTagValue(m_description, "network"); addTagValue(m_description, "operator"); addTagValue(m_description, "ref"); } else if (category == GeoDataFeature::TransportCarShare) { addTagValue(m_description, "network"); addTagValue(m_description, "operator"); } else if (category == GeoDataFeature::TransportFuel) { addTagValue(m_description, "brand"); addTagValue(m_description, "operator"); } else if (category == GeoDataFeature::NaturalTree) { addTagValue(m_description, "species:en"); addTagValue(m_description, "genus:en"); addTagValue(m_description, "leaf_type"); } } return m_description; } QString Placemark::address() const { if (m_address.isEmpty()) { m_address = addressFromOsmData(); } return m_address; } QString Placemark::fuelDetails() const { if (m_fuelDetails.isEmpty() && m_placemark.visualCategory() == GeoDataFeature::TransportFuel) { addTagDescription(m_fuelDetails, "fuel:diesel", "yes", tr("Diesel")); addTagDescription(m_fuelDetails, "fuel:octane_91", "yes", tr("Octane 91")); addTagDescription(m_fuelDetails, "fuel:octane_95", "yes", tr("Octane 95")); addTagDescription(m_fuelDetails, "fuel:octane_98", "yes", tr("Octane 98")); addTagDescription(m_fuelDetails, "fuel:e10", "yes", tr("E10")); addTagDescription(m_fuelDetails, "fuel:lpg", "yes", tr("LPG")); } return m_fuelDetails; } QString Placemark::website() const { if (!m_website.isEmpty()) { return m_website; } foreach(const QString &tag, QStringList() << "website" << "contact:website" << "facebook" << "contact:facebook" << "url") { m_website = m_placemark.osmData().tagValue(tag); if (!m_website.isEmpty()) { return m_website; } } return m_website; } QString Placemark::wikipedia() const { if (!m_wikipedia.isEmpty()) { return m_wikipedia; } m_wikipedia = m_placemark.osmData().tagValue("wikipedia"); return m_wikipedia; } QString Placemark::openingHours() const { if (!m_openingHours.isEmpty()) { return m_openingHours; } addTagValue(m_openingHours, "opening_hours"); return m_openingHours; } QString Placemark::coordinates() const { return m_placemark.coordinate().toString(GeoDataCoordinates::Decimal).trimmed(); } void Placemark::setName(const QString & name) { if (m_placemark.name() == name) { return; } m_placemark.setName(name); emit nameChanged(); } double Placemark::longitude() const { return m_placemark.coordinate().longitude(GeoDataCoordinates::Degree); } double Placemark::latitude() const { return m_placemark.coordinate().latitude(GeoDataCoordinates::Degree); } -QString Placemark::categoryName(GeoDataFeature::GeoDataVisualCategory category) const -{ - switch (category) { - case GeoDataFeature::SmallCity: return tr("City"); - case GeoDataFeature::SmallCountyCapital: return tr("County Capital"); - case GeoDataFeature::SmallStateCapital: return tr("State Capital"); - case GeoDataFeature::SmallNationCapital: return tr("Nation Capital"); - case GeoDataFeature::MediumCity: return tr("City"); - case GeoDataFeature::MediumCountyCapital: return tr("County Capital"); - case GeoDataFeature::MediumStateCapital: return tr("State Capital"); - case GeoDataFeature::MediumNationCapital: return tr("Nation Capital"); - case GeoDataFeature::BigCity: return tr("City"); - case GeoDataFeature::BigCountyCapital: return tr("County Capital"); - case GeoDataFeature::BigStateCapital: return tr("State Capital"); - case GeoDataFeature::BigNationCapital: return tr("Nation Capital"); - case GeoDataFeature::LargeCity: return tr("City"); - case GeoDataFeature::LargeCountyCapital: return tr("County Capital"); - case GeoDataFeature::LargeStateCapital: return tr("State Capital"); - case GeoDataFeature::LargeNationCapital: return tr("Nation Capital"); - case GeoDataFeature::Nation: return tr("Nation"); - case GeoDataFeature::PlaceCity: return tr("City"); - case GeoDataFeature::PlaceSuburb: return tr("Suburb"); - case GeoDataFeature::PlaceHamlet: return tr("Hamlet"); - case GeoDataFeature::PlaceLocality: return tr("Locality"); - case GeoDataFeature::PlaceTown: return tr("Town"); - case GeoDataFeature::PlaceVillage: return tr("Village"); - case GeoDataFeature::Mountain: return tr("Mountain"); - case GeoDataFeature::Volcano: return tr("Volcano"); - case GeoDataFeature::Continent: return tr("Continent"); - case GeoDataFeature::Ocean: return tr("Ocean"); - case GeoDataFeature::GeographicPole: return tr("Geographic Pole"); - case GeoDataFeature::MagneticPole: return tr("Magnetic Pole"); - case GeoDataFeature::ShipWreck: return tr("Ship Wreck"); - case GeoDataFeature::AirPort: return tr("Air Port"); - case GeoDataFeature::Observatory: return tr("Observatory"); - case GeoDataFeature::MilitaryDangerArea: return tr("Military Danger Area"); - case GeoDataFeature::OsmSite: return tr("OSM Site"); - case GeoDataFeature::Coordinate: return tr("Coordinate"); - case GeoDataFeature::Folder: return tr("Folder"); - case GeoDataFeature::Bookmark: return tr("Bookmark"); - case GeoDataFeature::NaturalWater: return tr("Water"); - case GeoDataFeature::NaturalReef: return tr("Reef"); - case GeoDataFeature::NaturalWood: return tr("Wood"); - case GeoDataFeature::NaturalBeach: return tr("Beach"); - case GeoDataFeature::NaturalWetland: return tr("Wetland"); - case GeoDataFeature::NaturalGlacier: return tr("Glacier"); - case GeoDataFeature::NaturalIceShelf: return tr("Ice Shelf"); - case GeoDataFeature::NaturalScrub: return tr("Scrub"); - case GeoDataFeature::NaturalCliff: return tr("Cliff"); - case GeoDataFeature::NaturalHeath: return tr("Heath"); - case GeoDataFeature::HighwayTrafficSignals: return tr("Traffic Signals"); - case GeoDataFeature::HighwaySteps: return tr("Steps"); - case GeoDataFeature::HighwayUnknown: return tr("Unknown Road"); - case GeoDataFeature::HighwayPath: return tr("Path"); - case GeoDataFeature::HighwayFootway: return tr("Footway"); - case GeoDataFeature::HighwayTrack: return tr("Track"); - case GeoDataFeature::HighwayPedestrian: return tr("Footway"); - case GeoDataFeature::HighwayCycleway: return tr("Cycleway"); - case GeoDataFeature::HighwayService: return tr("Service Road"); - case GeoDataFeature::HighwayRoad: return tr("Road"); - case GeoDataFeature::HighwayResidential: return tr("Residential Road"); - case GeoDataFeature::HighwayLivingStreet: return tr("Living Street"); - case GeoDataFeature::HighwayUnclassified: return tr("Unclassified Road"); - case GeoDataFeature::HighwayTertiaryLink: return tr("Tertiary Link Road"); - case GeoDataFeature::HighwayTertiary: return tr("Tertiary Road"); - case GeoDataFeature::HighwaySecondaryLink: return tr("Secondary Link Road"); - case GeoDataFeature::HighwaySecondary: return tr("Secondary Road"); - case GeoDataFeature::HighwayPrimaryLink: return tr("Primary Link Road"); - case GeoDataFeature::HighwayPrimary: return tr("Primary Road"); - case GeoDataFeature::HighwayTrunkLink: return tr("Trunk Link Road"); - case GeoDataFeature::HighwayTrunk: return tr("Trunk Road"); - case GeoDataFeature::HighwayMotorwayLink: return tr("Motorway Link Road"); - case GeoDataFeature::HighwayMotorway: return tr("Motorway"); - case GeoDataFeature::Building: return tr("Building"); - case GeoDataFeature::AccomodationCamping: return tr("Camping"); - case GeoDataFeature::AccomodationHostel: return tr("Hostel"); - case GeoDataFeature::AccomodationHotel: return tr("Hotel"); - case GeoDataFeature::AccomodationMotel: return tr("Motel"); - case GeoDataFeature::AccomodationYouthHostel: return tr("Youth Hostel"); - case GeoDataFeature::AccomodationGuestHouse: return tr("Guest House"); - case GeoDataFeature::AmenityLibrary: return tr("Library"); - case GeoDataFeature::AmenityKindergarten: return tr("Kindergarten"); - case GeoDataFeature::EducationCollege: return tr("College"); - case GeoDataFeature::EducationSchool: return tr("School"); - case GeoDataFeature::EducationUniversity: return tr("University"); - case GeoDataFeature::FoodBar: return tr("Bar"); - case GeoDataFeature::FoodBiergarten: return tr("Biergarten"); - case GeoDataFeature::FoodCafe: return tr("Cafe"); - case GeoDataFeature::FoodFastFood: return tr("Fast Food"); - case GeoDataFeature::FoodPub: return tr("Pub"); - case GeoDataFeature::FoodRestaurant: return tr("Restaurant"); - case GeoDataFeature::HealthDentist: return tr("Dentist"); - case GeoDataFeature::HealthDoctors: return tr("Doctors"); - case GeoDataFeature::HealthHospital: return tr("Hospital"); - case GeoDataFeature::HealthPharmacy: return tr("Pharmacy"); - case GeoDataFeature::HealthVeterinary: return tr("Veterinary"); - case GeoDataFeature::MoneyAtm: return tr("ATM"); - case GeoDataFeature::MoneyBank: return tr("Bank"); - case GeoDataFeature::AmenityArchaeologicalSite: return tr("Archaeological Site"); - case GeoDataFeature::AmenityEmbassy: return tr("Embassy"); - case GeoDataFeature::AmenityEmergencyPhone: return tr("Emergency Phone"); - case GeoDataFeature::AmenityWaterPark: return tr("Water Park"); - case GeoDataFeature::AmenityCommunityCentre: return tr("Community Centre"); - case GeoDataFeature::AmenityFountain: return tr("Fountain"); - case GeoDataFeature::AmenityNightClub: return tr("Night Club"); - case GeoDataFeature::AmenityBench: return tr("Bench"); - case GeoDataFeature::AmenityCourtHouse: return tr("Court House"); - case GeoDataFeature::AmenityFireStation: return tr("Fire Station"); - case GeoDataFeature::AmenityHuntingStand: return tr("Hunting Stand"); - case GeoDataFeature::AmenityPolice: return tr("Police"); - case GeoDataFeature::AmenityPostBox: return tr("Post Box"); - case GeoDataFeature::AmenityPostOffice: return tr("Post Office"); - case GeoDataFeature::AmenityPrison: return tr("Prison"); - case GeoDataFeature::AmenityRecycling: return tr("Recycling"); - case GeoDataFeature::AmenityShelter: return tr("Shelter"); - case GeoDataFeature::AmenityTelephone: return tr("Telephone"); - case GeoDataFeature::AmenityToilets: return tr("Toilets"); - case GeoDataFeature::AmenityTownHall: return tr("Town Hall"); - case GeoDataFeature::AmenityWasteBasket: return tr("Waste Basket"); - case GeoDataFeature::AmenityDrinkingWater: return tr("Drinking Water"); - case GeoDataFeature::AmenityGraveyard: return tr("Graveyard"); - case GeoDataFeature::BarrierCityWall: return tr("City Wall"); - case GeoDataFeature::BarrierGate: return tr("Gate"); - case GeoDataFeature::BarrierLiftGate: return tr("Lift Gate"); - case GeoDataFeature::BarrierWall: return tr("Wall"); - case GeoDataFeature::NaturalPeak: return tr("Peak"); - case GeoDataFeature::NaturalTree: return tr("Tree"); - case GeoDataFeature::ShopBeverages: return tr("Beverages"); - case GeoDataFeature::ShopHifi: return tr("Hifi"); - case GeoDataFeature::ShopSupermarket: return tr("Supermarket"); - case GeoDataFeature::ShopAlcohol: return tr("Alcohol"); - case GeoDataFeature::ShopBakery: return tr("Bakery"); - case GeoDataFeature::ShopButcher: return tr("Butcher"); - case GeoDataFeature::ShopConfectionery: return tr("Confectionery"); - case GeoDataFeature::ShopConvenience: return tr("Convenience Shop"); - case GeoDataFeature::ShopGreengrocer: return tr("Greengrocer"); - case GeoDataFeature::ShopSeafood: return tr("Seafood"); - case GeoDataFeature::ShopDepartmentStore: return tr("Department Store"); - case GeoDataFeature::ShopKiosk: return tr("Kiosk"); - case GeoDataFeature::ShopBag: return tr("Bag"); - case GeoDataFeature::ShopClothes: return tr("Clothes"); - case GeoDataFeature::ShopFashion: return tr("Fashion"); - case GeoDataFeature::ShopJewelry: return tr("Jewelry"); - case GeoDataFeature::ShopShoes: return tr("Shoes"); - case GeoDataFeature::ShopVarietyStore: return tr("Variety Store"); - case GeoDataFeature::ShopBeauty: return tr("Beauty"); - case GeoDataFeature::ShopChemist: return tr("Chemist"); - case GeoDataFeature::ShopCosmetics: return tr("Cosmetics"); - case GeoDataFeature::ShopHairdresser: return tr("Hairdresser"); - case GeoDataFeature::ShopOptician: return tr("Optician"); - case GeoDataFeature::ShopPerfumery: return tr("Perfumery"); - case GeoDataFeature::ShopDoitYourself: return tr("Doit Yourself"); - case GeoDataFeature::ShopFlorist: return tr("Florist"); - case GeoDataFeature::ShopHardware: return tr("Hardware"); - case GeoDataFeature::ShopFurniture: return tr("Furniture"); - case GeoDataFeature::ShopElectronics: return tr("Electronics"); - case GeoDataFeature::ShopMobilePhone: return tr("Mobile Phone"); - case GeoDataFeature::ShopBicycle: return tr("Bicycle"); - case GeoDataFeature::ShopCar: return tr("Car"); - case GeoDataFeature::ShopCarRepair: return tr("Car Repair"); - case GeoDataFeature::ShopCarParts: return tr("Car Parts"); - case GeoDataFeature::ShopMotorcycle: return tr("Motorcycle"); - case GeoDataFeature::ShopOutdoor: return tr("Outdoor"); - case GeoDataFeature::ShopMusicalInstrument: return tr("Musical Instrument"); - case GeoDataFeature::ShopPhoto: return tr("Photo"); - case GeoDataFeature::ShopBook: return tr("Book"); - case GeoDataFeature::ShopGift: return tr("Gift"); - case GeoDataFeature::ShopStationery: return tr("Stationery"); - case GeoDataFeature::ShopLaundry: return tr("Laundry"); - case GeoDataFeature::ShopPet: return tr("Pet"); - case GeoDataFeature::ShopToys: return tr("Toys"); - case GeoDataFeature::ShopTravelAgency: return tr("Travel Agency"); - case GeoDataFeature::Shop: return tr("Shop"); - case GeoDataFeature::ManmadeBridge: return tr("Bridge"); - case GeoDataFeature::ManmadeLighthouse: return tr("Lighthouse"); - case GeoDataFeature::ManmadePier: return tr("Pier"); - case GeoDataFeature::ManmadeWaterTower: return tr("Water Tower"); - case GeoDataFeature::ManmadeWindMill: return tr("Wind Mill"); - case GeoDataFeature::TouristAttraction: return tr("Tourist Attraction"); - case GeoDataFeature::TouristCastle: return tr("Castle"); - case GeoDataFeature::TouristCinema: return tr("Cinema"); - case GeoDataFeature::TouristInformation: return tr("Information"); - case GeoDataFeature::TouristMonument: return tr("Monument"); - case GeoDataFeature::TouristMuseum: return tr("Museum"); - case GeoDataFeature::TouristRuin: return tr("Ruin"); - case GeoDataFeature::TouristTheatre: return tr("Theatre"); - case GeoDataFeature::TouristThemePark: return tr("Theme Park"); - case GeoDataFeature::TouristViewPoint: return tr("View Point"); - case GeoDataFeature::TouristZoo: return tr("Zoo"); - case GeoDataFeature::TouristAlpineHut: return tr("Alpine Hut"); - case GeoDataFeature::TransportAerodrome: return tr("Aerodrome"); - case GeoDataFeature::TransportHelipad: return tr("Helipad"); - case GeoDataFeature::TransportAirportTerminal: return tr("Airport Terminal"); - case GeoDataFeature::TransportBusStation: return tr("Bus Station"); - case GeoDataFeature::TransportBusStop: return tr("Bus Stop"); - case GeoDataFeature::TransportCarShare: return tr("Car Sharing"); - case GeoDataFeature::TransportFuel: return tr("Gas Station"); - case GeoDataFeature::TransportParking: return tr("Parking"); - case GeoDataFeature::TransportParkingSpace: return tr("Parking Space"); - case GeoDataFeature::TransportPlatform: return tr("Platform"); - case GeoDataFeature::TransportRentalBicycle: return tr("Rental Bicycle"); - case GeoDataFeature::TransportRentalCar: return tr("Rental Car"); - case GeoDataFeature::TransportTaxiRank: return tr("Taxi Rank"); - case GeoDataFeature::TransportTrainStation: return tr("Train Station"); - case GeoDataFeature::TransportTramStop: return tr("Tram Stop"); - case GeoDataFeature::TransportBicycleParking: return tr("Bicycle Parking"); - case GeoDataFeature::TransportMotorcycleParking: return tr("Motorcycle Parking"); - case GeoDataFeature::TransportSubwayEntrance: return tr("Subway Entrance"); - case GeoDataFeature::ReligionPlaceOfWorship: return tr("Place Of Worship"); - case GeoDataFeature::ReligionBahai: return tr("Bahai"); - case GeoDataFeature::ReligionBuddhist: return tr("Buddhist"); - case GeoDataFeature::ReligionChristian: return tr("Christian"); - case GeoDataFeature::ReligionMuslim: return tr("Muslim"); - case GeoDataFeature::ReligionHindu: return tr("Hindu"); - case GeoDataFeature::ReligionJain: return tr("Jain"); - case GeoDataFeature::ReligionJewish: return tr("Jewish"); - case GeoDataFeature::ReligionShinto: return tr("Shinto"); - case GeoDataFeature::ReligionSikh: return tr("Sikh"); - case GeoDataFeature::LeisureGolfCourse: return tr("Golf Course"); - case GeoDataFeature::LeisureMarina: return tr("Marina"); - case GeoDataFeature::LeisurePark: return tr("Park"); - case GeoDataFeature::LeisurePlayground: return tr("Playground"); - case GeoDataFeature::LeisurePitch: return tr("Pitch"); - case GeoDataFeature::LeisureSportsCentre: return tr("Sports Centre"); - case GeoDataFeature::LeisureStadium: return tr("Stadium"); - case GeoDataFeature::LeisureTrack: return tr("Track"); - case GeoDataFeature::LeisureSwimmingPool: return tr("Swimming Pool"); - case GeoDataFeature::LanduseAllotments: return tr("Allotments"); - case GeoDataFeature::LanduseBasin: return tr("Basin"); - case GeoDataFeature::LanduseCemetery: return tr("Cemetery"); - case GeoDataFeature::LanduseCommercial: return tr("Commercial"); - case GeoDataFeature::LanduseConstruction: return tr("Construction"); - case GeoDataFeature::LanduseFarmland: return tr("Farmland"); - case GeoDataFeature::LanduseFarmyard: return tr("Farmyard"); - case GeoDataFeature::LanduseGarages: return tr("Garages"); - case GeoDataFeature::LanduseGrass: return tr("Grass"); - case GeoDataFeature::LanduseIndustrial: return tr("Industrial"); - case GeoDataFeature::LanduseLandfill: return tr("Landfill"); - case GeoDataFeature::LanduseMeadow: return tr("Meadow"); - case GeoDataFeature::LanduseMilitary: return tr("Military"); - case GeoDataFeature::LanduseQuarry: return tr("Quarry"); - case GeoDataFeature::LanduseRailway: return tr("Railway"); - case GeoDataFeature::LanduseReservoir: return tr("Reservoir"); - case GeoDataFeature::LanduseResidential: return tr("Residential"); - case GeoDataFeature::LanduseRetail: return tr("Retail"); - case GeoDataFeature::LanduseOrchard: return tr("Orchard"); - case GeoDataFeature::LanduseVineyard: return tr("Vineyard"); - case GeoDataFeature::RailwayRail: return tr("Rail"); - case GeoDataFeature::RailwayNarrowGauge: return tr("Narrow Gauge"); - case GeoDataFeature::RailwayTram: return tr("Tram"); - case GeoDataFeature::RailwayLightRail: return tr("Light Rail"); - case GeoDataFeature::RailwayAbandoned: return tr("Abandoned Railway"); - case GeoDataFeature::RailwaySubway: return tr("Subway"); - case GeoDataFeature::RailwayPreserved: return tr("Preserved Railway"); - case GeoDataFeature::RailwayMiniature: return tr("Miniature Railway"); - case GeoDataFeature::RailwayConstruction: return tr("Railway Construction"); - case GeoDataFeature::RailwayMonorail: return tr("Monorail"); - case GeoDataFeature::RailwayFunicular: return tr("Funicular Railway"); - case GeoDataFeature::PowerTower: return tr("Power Tower"); - case GeoDataFeature::Satellite: return tr("Satellite"); - case GeoDataFeature::AdminLevel1: return tr("Admin Boundary (Level 1)"); - case GeoDataFeature::AdminLevel2: return tr("Admin Boundary (Level 2)"); - case GeoDataFeature::AdminLevel3: return tr("Admin Boundary (Level 3)"); - case GeoDataFeature::AdminLevel4: return tr("Admin Boundary (Level 4)"); - case GeoDataFeature::AdminLevel5: return tr("Admin Boundary (Level 5)"); - case GeoDataFeature::AdminLevel6: return tr("Admin Boundary (Level 6)"); - case GeoDataFeature::AdminLevel7: return tr("Admin Boundary (Level 7)"); - case GeoDataFeature::AdminLevel8: return tr("Admin Boundary (Level 8)"); - case GeoDataFeature::AdminLevel9: return tr("Admin Boundary (Level 9)"); - case GeoDataFeature::AdminLevel10: return tr("Admin Boundary (Level 10)"); - case GeoDataFeature::AdminLevel11: return tr("Admin Boundary (Level 11)"); - case GeoDataFeature::BoundaryMaritime: return tr("Boundary (Maritime)"); - case GeoDataFeature::Landmass: return tr("Land Mass"); - case GeoDataFeature::UrbanArea: return tr("Urban Area"); - case GeoDataFeature::InternationalDateLine: return tr("International Date Line"); - case GeoDataFeature::Bathymetry: return tr("Bathymetry"); - case GeoDataFeature::Valley: return tr("Valley"); - case GeoDataFeature::OtherTerrain: return tr("Terrain"); - case GeoDataFeature::Crater: return tr("Crater"); - case GeoDataFeature::Mare: return tr("Sea"); - case GeoDataFeature::MannedLandingSite: return tr("Manned Landing Site"); - case GeoDataFeature::RoboticRover: return tr("Robotic Rover"); - case GeoDataFeature::UnmannedSoftLandingSite: return tr("Unmanned Soft Landing Site"); - case GeoDataFeature::UnmannedHardLandingSite: return tr("Unmanned Hard Landing Site"); - case GeoDataFeature::Mons: return tr("Mountain"); - case GeoDataFeature::Default: - case GeoDataFeature::Unknown: - case GeoDataFeature::None: - case GeoDataFeature::LastIndex: return QString(); - } - - return QString(); -} - void Placemark::addTagValue(QString &target, const QString &key) const { auto const & osmData = m_placemark.osmData(); QString const value = osmData.tagValue(key); QString description = value; description.replace(';', " · "); addTagDescription(target, key, value, description); } void Placemark::addTagDescription(QString &target, const QString &key, const QString &value, const QString &description) const { auto const & osmData = m_placemark.osmData(); if (osmData.containsTag(key, value)) { if (!target.isEmpty()) { target += " · "; } target += description; } } QString Placemark::addressFromOsmData() const { #ifdef HAVE_QT5_POSITIONING QGeoAddress address; OsmPlacemarkData const data = m_placemark.osmData(); address.setCountry(data.tagValue("addr:country")); address.setState(data.tagValue("addr:state")); address.setCity(data.tagValue("addr:city")); address.setDistrict(data.tagValue("district")); address.setPostalCode(data.tagValue("addr:postcode")); QString const street = data.tagValue("addr:street"); QString const houseNumber = data.tagValue("addr:housenumber"); address.setStreet(formatStreet(street, houseNumber)); return address.text().replace("
", ", "); #else return QString(); #endif } QString Placemark::formatStreet(const QString &street, const QString &houseNumber) const { return houseNumber.isEmpty() ? street : tr("%1 %2", "House number (first argument) and street name (second argument) in an address").arg(houseNumber).arg(street).trimmed(); } } #include "moc_Placemark.cpp" diff --git a/src/lib/marble/declarative/Placemark.h b/src/lib/marble/declarative/Placemark.h index cfd8ed561..22bfafd6f 100644 --- a/src/lib/marble/declarative/Placemark.h +++ b/src/lib/marble/declarative/Placemark.h @@ -1,95 +1,94 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2012 Dennis Nienhüser // #ifndef MARBLE_DECLARATIVE_PLACEMARK_H #define MARBLE_DECLARATIVE_PLACEMARK_H #include "Coordinate.h" #include "GeoDataPlacemark.h" #include "GeoDataFeature.h" #include #include namespace Marble { /** * Wraps a GeoDataPlacemark for QML access */ class Placemark : public QObject { Q_OBJECT Q_PROPERTY( QString name WRITE setName READ name NOTIFY nameChanged ) Q_PROPERTY( QString description READ description NOTIFY descriptionChanged ) Q_PROPERTY( QString address READ address NOTIFY addressChanged ) Q_PROPERTY( QString website READ website NOTIFY websiteChanged ) Q_PROPERTY( QString wikipedia READ wikipedia NOTIFY wikipediaChanged ) Q_PROPERTY( QString fuelDetails READ fuelDetails NOTIFY fuelDetailsChanged ) Q_PROPERTY( QString openingHours READ openingHours NOTIFY openingHoursChanged ) Q_PROPERTY( QString coordinates READ coordinates NOTIFY coordinatesChanged ) Q_PROPERTY(double longitude READ longitude NOTIFY coordinatesChanged) Q_PROPERTY(double latitude READ latitude NOTIFY coordinatesChanged) public: /** Constructor */ explicit Placemark( QObject *parent = 0 ); void setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark ); Marble::GeoDataPlacemark & placemark(); const Marble::GeoDataPlacemark & placemark() const; QString name() const; QString description() const; QString address() const; QString website() const; QString wikipedia() const; QString fuelDetails() const; QString openingHours() const; QString coordinates() const; double longitude() const; double latitude() const; public Q_SLOTS: void setName(const QString &name); Q_SIGNALS: void nameChanged(); void coordinatesChanged(); void descriptionChanged(); void addressChanged(); void websiteChanged(); void wikipediaChanged(); void fuelDetailsChanged(); void openingHoursChanged(); private: - QString categoryName(GeoDataFeature::GeoDataVisualCategory category) const; void addTagValue(QString &target, const QString &key) const; void addTagDescription(QString &target, const QString &key, const QString &value, const QString &description) const; QString addressFromOsmData() const; QString formatStreet(const QString &street, const QString &houseNumber) const; Marble::GeoDataPlacemark m_placemark; mutable QString m_address; // mutable to allow lazy calculation in the getter mutable QString m_description; mutable QString m_fuelDetails; mutable QString m_website; mutable QString m_wikipedia; mutable QString m_openingHours; }; } QML_DECLARE_TYPE(Marble::Placemark) #endif // MARBLE_DECLARATIVE_PLACEMARK_H diff --git a/src/lib/marble/geodata/data/GeoDataFeature.cpp b/src/lib/marble/geodata/data/GeoDataFeature.cpp index 6283158ba..a63cc67fc 100644 --- a/src/lib/marble/geodata/data/GeoDataFeature.cpp +++ b/src/lib/marble/geodata/data/GeoDataFeature.cpp @@ -1,491 +1,496 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2007 Murad Tagirov // Copyright 2009 Patrick Spendrin // #include "GeoDataFeature.h" #include "GeoDataFeature_p.h" #include #include #include "MarbleDirs.h" #include "MarbleDebug.h" #include "GeoDataStyle.h" #include "GeoDataStyleMap.h" #include "GeoDataContainer.h" #include "GeoDataDocument.h" #include "GeoDataFolder.h" #include "GeoDataPlacemark.h" #include "GeoDataRegion.h" #include "GeoDataCamera.h" namespace Marble { const QSharedPointer GeoDataFeaturePrivate::s_defaultStyle(new GeoDataStyle); GeoDataFeature::GeoDataFeature() : d( new GeoDataFeaturePrivate() ) { d->ref.ref(); } GeoDataFeature::GeoDataFeature( const GeoDataFeature& other ) : GeoDataObject(), d( other.d ) { d->ref.ref(); } GeoDataFeature::GeoDataFeature( const QString& name ) : d( new GeoDataFeaturePrivate() ) { d->ref.ref(); d->m_name = name; } GeoDataFeature::GeoDataFeature( GeoDataFeaturePrivate *priv ) : d( priv ) { d->ref.ref(); } GeoDataFeature::~GeoDataFeature() { if (!d->ref.deref()) { delete d; } } GeoDataFeaturePrivate* GeoDataFeature::p() const { return static_cast(d); } GeoDataFeature& GeoDataFeature::operator=( const GeoDataFeature& other ) { if (!d->ref.deref()) { delete d; } d = other.d; d->ref.ref(); return *this; } bool GeoDataFeature::equals( const GeoDataFeature &other ) const { if ( !GeoDataObject::equals(other) || p()->m_name != other.p()->m_name || p()->m_snippet != other.p()->m_snippet || p()->m_description != other.p()->m_description || p()->m_descriptionCDATA != other.p()->m_descriptionCDATA || p()->m_address != other.p()->m_address || p()->m_phoneNumber != other.p()->m_phoneNumber || p()->m_styleUrl != other.p()->m_styleUrl || p()->m_popularity != other.p()->m_popularity || p()->m_zoomLevel != other.p()->m_zoomLevel || p()->m_visible != other.p()->m_visible || p()->m_role != other.p()->m_role || p()->m_extendedData != other.p()->m_extendedData || p()->m_timeSpan != other.p()->m_timeSpan || p()->m_timeStamp != other.p()->m_timeStamp || p()->m_region != other.p()->m_region || *style() != *other.style() ) { return false; } if ( (!p()->m_styleMap && other.p()->m_styleMap) || (p()->m_styleMap && !other.p()->m_styleMap) ) { return false; } if ( (p()->m_styleMap && other.p()->m_styleMap) && (*p()->m_styleMap != *other.p()->m_styleMap) ) { return false; } if ( !p()->m_abstractView && !other.p()->m_abstractView ) { return true; } else if ( (!p()->m_abstractView && other.p()->m_abstractView) || (p()->m_abstractView && !other.p()->m_abstractView) ) { return false; } if ( p()->m_abstractView->nodeType() != other.p()->m_abstractView->nodeType() ) { return false; } if ( p()->m_abstractView->nodeType() == GeoDataTypes::GeoDataCameraType ) { GeoDataCamera *thisCam = dynamic_cast( p()->m_abstractView ); GeoDataCamera *otherCam = dynamic_cast( other.p()->m_abstractView ); Q_ASSERT(thisCam && otherCam); if ( *thisCam != *otherCam ) { return false; } } else if ( p()->m_abstractView->nodeType() == GeoDataTypes::GeoDataLookAtType ) { GeoDataLookAt *thisLookAt = dynamic_cast( p()->m_abstractView ); GeoDataLookAt *otherLookAt = dynamic_cast( other.p()->m_abstractView ); Q_ASSERT(thisLookAt && otherLookAt); if ( *thisLookAt != *otherLookAt ) { return false; } } return true; } const char* GeoDataFeature::nodeType() const { return p()->nodeType(); } EnumFeatureId GeoDataFeature::featureId() const { return d->featureId(); } QString GeoDataFeature::name() const { return d->m_name; } void GeoDataFeature::setName( const QString &value ) { detach(); d->m_name = value; } GeoDataSnippet GeoDataFeature::snippet() const { return d->m_snippet; } void GeoDataFeature::setSnippet( const GeoDataSnippet &snippet ) { detach(); d->m_snippet = snippet; } QString GeoDataFeature::address() const { return d->m_address; } void GeoDataFeature::setAddress( const QString &value) { detach(); d->m_address = value; } QString GeoDataFeature::phoneNumber() const { return d->m_phoneNumber; } void GeoDataFeature::setPhoneNumber( const QString &value) { detach(); d->m_phoneNumber = value; } QString GeoDataFeature::description() const { return d->m_description; } void GeoDataFeature::setDescription( const QString &value) { detach(); d->m_description = value; } bool GeoDataFeature::descriptionIsCDATA() const { return d->m_descriptionCDATA; } void GeoDataFeature::setDescriptionCDATA( bool cdata ) { detach(); d->m_descriptionCDATA = cdata; } const GeoDataAbstractView* GeoDataFeature::abstractView() const { return d->m_abstractView; } GeoDataAbstractView *GeoDataFeature::abstractView() { // FIXME: Calling detach() doesn't help at all because the m_abstractView // object isn't actually copied in the Private class as well. // detach(); return d->m_abstractView; } void GeoDataFeature::setAbstractView( GeoDataAbstractView *abstractView ) { detach(); d->m_abstractView = abstractView; } QString GeoDataFeature::styleUrl() const { return d->m_styleUrl; } void GeoDataFeature::setStyleUrl( const QString &value ) { detach(); d->m_styleUrl = value; if ( value.isEmpty() ) { d->m_style = GeoDataStyle::Ptr(); return; } QString styleUrl = value; styleUrl.remove('#'); GeoDataObject *object = parent(); bool found = false; while ( object && !found ) { if( object->nodeType() == GeoDataTypes::GeoDataDocumentType ) { GeoDataDocument *doc = static_cast ( object ); GeoDataStyleMap &styleMap = doc->styleMap( styleUrl ); if( !styleMap.value( QString( "normal" ) ).isEmpty() ) { styleUrl = styleMap.value( QString( "normal" ) ); styleUrl.remove('#'); } // Not calling setStyle here because we don't want // re-parenting of the style d->m_style = doc->style( styleUrl ); found = true; } object = object->parent(); } } bool GeoDataFeature::isVisible() const { return d->m_visible; } void GeoDataFeature::setVisible( bool value ) { detach(); d->m_visible = value; } bool GeoDataFeature::isGloballyVisible() const { if ( parent() == 0 ) { return d->m_visible; } GeoDataContainer *container = static_cast( parent() ); return d->m_visible && container->isGloballyVisible(); } const GeoDataTimeSpan &GeoDataFeature::timeSpan() const { return d->m_timeSpan; } GeoDataTimeSpan &GeoDataFeature::timeSpan() { detach(); return d->m_timeSpan; } void GeoDataFeature::setTimeSpan( const GeoDataTimeSpan &timeSpan ) { detach(); d->m_timeSpan = timeSpan; } const GeoDataTimeStamp &GeoDataFeature::timeStamp() const { return d->m_timeStamp; } GeoDataTimeStamp &GeoDataFeature::timeStamp() { detach(); return d->m_timeStamp; } void GeoDataFeature::setTimeStamp( const GeoDataTimeStamp &timeStamp ) { detach(); d->m_timeStamp = timeStamp; } const GeoDataExtendedData &GeoDataFeature::extendedData() const { return d->m_extendedData; } GeoDataStyle::ConstPtr GeoDataFeature::style() const { if (d->m_style) { return d->m_style; } return GeoDataFeaturePrivate::s_defaultStyle; } GeoDataStyle::ConstPtr GeoDataFeature::customStyle() const { return d->m_style; } void GeoDataFeature::setStyle( const GeoDataStyle::Ptr &style ) { detach(); if (style) style->setParent( this ); d->m_style = style; } GeoDataExtendedData& GeoDataFeature::extendedData() { detach(); return d->m_extendedData; } void GeoDataFeature::setExtendedData( const GeoDataExtendedData& extendedData ) { detach(); d->m_extendedData = extendedData; } GeoDataRegion& GeoDataFeature::region() const { // FIXME: Should call detach(). Maybe don't return reference. return d->m_region; } void GeoDataFeature::setRegion( const GeoDataRegion& region ) { detach(); d->m_region = region; } GeoDataFeature::GeoDataVisualCategory GeoDataFeature::visualCategory() const { return d->m_visualCategory; } void GeoDataFeature::setVisualCategory( GeoDataFeature::GeoDataVisualCategory index ) { detach(); d->m_visualCategory = index; } const QString GeoDataFeature::role() const { return d->m_role; } void GeoDataFeature::setRole( const QString &role ) { detach(); d->m_role = role; } const GeoDataStyleMap* GeoDataFeature::styleMap() const { return d->m_styleMap; } void GeoDataFeature::setStyleMap( const GeoDataStyleMap* styleMap ) { d->m_styleMap = styleMap; } int GeoDataFeature::zoomLevel() const { return d->m_zoomLevel; } void GeoDataFeature::setZoomLevel( int zoomLevel ) { detach(); d->m_zoomLevel = zoomLevel; } qint64 GeoDataFeature::popularity() const { return d->m_popularity; } void GeoDataFeature::setPopularity( qint64 popularity ) { detach(); d->m_popularity = popularity; } +QString GeoDataFeature::categoryName() const +{ + return d->categoryName(); +} + void GeoDataFeature::detach() { if(d->ref.load() == 1) { return; } GeoDataFeaturePrivate* new_d = d->copy(); if (!d->ref.deref()) { delete d; } d = new_d; d->ref.ref(); } void GeoDataFeature::pack( QDataStream& stream ) const { GeoDataObject::pack( stream ); stream << d->m_name; stream << d->m_address; stream << d->m_phoneNumber; stream << d->m_description; stream << d->m_visible; // stream << d->m_visualCategory; stream << d->m_role; stream << d->m_popularity; stream << d->m_zoomLevel; } void GeoDataFeature::unpack( QDataStream& stream ) { detach(); GeoDataObject::unpack( stream ); stream >> d->m_name; stream >> d->m_address; stream >> d->m_phoneNumber; stream >> d->m_description; stream >> d->m_visible; // stream >> (int)d->m_visualCategory; stream >> d->m_role; stream >> d->m_popularity; stream >> d->m_zoomLevel; } } diff --git a/src/lib/marble/geodata/data/GeoDataFeature.h b/src/lib/marble/geodata/data/GeoDataFeature.h index 663e994ef..d88f9ac3b 100644 --- a/src/lib/marble/geodata/data/GeoDataFeature.h +++ b/src/lib/marble/geodata/data/GeoDataFeature.h @@ -1,654 +1,656 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2007 Murad Tagirov // Copyright 2009 Patrick Spendrin // #ifndef MARBLE_GEODATAFEATURE_H #define MARBLE_GEODATAFEATURE_H #include "GeoDataObject.h" #include "geodata_export.h" namespace Marble { // forward define all features we can find. class GeoDataRegion; class GeoDataAbstractView; class GeoDataStyle; class GeoDataStyleMap; class GeoDataExtendedData; class GeoDataTimeSpan; class GeoDataTimeStamp; class GeoDataFeaturePrivate; class GeoDataSnippet; /** * @short A base class for all geodata features * * GeoDataFeature is the base class for most geodata classes that * correspond to places on a map. It is never instantiated by itself, * but is always used as part of a derived class. * * @see GeoDataPlacemark * @see GeoDataContainer */ // FIXME: Later also add NetworkLink and Overlay class GEODATA_EXPORT GeoDataFeature : public GeoDataObject { public: GeoDataFeature(); /// Create a new GeoDataFeature with @p name as its name. explicit GeoDataFeature( const QString& name ); GeoDataFeature( const GeoDataFeature& other ); virtual ~GeoDataFeature(); GeoDataFeature& operator=( const GeoDataFeature& other ); /// Provides type information for downcasting a GeoData virtual const char* nodeType() const; EnumFeatureId featureId() const; /** * @brief A categorization of a placemark as defined by ...FIXME. * There is an additional osm tag mapping to GeoDataVisualCategory * in OsmPresetLibrary.cpp */ enum GeoDataVisualCategory { None, Default, Unknown, // The order of the cities needs to stay fixed as the // algorithms rely on that. SmallCity, SmallCountyCapital, SmallStateCapital, SmallNationCapital, MediumCity, MediumCountyCapital, MediumStateCapital, MediumNationCapital, BigCity, BigCountyCapital, BigStateCapital, BigNationCapital, LargeCity, LargeCountyCapital, LargeStateCapital, LargeNationCapital, Nation, PlaceCity, PlaceSuburb, PlaceHamlet, PlaceLocality, PlaceTown, PlaceVillage, // Terrain Mountain, Volcano, Mons, // m Valley, // v Continent, Ocean, OtherTerrain, // o // Space Terrain Crater, // c Mare, // a // Places of Interest GeographicPole, MagneticPole, ShipWreck, AirPort, Observatory, // Military MilitaryDangerArea, // Runners OsmSite, Coordinate, // Planets MannedLandingSite, // h RoboticRover, // r UnmannedSoftLandingSite, // u UnmannedHardLandingSite, // i Folder, Bookmark, NaturalWater, NaturalReef, NaturalWood, NaturalBeach, NaturalWetland, NaturalGlacier, NaturalIceShelf, NaturalScrub, NaturalCliff, NaturalHeath, HighwayTrafficSignals, // OpenStreetMap highways HighwaySteps, HighwayUnknown, HighwayPath, HighwayFootway, HighwayTrack, HighwayPedestrian, HighwayCycleway, HighwayService, HighwayRoad, HighwayResidential, HighwayLivingStreet, HighwayUnclassified, HighwayTertiaryLink, HighwayTertiary, HighwaySecondaryLink, HighwaySecondary, HighwayPrimaryLink, HighwayPrimary, HighwayTrunkLink, HighwayTrunk, HighwayMotorwayLink, HighwayMotorway, //OSM building Building, // OpenStreetMap category Accomodation AccomodationCamping, AccomodationHostel, AccomodationHotel, AccomodationMotel, AccomodationYouthHostel, AccomodationGuestHouse, // OpenStreetMap category Amenity AmenityLibrary, AmenityKindergarten, // OpenStreetMap category Education EducationCollege, EducationSchool, EducationUniversity, // OpenStreetMap category Food FoodBar, FoodBiergarten, FoodCafe, FoodFastFood, FoodPub, FoodRestaurant, // OpenStreetMap category Health HealthDentist, HealthDoctors, HealthHospital, HealthPharmacy, HealthVeterinary, // OpenStreetMap category Money MoneyAtm, MoneyBank, AmenityArchaeologicalSite, AmenityEmbassy, AmenityEmergencyPhone, AmenityWaterPark, AmenityCommunityCentre, AmenityFountain, AmenityNightClub, AmenityBench, AmenityCourtHouse, AmenityFireStation, AmenityHuntingStand, AmenityPolice, AmenityPostBox, AmenityPostOffice, AmenityPrison, AmenityRecycling, AmenityShelter, AmenityTelephone, AmenityToilets, AmenityTownHall, AmenityWasteBasket, AmenityDrinkingWater, AmenityGraveyard, // OpenStreetMap category Barrier BarrierCityWall, BarrierGate, BarrierLiftGate, BarrierWall, NaturalPeak, NaturalTree, // OpenStreetMap category Shopping ShopBeverages, ShopHifi, ShopSupermarket, ShopAlcohol, ShopBakery, ShopButcher, ShopConfectionery, ShopConvenience, ShopGreengrocer, ShopSeafood, ShopDepartmentStore, ShopKiosk, ShopBag, ShopClothes, ShopFashion, ShopJewelry, ShopShoes, ShopVarietyStore, ShopBeauty, ShopChemist, ShopCosmetics, ShopHairdresser, ShopOptician, ShopPerfumery, ShopDoitYourself, ShopFlorist, ShopHardware, ShopFurniture, ShopElectronics, ShopMobilePhone, ShopBicycle, ShopCar, ShopCarRepair, ShopCarParts, ShopMotorcycle, ShopOutdoor, ShopMusicalInstrument, ShopPhoto, ShopBook, ShopGift, ShopStationery, ShopLaundry, ShopPet, ShopToys, ShopTravelAgency, Shop, ManmadeBridge, ManmadeLighthouse, ManmadePier, ManmadeWaterTower, ManmadeWindMill, // OpenStreetMap category Tourist TouristAttraction, TouristCastle, TouristCinema, TouristInformation, TouristMonument, TouristMuseum, TouristRuin, TouristTheatre, TouristThemePark, TouristViewPoint, TouristZoo, TouristAlpineHut, // OpenStreetMap category Transport TransportAerodrome, TransportHelipad, TransportAirportTerminal, TransportBusStation, TransportBusStop, TransportCarShare, TransportFuel, TransportParking, TransportParkingSpace, TransportPlatform, TransportRentalBicycle, TransportRentalCar, TransportTaxiRank, TransportTrainStation, TransportTramStop, TransportBicycleParking, TransportMotorcycleParking, TransportSubwayEntrance, // OpenStreetMap category religion ReligionPlaceOfWorship, ReligionBahai, ReligionBuddhist, ReligionChristian, ReligionMuslim, ReligionHindu, ReligionJain, ReligionJewish, ReligionShinto, ReligionSikh, // OpenStreetMap category Leisure LeisureGolfCourse, LeisureMarina, LeisurePark, LeisurePlayground, LeisurePitch, LeisureSportsCentre, LeisureStadium, LeisureTrack, LeisureSwimmingPool, LanduseAllotments, LanduseBasin, LanduseCemetery, LanduseCommercial, LanduseConstruction, LanduseFarmland, LanduseFarmyard, LanduseGarages, LanduseGrass, LanduseIndustrial, LanduseLandfill, LanduseMeadow, LanduseMilitary, LanduseQuarry, LanduseRailway, LanduseReservoir, LanduseResidential, LanduseRetail, LanduseOrchard, LanduseVineyard, RailwayRail, RailwayNarrowGauge, RailwayTram, RailwayLightRail, RailwayAbandoned, RailwaySubway, RailwayPreserved, RailwayMiniature, RailwayConstruction, RailwayMonorail, RailwayFunicular, // OpenStreetMap category Power PowerTower, Satellite, //Admin level tags for depicting boundary AdminLevel1, AdminLevel2, AdminLevel3, AdminLevel4, AdminLevel5, AdminLevel6, AdminLevel7, AdminLevel8, AdminLevel9, AdminLevel10, AdminLevel11, BoundaryMaritime, //Custom OSM Tags Landmass, UrbanArea, InternationalDateLine, Bathymetry, // Important: Make sure that this is always the last // item and just use it to specify the array size LastIndex }; /** * @brief The name of the feature * * The name of the feature should be a short string. It is often * shown directly on the map and need therefore not take up much * space. * * @return The name of this feature */ QString name() const; /** * @brief Set a new name for this feature * @param value the new name */ void setName( const QString &value ); /** * @brief A short description of the feature. * * HTML markup is not supported. * @TODO When the Snippet is not supplied, the first lines of description should be used. * @return The name of this feature */ GeoDataSnippet snippet() const; /** * @brief Set a new name for this feature * @param value the new name */ void setSnippet( const GeoDataSnippet &value ); /// Return the address of the feature QString address() const; /// Set the address of this feature to @p value. void setAddress( const QString &value); /// Return the phone number of the feature QString phoneNumber() const; /// Set the phone number of this feature to @p value. void setPhoneNumber( const QString &value ); /// Return the text description of the feature. QString description() const; /// Set the description of this feature to @p value. void setDescription( const QString &value ); /** * @brief test if the description is CDATA or not * CDATA allows for special characters to be included in XML and also allows * for other XML formats to be embedded in the XML without interfering with * parser namespace. * @return @true if the description should be treated as CDATA * @false if the description is a plain string */ bool descriptionIsCDATA() const; /// Set the description to be CDATA See: @see descriptionIsCDATA() void setDescriptionCDATA( bool cdata ); /// Get the Abstract view of the feature const GeoDataAbstractView *abstractView() const; GeoDataAbstractView *abstractView(); /// Set the abstract view of the feature void setAbstractView( GeoDataAbstractView *abstractView ); /// Return the styleUrl of the feature. QString styleUrl() const; /// Set the styleUrl of this feature to @p value. void setStyleUrl( const QString &value ); /// Return whether this feature is visible or not bool isVisible() const; /// Return whether this feature is visible or not in the context of its parenting bool isGloballyVisible() const; /** * @brief Set a new value for visibility * @param value new value for the visibility * * This function sets the visibility, i.e. whether this feature * should be shown or not. This can be changed either from a GUI * or through some action of the program. */ void setVisible( bool value ); /** * Return the timespan of the feature. */ const GeoDataTimeSpan& timeSpan() const; GeoDataTimeSpan& timeSpan(); /** * Set the timespan of the feature. * @param timeSpan new of timespan. */ void setTimeSpan( const GeoDataTimeSpan &timeSpan ); /** * Return the timestamp of the feature. */ const GeoDataTimeStamp& timeStamp() const; GeoDataTimeStamp& timeStamp(); /** * Set the timestamp of the feature. * @param timeStamp new of the timestamp. */ void setTimeStamp( const GeoDataTimeStamp &timeStamp ); /** * Return the style assigned to the placemark, or a default style if none has been set */ QSharedPointer style() const; /** * Return the style assigned to the placemark with setStyle (can be 0) */ QSharedPointer customStyle() const; /** * Sets the style of the placemark. * @param style the new style to be used. */ void setStyle( const QSharedPointer &style ); /** * Return the ExtendedData assigned to the feature. */ GeoDataExtendedData& extendedData(); const GeoDataExtendedData& extendedData() const; /** * Sets the ExtendedData of the feature. * @param extendedData the new ExtendedData to be used. */ void setExtendedData( const GeoDataExtendedData& extendedData ); /** * Return the region assigned to the placemark. */ GeoDataRegion& region() const; /** * @brief Sets the region of the placemark. * @param region new value for the region * * The feature is only shown when the region if active. */ void setRegion( const GeoDataRegion& region ); /** * Return the symbol index of the placemark. */ GeoDataVisualCategory visualCategory() const; /** * Sets the symbol @p index of the placemark. * @param category the new category to be used. */ void setVisualCategory( GeoDataVisualCategory category ); /** * Return the role of the placemark. * * FIXME: describe roles here! */ const QString role() const; /** * Sets the role of the placemark. * @param role the new role to be used. */ void setRole( const QString &role ); /** * @brief Return the popularity index of the placemark. * * The popularity index is a value which describes at which zoom * level the placemark will be shown. */ int zoomLevel() const; /** * Sets the popularity @p index of the placemark. * @param index the new index to be used. */ void setZoomLevel( int index ); /** * Return the popularity of the feature. */ qint64 popularity() const; /** * Sets the @p popularity of the feature. * @param popularity the new popularity value */ void setPopularity( qint64 popularity ); /** * Return a pointer to a GeoDataStyleMap object which represents the styleMap * of this feature. A styleMap is simply a QMap which can connect * two styles with a keyword. This can be used to have a highlighted and a * normal style. * @see GeoDataStyleMap */ const GeoDataStyleMap* styleMap() const; /** * Sets the styleMap of the feature */ void setStyleMap( const GeoDataStyleMap* map ); + QString categoryName() const; + /// Serialize the contents of the feature to @p stream. virtual void pack( QDataStream& stream ) const; /// Unserialize the contents of the feature from @p stream. virtual void unpack( QDataStream& stream ); protected: // the d-pointer needs to be protected to be accessible from derived classes GeoDataFeaturePrivate* d; explicit GeoDataFeature( GeoDataFeaturePrivate* priv ); virtual void detach(); bool equals( const GeoDataFeature &other ) const; using GeoDataObject::equals; private: // the private d pointer accessor - use it instead of the d pointer directly GeoDataFeaturePrivate* p() const; }; } #endif diff --git a/src/lib/marble/geodata/data/GeoDataFeature_p.h b/src/lib/marble/geodata/data/GeoDataFeature_p.h index b5701b57a..e820669a4 100644 --- a/src/lib/marble/geodata/data/GeoDataFeature_p.h +++ b/src/lib/marble/geodata/data/GeoDataFeature_p.h @@ -1,163 +1,459 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2009 Patrick Spendrin // #ifndef MARBLE_GEODATAFEATUREPRIVATE_H #define MARBLE_GEODATAFEATUREPRIVATE_H #include #include #include "GeoDataExtendedData.h" #include "GeoDataAbstractView.h" #include "GeoDataFeature.h" #include "GeoDataRegion.h" #include "GeoDataTimeStamp.h" #include "GeoDataTimeSpan.h" #include "GeoDataTypes.h" #include "GeoDataStyle.h" #include "GeoDataSnippet.h" #include "MarbleDirs.h" namespace Marble { class GeoDataFeaturePrivate { + Q_DECLARE_TR_FUNCTIONS(GeoDataFeature) public: GeoDataFeaturePrivate() : m_name(), m_snippet(), m_description(), m_descriptionCDATA(), m_address(), m_phoneNumber(), m_styleUrl(), m_abstractView( 0 ), m_popularity( 0 ), m_zoomLevel( 1 ), m_visible( true ), m_visualCategory( GeoDataFeature::Default ), m_role(" "), m_style( 0 ), m_styleMap( 0 ), m_extendedData(), m_timeSpan(), m_timeStamp(), m_region(), ref( 0 ) { } GeoDataFeaturePrivate( const GeoDataFeaturePrivate& other ) : m_name( other.m_name ), m_snippet( other.m_snippet ), m_description( other.m_description ), m_descriptionCDATA( other.m_descriptionCDATA), m_address( other.m_address ), m_phoneNumber( other.m_phoneNumber ), m_styleUrl( other.m_styleUrl ), m_abstractView( other.m_abstractView ), m_popularity( other.m_popularity ), m_zoomLevel( other.m_zoomLevel ), m_visible( other.m_visible ), m_visualCategory( other.m_visualCategory ), m_role( other.m_role ), m_style( other.m_style ), //FIXME: both style and stylemap need to be reworked internally!!!! m_styleMap( other.m_styleMap ), m_extendedData( other.m_extendedData ), m_timeSpan( other.m_timeSpan ), m_timeStamp( other.m_timeStamp ), m_region( other.m_region ), ref( 0 ) { } GeoDataFeaturePrivate& operator=( const GeoDataFeaturePrivate& other ) { m_name = other.m_name; m_snippet = other.m_snippet; m_description = other.m_description; m_descriptionCDATA = other.m_descriptionCDATA; m_address = other.m_address; m_phoneNumber = other.m_phoneNumber; m_styleUrl = other.m_styleUrl; m_abstractView = other.m_abstractView; m_popularity = other.m_popularity; m_zoomLevel = other.m_zoomLevel; m_visible = other.m_visible; m_role = other.m_role; m_style = other.m_style; m_styleMap = other.m_styleMap; m_timeSpan = other.m_timeSpan; m_timeStamp = other.m_timeStamp; m_visualCategory = other.m_visualCategory; m_extendedData = other.m_extendedData; m_region = other.m_region; return *this; } virtual GeoDataFeaturePrivate* copy() { GeoDataFeaturePrivate* copy = new GeoDataFeaturePrivate; *copy = *this; return copy; } virtual EnumFeatureId featureId() const { return InvalidFeatureId; } virtual ~GeoDataFeaturePrivate() { } virtual const char* nodeType() const { return GeoDataTypes::GeoDataFeatureType; } + QString categoryName() const + { + switch (m_visualCategory) { + case GeoDataFeature::SmallCity: return tr("City"); + case GeoDataFeature::SmallCountyCapital: return tr("County Capital"); + case GeoDataFeature::SmallStateCapital: return tr("State Capital"); + case GeoDataFeature::SmallNationCapital: return tr("Nation Capital"); + case GeoDataFeature::MediumCity: return tr("City"); + case GeoDataFeature::MediumCountyCapital: return tr("County Capital"); + case GeoDataFeature::MediumStateCapital: return tr("State Capital"); + case GeoDataFeature::MediumNationCapital: return tr("Nation Capital"); + case GeoDataFeature::BigCity: return tr("City"); + case GeoDataFeature::BigCountyCapital: return tr("County Capital"); + case GeoDataFeature::BigStateCapital: return tr("State Capital"); + case GeoDataFeature::BigNationCapital: return tr("Nation Capital"); + case GeoDataFeature::LargeCity: return tr("City"); + case GeoDataFeature::LargeCountyCapital: return tr("County Capital"); + case GeoDataFeature::LargeStateCapital: return tr("State Capital"); + case GeoDataFeature::LargeNationCapital: return tr("Nation Capital"); + case GeoDataFeature::Nation: return tr("Nation"); + case GeoDataFeature::PlaceCity: return tr("City"); + case GeoDataFeature::PlaceSuburb: return tr("Suburb"); + case GeoDataFeature::PlaceHamlet: return tr("Hamlet"); + case GeoDataFeature::PlaceLocality: return tr("Locality"); + case GeoDataFeature::PlaceTown: return tr("Town"); + case GeoDataFeature::PlaceVillage: return tr("Village"); + case GeoDataFeature::Mountain: return tr("Mountain"); + case GeoDataFeature::Volcano: return tr("Volcano"); + case GeoDataFeature::Continent: return tr("Continent"); + case GeoDataFeature::Ocean: return tr("Ocean"); + case GeoDataFeature::GeographicPole: return tr("Geographic Pole"); + case GeoDataFeature::MagneticPole: return tr("Magnetic Pole"); + case GeoDataFeature::ShipWreck: return tr("Ship Wreck"); + case GeoDataFeature::AirPort: return tr("Air Port"); + case GeoDataFeature::Observatory: return tr("Observatory"); + case GeoDataFeature::MilitaryDangerArea: return tr("Military Danger Area"); + case GeoDataFeature::OsmSite: return tr("OSM Site"); + case GeoDataFeature::Coordinate: return tr("Coordinate"); + case GeoDataFeature::Folder: return tr("Folder"); + case GeoDataFeature::Bookmark: return tr("Bookmark"); + case GeoDataFeature::NaturalWater: return tr("Water"); + case GeoDataFeature::NaturalReef: return tr("Reef"); + case GeoDataFeature::NaturalWood: return tr("Wood"); + case GeoDataFeature::NaturalBeach: return tr("Beach"); + case GeoDataFeature::NaturalWetland: return tr("Wetland"); + case GeoDataFeature::NaturalGlacier: return tr("Glacier"); + case GeoDataFeature::NaturalIceShelf: return tr("Ice Shelf"); + case GeoDataFeature::NaturalScrub: return tr("Scrub"); + case GeoDataFeature::NaturalCliff: return tr("Cliff"); + case GeoDataFeature::NaturalHeath: return tr("Heath"); + case GeoDataFeature::HighwayTrafficSignals: return tr("Traffic Signals"); + case GeoDataFeature::HighwaySteps: return tr("Steps"); + case GeoDataFeature::HighwayUnknown: return tr("Unknown Road"); + case GeoDataFeature::HighwayPath: return tr("Path"); + case GeoDataFeature::HighwayFootway: return tr("Footway"); + case GeoDataFeature::HighwayTrack: return tr("Track"); + case GeoDataFeature::HighwayPedestrian: return tr("Footway"); + case GeoDataFeature::HighwayCycleway: return tr("Cycleway"); + case GeoDataFeature::HighwayService: return tr("Service Road"); + case GeoDataFeature::HighwayRoad: return tr("Road"); + case GeoDataFeature::HighwayResidential: return tr("Residential Road"); + case GeoDataFeature::HighwayLivingStreet: return tr("Living Street"); + case GeoDataFeature::HighwayUnclassified: return tr("Unclassified Road"); + case GeoDataFeature::HighwayTertiaryLink: return tr("Tertiary Link Road"); + case GeoDataFeature::HighwayTertiary: return tr("Tertiary Road"); + case GeoDataFeature::HighwaySecondaryLink: return tr("Secondary Link Road"); + case GeoDataFeature::HighwaySecondary: return tr("Secondary Road"); + case GeoDataFeature::HighwayPrimaryLink: return tr("Primary Link Road"); + case GeoDataFeature::HighwayPrimary: return tr("Primary Road"); + case GeoDataFeature::HighwayTrunkLink: return tr("Trunk Link Road"); + case GeoDataFeature::HighwayTrunk: return tr("Trunk Road"); + case GeoDataFeature::HighwayMotorwayLink: return tr("Motorway Link Road"); + case GeoDataFeature::HighwayMotorway: return tr("Motorway"); + case GeoDataFeature::Building: return tr("Building"); + case GeoDataFeature::AccomodationCamping: return tr("Camping"); + case GeoDataFeature::AccomodationHostel: return tr("Hostel"); + case GeoDataFeature::AccomodationHotel: return tr("Hotel"); + case GeoDataFeature::AccomodationMotel: return tr("Motel"); + case GeoDataFeature::AccomodationYouthHostel: return tr("Youth Hostel"); + case GeoDataFeature::AccomodationGuestHouse: return tr("Guest House"); + case GeoDataFeature::AmenityLibrary: return tr("Library"); + case GeoDataFeature::AmenityKindergarten: return tr("Kindergarten"); + case GeoDataFeature::EducationCollege: return tr("College"); + case GeoDataFeature::EducationSchool: return tr("School"); + case GeoDataFeature::EducationUniversity: return tr("University"); + case GeoDataFeature::FoodBar: return tr("Bar"); + case GeoDataFeature::FoodBiergarten: return tr("Biergarten"); + case GeoDataFeature::FoodCafe: return tr("Cafe"); + case GeoDataFeature::FoodFastFood: return tr("Fast Food"); + case GeoDataFeature::FoodPub: return tr("Pub"); + case GeoDataFeature::FoodRestaurant: return tr("Restaurant"); + case GeoDataFeature::HealthDentist: return tr("Dentist"); + case GeoDataFeature::HealthDoctors: return tr("Doctors"); + case GeoDataFeature::HealthHospital: return tr("Hospital"); + case GeoDataFeature::HealthPharmacy: return tr("Pharmacy"); + case GeoDataFeature::HealthVeterinary: return tr("Veterinary"); + case GeoDataFeature::MoneyAtm: return tr("ATM"); + case GeoDataFeature::MoneyBank: return tr("Bank"); + case GeoDataFeature::AmenityArchaeologicalSite: return tr("Archaeological Site"); + case GeoDataFeature::AmenityEmbassy: return tr("Embassy"); + case GeoDataFeature::AmenityEmergencyPhone: return tr("Emergency Phone"); + case GeoDataFeature::AmenityWaterPark: return tr("Water Park"); + case GeoDataFeature::AmenityCommunityCentre: return tr("Community Centre"); + case GeoDataFeature::AmenityFountain: return tr("Fountain"); + case GeoDataFeature::AmenityNightClub: return tr("Night Club"); + case GeoDataFeature::AmenityBench: return tr("Bench"); + case GeoDataFeature::AmenityCourtHouse: return tr("Court House"); + case GeoDataFeature::AmenityFireStation: return tr("Fire Station"); + case GeoDataFeature::AmenityHuntingStand: return tr("Hunting Stand"); + case GeoDataFeature::AmenityPolice: return tr("Police"); + case GeoDataFeature::AmenityPostBox: return tr("Post Box"); + case GeoDataFeature::AmenityPostOffice: return tr("Post Office"); + case GeoDataFeature::AmenityPrison: return tr("Prison"); + case GeoDataFeature::AmenityRecycling: return tr("Recycling"); + case GeoDataFeature::AmenityShelter: return tr("Shelter"); + case GeoDataFeature::AmenityTelephone: return tr("Telephone"); + case GeoDataFeature::AmenityToilets: return tr("Toilets"); + case GeoDataFeature::AmenityTownHall: return tr("Town Hall"); + case GeoDataFeature::AmenityWasteBasket: return tr("Waste Basket"); + case GeoDataFeature::AmenityDrinkingWater: return tr("Drinking Water"); + case GeoDataFeature::AmenityGraveyard: return tr("Graveyard"); + case GeoDataFeature::BarrierCityWall: return tr("City Wall"); + case GeoDataFeature::BarrierGate: return tr("Gate"); + case GeoDataFeature::BarrierLiftGate: return tr("Lift Gate"); + case GeoDataFeature::BarrierWall: return tr("Wall"); + case GeoDataFeature::NaturalPeak: return tr("Peak"); + case GeoDataFeature::NaturalTree: return tr("Tree"); + case GeoDataFeature::ShopBeverages: return tr("Beverages"); + case GeoDataFeature::ShopHifi: return tr("Hifi"); + case GeoDataFeature::ShopSupermarket: return tr("Supermarket"); + case GeoDataFeature::ShopAlcohol: return tr("Alcohol"); + case GeoDataFeature::ShopBakery: return tr("Bakery"); + case GeoDataFeature::ShopButcher: return tr("Butcher"); + case GeoDataFeature::ShopConfectionery: return tr("Confectionery"); + case GeoDataFeature::ShopConvenience: return tr("Convenience Shop"); + case GeoDataFeature::ShopGreengrocer: return tr("Greengrocer"); + case GeoDataFeature::ShopSeafood: return tr("Seafood"); + case GeoDataFeature::ShopDepartmentStore: return tr("Department Store"); + case GeoDataFeature::ShopKiosk: return tr("Kiosk"); + case GeoDataFeature::ShopBag: return tr("Bag"); + case GeoDataFeature::ShopClothes: return tr("Clothes"); + case GeoDataFeature::ShopFashion: return tr("Fashion"); + case GeoDataFeature::ShopJewelry: return tr("Jewelry"); + case GeoDataFeature::ShopShoes: return tr("Shoes"); + case GeoDataFeature::ShopVarietyStore: return tr("Variety Store"); + case GeoDataFeature::ShopBeauty: return tr("Beauty"); + case GeoDataFeature::ShopChemist: return tr("Chemist"); + case GeoDataFeature::ShopCosmetics: return tr("Cosmetics"); + case GeoDataFeature::ShopHairdresser: return tr("Hairdresser"); + case GeoDataFeature::ShopOptician: return tr("Optician"); + case GeoDataFeature::ShopPerfumery: return tr("Perfumery"); + case GeoDataFeature::ShopDoitYourself: return tr("Doit Yourself"); + case GeoDataFeature::ShopFlorist: return tr("Florist"); + case GeoDataFeature::ShopHardware: return tr("Hardware"); + case GeoDataFeature::ShopFurniture: return tr("Furniture"); + case GeoDataFeature::ShopElectronics: return tr("Electronics"); + case GeoDataFeature::ShopMobilePhone: return tr("Mobile Phone"); + case GeoDataFeature::ShopBicycle: return tr("Bicycle"); + case GeoDataFeature::ShopCar: return tr("Car"); + case GeoDataFeature::ShopCarRepair: return tr("Car Repair"); + case GeoDataFeature::ShopCarParts: return tr("Car Parts"); + case GeoDataFeature::ShopMotorcycle: return tr("Motorcycle"); + case GeoDataFeature::ShopOutdoor: return tr("Outdoor"); + case GeoDataFeature::ShopMusicalInstrument: return tr("Musical Instrument"); + case GeoDataFeature::ShopPhoto: return tr("Photo"); + case GeoDataFeature::ShopBook: return tr("Book"); + case GeoDataFeature::ShopGift: return tr("Gift"); + case GeoDataFeature::ShopStationery: return tr("Stationery"); + case GeoDataFeature::ShopLaundry: return tr("Laundry"); + case GeoDataFeature::ShopPet: return tr("Pet"); + case GeoDataFeature::ShopToys: return tr("Toys"); + case GeoDataFeature::ShopTravelAgency: return tr("Travel Agency"); + case GeoDataFeature::Shop: return tr("Shop"); + case GeoDataFeature::ManmadeBridge: return tr("Bridge"); + case GeoDataFeature::ManmadeLighthouse: return tr("Lighthouse"); + case GeoDataFeature::ManmadePier: return tr("Pier"); + case GeoDataFeature::ManmadeWaterTower: return tr("Water Tower"); + case GeoDataFeature::ManmadeWindMill: return tr("Wind Mill"); + case GeoDataFeature::TouristAttraction: return tr("Tourist Attraction"); + case GeoDataFeature::TouristCastle: return tr("Castle"); + case GeoDataFeature::TouristCinema: return tr("Cinema"); + case GeoDataFeature::TouristInformation: return tr("Information"); + case GeoDataFeature::TouristMonument: return tr("Monument"); + case GeoDataFeature::TouristMuseum: return tr("Museum"); + case GeoDataFeature::TouristRuin: return tr("Ruin"); + case GeoDataFeature::TouristTheatre: return tr("Theatre"); + case GeoDataFeature::TouristThemePark: return tr("Theme Park"); + case GeoDataFeature::TouristViewPoint: return tr("View Point"); + case GeoDataFeature::TouristZoo: return tr("Zoo"); + case GeoDataFeature::TouristAlpineHut: return tr("Alpine Hut"); + case GeoDataFeature::TransportAerodrome: return tr("Aerodrome"); + case GeoDataFeature::TransportHelipad: return tr("Helipad"); + case GeoDataFeature::TransportAirportTerminal: return tr("Airport Terminal"); + case GeoDataFeature::TransportBusStation: return tr("Bus Station"); + case GeoDataFeature::TransportBusStop: return tr("Bus Stop"); + case GeoDataFeature::TransportCarShare: return tr("Car Sharing"); + case GeoDataFeature::TransportFuel: return tr("Gas Station"); + case GeoDataFeature::TransportParking: return tr("Parking"); + case GeoDataFeature::TransportParkingSpace: return tr("Parking Space"); + case GeoDataFeature::TransportPlatform: return tr("Platform"); + case GeoDataFeature::TransportRentalBicycle: return tr("Rental Bicycle"); + case GeoDataFeature::TransportRentalCar: return tr("Rental Car"); + case GeoDataFeature::TransportTaxiRank: return tr("Taxi Rank"); + case GeoDataFeature::TransportTrainStation: return tr("Train Station"); + case GeoDataFeature::TransportTramStop: return tr("Tram Stop"); + case GeoDataFeature::TransportBicycleParking: return tr("Bicycle Parking"); + case GeoDataFeature::TransportMotorcycleParking: return tr("Motorcycle Parking"); + case GeoDataFeature::TransportSubwayEntrance: return tr("Subway Entrance"); + case GeoDataFeature::ReligionPlaceOfWorship: return tr("Place Of Worship"); + case GeoDataFeature::ReligionBahai: return tr("Bahai"); + case GeoDataFeature::ReligionBuddhist: return tr("Buddhist"); + case GeoDataFeature::ReligionChristian: return tr("Christian"); + case GeoDataFeature::ReligionMuslim: return tr("Muslim"); + case GeoDataFeature::ReligionHindu: return tr("Hindu"); + case GeoDataFeature::ReligionJain: return tr("Jain"); + case GeoDataFeature::ReligionJewish: return tr("Jewish"); + case GeoDataFeature::ReligionShinto: return tr("Shinto"); + case GeoDataFeature::ReligionSikh: return tr("Sikh"); + case GeoDataFeature::LeisureGolfCourse: return tr("Golf Course"); + case GeoDataFeature::LeisureMarina: return tr("Marina"); + case GeoDataFeature::LeisurePark: return tr("Park"); + case GeoDataFeature::LeisurePlayground: return tr("Playground"); + case GeoDataFeature::LeisurePitch: return tr("Pitch"); + case GeoDataFeature::LeisureSportsCentre: return tr("Sports Centre"); + case GeoDataFeature::LeisureStadium: return tr("Stadium"); + case GeoDataFeature::LeisureTrack: return tr("Track"); + case GeoDataFeature::LeisureSwimmingPool: return tr("Swimming Pool"); + case GeoDataFeature::LanduseAllotments: return tr("Allotments"); + case GeoDataFeature::LanduseBasin: return tr("Basin"); + case GeoDataFeature::LanduseCemetery: return tr("Cemetery"); + case GeoDataFeature::LanduseCommercial: return tr("Commercial"); + case GeoDataFeature::LanduseConstruction: return tr("Construction"); + case GeoDataFeature::LanduseFarmland: return tr("Farmland"); + case GeoDataFeature::LanduseFarmyard: return tr("Farmyard"); + case GeoDataFeature::LanduseGarages: return tr("Garages"); + case GeoDataFeature::LanduseGrass: return tr("Grass"); + case GeoDataFeature::LanduseIndustrial: return tr("Industrial"); + case GeoDataFeature::LanduseLandfill: return tr("Landfill"); + case GeoDataFeature::LanduseMeadow: return tr("Meadow"); + case GeoDataFeature::LanduseMilitary: return tr("Military"); + case GeoDataFeature::LanduseQuarry: return tr("Quarry"); + case GeoDataFeature::LanduseRailway: return tr("Railway"); + case GeoDataFeature::LanduseReservoir: return tr("Reservoir"); + case GeoDataFeature::LanduseResidential: return tr("Residential"); + case GeoDataFeature::LanduseRetail: return tr("Retail"); + case GeoDataFeature::LanduseOrchard: return tr("Orchard"); + case GeoDataFeature::LanduseVineyard: return tr("Vineyard"); + case GeoDataFeature::RailwayRail: return tr("Rail"); + case GeoDataFeature::RailwayNarrowGauge: return tr("Narrow Gauge"); + case GeoDataFeature::RailwayTram: return tr("Tram"); + case GeoDataFeature::RailwayLightRail: return tr("Light Rail"); + case GeoDataFeature::RailwayAbandoned: return tr("Abandoned Railway"); + case GeoDataFeature::RailwaySubway: return tr("Subway"); + case GeoDataFeature::RailwayPreserved: return tr("Preserved Railway"); + case GeoDataFeature::RailwayMiniature: return tr("Miniature Railway"); + case GeoDataFeature::RailwayConstruction: return tr("Railway Construction"); + case GeoDataFeature::RailwayMonorail: return tr("Monorail"); + case GeoDataFeature::RailwayFunicular: return tr("Funicular Railway"); + case GeoDataFeature::PowerTower: return tr("Power Tower"); + case GeoDataFeature::Satellite: return tr("Satellite"); + case GeoDataFeature::AdminLevel1: return tr("Admin Boundary (Level 1)"); + case GeoDataFeature::AdminLevel2: return tr("Admin Boundary (Level 2)"); + case GeoDataFeature::AdminLevel3: return tr("Admin Boundary (Level 3)"); + case GeoDataFeature::AdminLevel4: return tr("Admin Boundary (Level 4)"); + case GeoDataFeature::AdminLevel5: return tr("Admin Boundary (Level 5)"); + case GeoDataFeature::AdminLevel6: return tr("Admin Boundary (Level 6)"); + case GeoDataFeature::AdminLevel7: return tr("Admin Boundary (Level 7)"); + case GeoDataFeature::AdminLevel8: return tr("Admin Boundary (Level 8)"); + case GeoDataFeature::AdminLevel9: return tr("Admin Boundary (Level 9)"); + case GeoDataFeature::AdminLevel10: return tr("Admin Boundary (Level 10)"); + case GeoDataFeature::AdminLevel11: return tr("Admin Boundary (Level 11)"); + case GeoDataFeature::BoundaryMaritime: return tr("Boundary (Maritime)"); + case GeoDataFeature::Landmass: return tr("Land Mass"); + case GeoDataFeature::UrbanArea: return tr("Urban Area"); + case GeoDataFeature::InternationalDateLine: return tr("International Date Line"); + case GeoDataFeature::Bathymetry: return tr("Bathymetry"); + case GeoDataFeature::Valley: return tr("Valley"); + case GeoDataFeature::OtherTerrain: return tr("Terrain"); + case GeoDataFeature::Crater: return tr("Crater"); + case GeoDataFeature::Mare: return tr("Sea"); + case GeoDataFeature::MannedLandingSite: return tr("Manned Landing Site"); + case GeoDataFeature::RoboticRover: return tr("Robotic Rover"); + case GeoDataFeature::UnmannedSoftLandingSite: return tr("Unmanned Soft Landing Site"); + case GeoDataFeature::UnmannedHardLandingSite: return tr("Unmanned Hard Landing Site"); + case GeoDataFeature::Mons: return tr("Mountain"); + case GeoDataFeature::Default: + case GeoDataFeature::Unknown: + case GeoDataFeature::None: + case GeoDataFeature::LastIndex: return QString(); + } + + return QString(); + } + + QString m_name; // Name of the feature. Is shown on screen GeoDataSnippet m_snippet; // Snippet of the feature. QString m_description; // A longer textual description bool m_descriptionCDATA; // True if description should be considered CDATA QString m_address; // The address. Optional QString m_phoneNumber; // Phone Optional QString m_styleUrl; // styleUrl Url#tag to a document wide style GeoDataAbstractView* m_abstractView; // AbstractView Optional qint64 m_popularity; // Population/Area/Altitude depending on placemark(!) int m_zoomLevel; // Zoom Level of the feature bool m_visible; // True if this feature should be shown. GeoDataFeature::GeoDataVisualCategory m_visualCategory; // the visual category QString m_role; GeoDataStyle::Ptr m_style; const GeoDataStyleMap* m_styleMap; GeoDataExtendedData m_extendedData; GeoDataTimeSpan m_timeSpan; GeoDataTimeStamp m_timeStamp; GeoDataRegion m_region; QAtomicInt ref; // Static members static const QSharedPointer s_defaultStyle; }; } // namespace Marble #endif