Changeset View
Changeset View
Standalone View
Standalone View
src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
1 | // | 1 | // | ||
---|---|---|---|---|---|
2 | // This file is part of the Marble Virtual Globe. | 2 | // This file is part of the Marble Virtual Globe. | ||
3 | // | 3 | // | ||
4 | // This program is free software licensed under the GNU LGPL. You can | 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 | 5 | // find a copy of this license in LICENSE.txt in the top directory of | ||
6 | // the source code. | 6 | // the source code. | ||
7 | // | 7 | // | ||
8 | // Copyright 2011 Konstantin Oblaukhov <oblaukhov.konstantin@gmail.com> | 8 | // Copyright 2011 Konstantin Oblaukhov <oblaukhov.konstantin@gmail.com> | ||
9 | // | 9 | // | ||
10 | 10 | | |||
11 | #include "GeoPolygonGraphicsItem.h" | 11 | #include "GeoPolygonGraphicsItem.h" | ||
12 | 12 | | |||
13 | #include "BuildingGeoPolygonGraphicsItem.h" | 13 | #include "BuildingGraphicsItem.h" | ||
14 | #include "GeoDataPlacemark.h" | 14 | #include "GeoDataPlacemark.h" | ||
15 | #include "StyleBuilder.h" | 15 | #include "StyleBuilder.h" | ||
16 | 16 | | |||
17 | namespace Marble | 17 | namespace Marble | ||
18 | { | 18 | { | ||
19 | 19 | | |||
20 | AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon) | 20 | AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon) | ||
21 | { | 21 | { | ||
22 | if (placemark->visualCategory() == GeoDataPlacemark::Building) { | | |||
23 | return new BuildingGeoPolygonGraphicsItem(placemark, polygon); | | |||
24 | } | | |||
25 | return new GeoPolygonGraphicsItem(placemark, polygon); | 22 | return new GeoPolygonGraphicsItem(placemark, polygon); | ||
26 | } | 23 | } | ||
27 | 24 | | |||
28 | AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataLinearRing *ring) | 25 | AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataLinearRing *ring) | ||
29 | { | 26 | { | ||
30 | if (placemark->visualCategory() == GeoDataPlacemark::Building) { | | |||
31 | return new BuildingGeoPolygonGraphicsItem(placemark, ring); | | |||
32 | } | | |||
33 | return new GeoPolygonGraphicsItem(placemark, ring); | 27 | return new GeoPolygonGraphicsItem(placemark, ring); | ||
34 | } | 28 | } | ||
35 | 29 | | |||
30 | AbstractGeoPolygonGraphicsItem *GeoPolygonGraphicsItem::createGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataBuilding *building) | ||||
31 | { | ||||
32 | return new BuildingGraphicsItem(placemark, building); | ||||
33 | } | ||||
36 | 34 | | |||
37 | GeoPolygonGraphicsItem::GeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon) : | 35 | GeoPolygonGraphicsItem::GeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon) : | ||
38 | AbstractGeoPolygonGraphicsItem(placemark, polygon) | 36 | AbstractGeoPolygonGraphicsItem(placemark, polygon) | ||
39 | { | 37 | { | ||
40 | const int elevation = extractElevation(*placemark); | 38 | const int elevation = extractElevation(*placemark); | ||
41 | setZValue(zValue() + elevation); | 39 | setZValue(zValue() + elevation); | ||
42 | 40 | | |||
43 | const GeoDataPlacemark::GeoDataVisualCategory visualCategory = placemark->visualCategory(); | 41 | const GeoDataPlacemark::GeoDataVisualCategory visualCategory = placemark->visualCategory(); | ||
Show All 16 Lines |