Changeset View
Changeset View
Standalone View
Standalone View
src/lib/marble/geodata/graphicsitem/AbstractGeoPolygonGraphicsItem.h
Show All 17 Lines | |||||
18 | #include <QColor> | 18 | #include <QColor> | ||
19 | 19 | | |||
20 | namespace Marble | 20 | namespace Marble | ||
21 | { | 21 | { | ||
22 | 22 | | |||
23 | class GeoDataLinearRing; | 23 | class GeoDataLinearRing; | ||
24 | class GeoDataPlacemark; | 24 | class GeoDataPlacemark; | ||
25 | class GeoDataPolygon; | 25 | class GeoDataPolygon; | ||
26 | class GeoDataBuilding; | ||||
26 | 27 | | |||
27 | class MARBLE_EXPORT AbstractGeoPolygonGraphicsItem : public GeoGraphicsItem | 28 | class MARBLE_EXPORT AbstractGeoPolygonGraphicsItem : public GeoGraphicsItem | ||
28 | { | 29 | { | ||
29 | protected: | 30 | protected: | ||
30 | explicit AbstractGeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon); | 31 | AbstractGeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataPolygon *polygon); | ||
31 | explicit AbstractGeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataLinearRing *ring); | 32 | AbstractGeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataLinearRing *ring); | ||
33 | AbstractGeoPolygonGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataBuilding *building); | ||||
rahn: Should these really be marked explicit? Although C++11 allows for implicit conversion for more… | |||||
32 | ~AbstractGeoPolygonGraphicsItem() override; | 34 | ~AbstractGeoPolygonGraphicsItem() override; | ||
33 | 35 | | |||
34 | public: | 36 | public: | ||
35 | const GeoDataLatLonAltBox& latLonAltBox() const override; | 37 | const GeoDataLatLonAltBox& latLonAltBox() const override; | ||
36 | void paint(GeoPainter* painter, const ViewportParams *viewport, const QString &layer, int tileZoomLevel) override; | 38 | void paint(GeoPainter* painter, const ViewportParams *viewport, const QString &layer, int tileZoomLevel) override; | ||
37 | bool contains(const QPoint &screenPosition, const ViewportParams *viewport) const override; | 39 | bool contains(const QPoint &screenPosition, const ViewportParams *viewport) const override; | ||
38 | 40 | | |||
41 | void setLinearRing(GeoDataLinearRing* ring); | ||||
42 | void setPolygon(GeoDataPolygon* polygon); | ||||
43 | | ||||
39 | static const void *s_previousStyle; | 44 | static const void *s_previousStyle; | ||
40 | 45 | | |||
41 | protected: | 46 | protected: | ||
42 | bool configurePainter(GeoPainter* painter, const ViewportParams *viewport); | 47 | bool configurePainter(GeoPainter* painter, const ViewportParams *viewport); | ||
43 | inline | 48 | inline | ||
44 | const GeoDataPolygon *polygon() const { return m_polygon; } | 49 | const GeoDataPolygon *polygon() const { return m_polygon; } | ||
45 | inline | 50 | inline | ||
46 | const GeoDataLinearRing *ring() const { return m_ring; } | 51 | const GeoDataLinearRing *ring() const { return m_ring; } | ||
52 | inline | ||||
53 | const GeoDataBuilding *building() const { return m_building; } | ||||
47 | 54 | | |||
48 | static int extractElevation(const GeoDataPlacemark &placemark); | 55 | static int extractElevation(const GeoDataPlacemark &placemark); | ||
49 | 56 | | |||
50 | private: | 57 | private: | ||
51 | QPixmap texture(const QString &path, const QColor &color); | 58 | QPixmap texture(const QString &path, const QColor &color); | ||
52 | 59 | | |||
53 | const GeoDataPolygon *const m_polygon; | 60 | const GeoDataPolygon * m_polygon; | ||
54 | const GeoDataLinearRing *const m_ring; | 61 | const GeoDataLinearRing * m_ring; | ||
62 | const GeoDataBuilding *const m_building; | ||||
55 | }; | 63 | }; | ||
56 | 64 | | |||
57 | } | 65 | } | ||
58 | 66 | | |||
59 | #endif | 67 | #endif |
Should these really be marked explicit? Although C++11 allows for implicit conversion for more than a single parameter that case isn't practically relevant I guess.