summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-10-03 11:40:18 (GMT)
committerBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-10-03 13:17:35 (GMT)
commitfabf916f54939db7ef5a851bdeab7bc97bfd84bd (patch)
treed5923d9d310c4b52d42210bbbaa89ffdf88946b6
parent5e3ee3cbcf73bc0712e7da1e8be537e7614759c5 (diff)
pass the point upon construction
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp22
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.h10
2 files changed, 11 insertions, 21 deletions
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 = QLatin1String("Point/") + StyleBuilder::visualCategoryName(feature->visualCategory());
@@ -26,26 +28,16 @@ GeoPointGraphicsItem::GeoPointGraphicsItem( const GeoDataFeature *feature )
}
}
-void GeoPointGraphicsItem::setPoint( const GeoDataPoint& point )
-{
- m_point = 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/src/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 GeoDataPoint *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;
};
}