Commit fabf916f authored by Bernhard Beschow's avatar Bernhard Beschow
Browse files

pass the point upon construction

parent 5e3ee3cb
......@@ -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();
}
}
......@@ -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;
};
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment