From kde-commits Mon Oct 03 14:10:49 2016 From: Bernhard Beschow Date: Mon, 03 Oct 2016 14:10:49 +0000 To: kde-commits Subject: [marble] src/lib/marble/geodata/graphicsitem: pass the point upon construction Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147550386032397 Git commit fabf916f54939db7ef5a851bdeab7bc97bfd84bd by Bernhard Beschow. Committed on 03/10/2016 at 13:17. Pushed by beschow into branch 'master'. pass the point upon construction M +7 -15 src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp M +4 -6 src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.h http://commits.kde.org/marble/fabf916f54939db7ef5a851bdeab7bc97bfd84bd diff --git a/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp b= /src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp index 87c869b..c9e46a1 100644 --- a/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp +++ b/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp @@ -10,15 +10,17 @@ = #include "GeoPointGraphicsItem.h" = -#include "GeoPainter.h" #include "GeoDataFeature.h" +#include "GeoDataPoint.h" +#include "GeoPainter.h" #include "StyleBuilder.h" = namespace Marble { = -GeoPointGraphicsItem::GeoPointGraphicsItem( const GeoDataFeature *feature ) - : GeoGraphicsItem( feature ) +GeoPointGraphicsItem::GeoPointGraphicsItem(const GeoDataFeature *feature ,= const GeoDataPoint *point) : + GeoGraphicsItem(feature), + m_point(point) { if (feature) { QString const paintLayer =3D QLatin1String("Point/") + StyleBuilde= r::visualCategoryName(feature->visualCategory()); @@ -26,26 +28,16 @@ GeoPointGraphicsItem::GeoPointGraphicsItem( const GeoDa= taFeature *feature ) } } = -void GeoPointGraphicsItem::setPoint( const GeoDataPoint& point ) -{ - m_point =3D point; -} - -GeoDataPoint GeoPointGraphicsItem::point() const -{ - return m_point; -} - void GeoPointGraphicsItem::paint(GeoPainter* painter, const ViewportParams= * viewport , const QString &layer) { Q_UNUSED(viewport); Q_UNUSED(layer); - painter->drawPoint( m_point ); + painter->drawPoint(*m_point); } = const GeoDataLatLonAltBox& GeoPointGraphicsItem::latLonAltBox() const { - return m_point.latLonAltBox(); + return m_point->latLonAltBox(); } = } diff --git a/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.h b/s= rc/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.h index fb62bb9..cba189f 100644 --- a/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.h +++ b/src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.h @@ -11,27 +11,25 @@ #ifndef MARBLE_GEOPOINTGRAPHICSITEM_H #define MARBLE_GEOPOINTGRAPHICSITEM_H = -#include "GeoDataPoint.h" #include "GeoGraphicsItem.h" #include "marble_export.h" = namespace Marble { = +class GeoDataPoint; + class MARBLE_EXPORT GeoPointGraphicsItem : public GeoGraphicsItem { public: - explicit GeoPointGraphicsItem( const GeoDataFeature *feature ); + explicit GeoPointGraphicsItem(const GeoDataFeature *feature, const Geo= DataPoint *point); = - void setPoint( const GeoDataPoint& point ); - GeoDataPoint point() const; - = virtual void paint(GeoPainter* painter, const ViewportParams *viewport= , const QString &layer); = virtual const GeoDataLatLonAltBox& latLonAltBox() const; = protected: - GeoDataPoint m_point; + const GeoDataPoint *m_point; }; = }