[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [marble] src/lib/marble/geodata/graphicsitem: pass the point upon construction
From: Bernhard Beschow <bbeschow () cs ! tu-berlin ! de>
Date: 2016-10-03 14:10:49
Message-ID: E1br3xB-0005FV-Af () code ! kde ! org
[Download RAW message or body]
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 = 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;
};
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic