#ifndef GEOFENCEITEMLINE_H #define GEOFENCEITEMLINE_H #include #include #include #include "pointlatlng.h" #include "mapgraphicitem.h" #include "waypointitem.h" #include #include #include "geoFenceitem.h" namespace mapcontrol { #ifdef QtopmapWidget #include class OPMAPWIDGETSHARED_EXPORT geoFenceitemline : public QObject, public QGraphicsLineItem { #else class geoFenceitemline : public QObject, public QGraphicsLineItem { #endif Q_OBJECT Q_INTERFACES(QGraphicsItem) public: enum { Type = UserType + 12 }; geoFenceitemline(geoFenceitem *from, geoFenceitem *to, MapGraphicItem *map, QColor color = Qt::green, bool dashed = false, int width = 3); int type() const; QPainterPath shape() const; void setColor(const QColor &color) { myColor = color; } void setEdit(bool value); bool Edit(void) { return isEdit; } private: QGraphicsItem *source; QGraphicsItem *destination; MapGraphicItem *my_map; QPolygonF arrowHead; QColor myColor; bool dashed; int lineWidth; protected: void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); public slots: QGraphicsItem *WPLineFrom(void) { return this->source; } QGraphicsItem *WPLineTo(void) { return this->destination; } void WPLinedelete(geoFenceitem *from, geoFenceitem *to); void refreshLocations(); void waypointdeleted(); void setOpacitySlot(qreal opacity); private: bool isEdit = false; }; } #endif