geographicsellipseitem.h 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#ifndef GEOGRAPHICSELLIPSEITEM_H
#define GEOGRAPHICSELLIPSEITEM_H

#include <QGraphicsEllipseItem>
#include "geoitembase.h"
namespace QTVP_GEOMARKER{
	class geoGraphicsEllipseItem : public QGraphicsEllipseItem, public geoItemBase
	{
	protected:
		qreal m_lat;
		qreal m_lon;
		qreal m_width;
		qreal m_height;
	protected:
		void mousePressEvent(QGraphicsSceneMouseEvent * event);
16
		void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * event);
17 18
		void hoverEnterEvent(QGraphicsSceneHoverEvent * event);
		void hoverLeaveEvent(QGraphicsSceneHoverEvent * event);
19 20 21 22 23 24 25 26 27 28 29 30
	public:
		explicit geoGraphicsEllipseItem(QString name,QTVOSM::viewer_interface * pVi,
							   qreal cent_lat = 90,
							   qreal cent_lon = 0,
							   qreal pxwidth = 8,
							   qreal pxheight = 8);
	public:
		qreal lat() const {return m_lat;}
		qreal lon() const {return m_lon;}
		qreal width() const {return m_width;}
		qreal height() const {return m_height;}
		void setSize(qreal pxwidth,qreal pxheight);
31
		void setGeo(qreal cent_lat,qreal cent_lon);
32 33
		void adjust_coords(int nNewLevel);
		QPointF label_pos();
34
		QPointF center_pos(){return rect().center();}
35 36 37
	};
}
#endif // GEOGRAPHICSELLIPSEITEM_H