geographicspolygonitem.h 943 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#ifndef GEOGRAPHICSPOLYGONITEM_H
#define GEOGRAPHICSPOLYGONITEM_H

#include <QGraphicsPolygonItem>
#include <QPolygonF>
#include "geoitembase.h"
namespace QTVP_GEOMARKER{
	class geoGraphicsPolygonItem : public QGraphicsPolygonItem, public geoItemBase
	{
	protected:
		QPolygonF m_llap;
		void unwarrp();
	protected:
		void mousePressEvent(QGraphicsSceneMouseEvent * event);
15
		void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * event);
16 17
		void hoverEnterEvent(QGraphicsSceneHoverEvent * event);
		void hoverLeaveEvent(QGraphicsSceneHoverEvent * event);
18 19 20 21 22 23
	public:
		explicit geoGraphicsPolygonItem(QString name,QTVOSM::viewer_interface * pVi,
									 const QPolygonF & lla_polygon
				);
	public:
		QPolygonF llas() const {return m_llap;}
24
		void setGeo(const QPolygonF & lla_polygon);
25 26
		void adjust_coords(int nNewLevel);
		QPointF label_pos();
27
		QPointF center_pos(){return this->polygon().first();}
28 29 30
	};
}
#endif // GEOGRAPHICSPOLYGONITEM_H