Changeset View
Changeset View
Standalone View
Standalone View
src/lib/marble/osm/OsmObjectManager.cpp
Context not available. | |||||
15 | #include "GeoDataPlacemark.h" | 15 | #include "GeoDataPlacemark.h" | ||
---|---|---|---|---|---|
16 | #include "GeoDataLinearRing.h" | 16 | #include "GeoDataLinearRing.h" | ||
17 | #include "GeoDataPolygon.h" | 17 | #include "GeoDataPolygon.h" | ||
18 | #include "GeoDataBuilding.h" | ||||
19 | #include "GeoDataMultiGeometry.h" | ||||
18 | #include "osm/OsmPlacemarkData.h" | 20 | #include "osm/OsmPlacemarkData.h" | ||
19 | 21 | | |||
20 | namespace Marble { | 22 | namespace Marble { | ||
Context not available. | |||||
44 | } | 46 | } | ||
45 | } | 47 | } | ||
46 | 48 | | |||
49 | const auto building = geodata_cast<GeoDataBuilding>(placemark->geometry()); | ||||
50 | | ||||
51 | GeoDataLinearRing* lineString; | ||||
52 | if (building) { | ||||
53 | lineString = geodata_cast<GeoDataLinearRing>(&building->multiGeometry()->at(0)); | ||||
54 | } else { | ||||
55 | lineString = geodata_cast<GeoDataLinearRing>(placemark->geometry()); | ||||
56 | } | ||||
47 | // Assigning osmData to each of the line's nodes ( if they don't already have data ) | 57 | // Assigning osmData to each of the line's nodes ( if they don't already have data ) | ||
48 | if (const auto lineString = geodata_cast<GeoDataLinearRing>(placemark->geometry())) { | 58 | if (lineString) { | ||
49 | for (auto it =lineString->constBegin(), end = lineString->constEnd(); it != end; ++it ) { | 59 | for (auto it =lineString->constBegin(), end = lineString->constEnd(); it != end; ++it ) { | ||
50 | if (osmData.nodeReference(*it).isNull()) { | 60 | if (osmData.nodeReference(*it).isNull()) { | ||
51 | osmData.nodeReference(*it).setId(--m_minId); | 61 | osmData.nodeReference(*it).setId(--m_minId); | ||
Context not available. | |||||
53 | } | 63 | } | ||
54 | } | 64 | } | ||
55 | 65 | | |||
66 | GeoDataPolygon* polygon; | ||||
67 | if (building) { | ||||
68 | polygon = geodata_cast<GeoDataPolygon>(&building->multiGeometry()->at(0)); | ||||
69 | } else { | ||||
70 | polygon = geodata_cast<GeoDataPolygon>(placemark->geometry()); | ||||
71 | } | ||||
56 | // Assigning osmData to each of the polygons boundaries, and to each of the | 72 | // Assigning osmData to each of the polygons boundaries, and to each of the | ||
57 | // nodes that are part of those boundaries ( if they don't already have data ) | 73 | // nodes that are part of those boundaries ( if they don't already have data ) | ||
58 | if (const auto polygon = geodata_cast<GeoDataPolygon>(placemark->geometry())) { | 74 | if (polygon) { | ||
59 | const GeoDataLinearRing &outerBoundary = polygon->outerBoundary(); | 75 | const GeoDataLinearRing &outerBoundary = polygon->outerBoundary(); | ||
60 | int index = -1; | 76 | int index = -1; | ||
61 | if ( isNull ) { | 77 | if ( isNull ) { | ||
Context not available. |