Added Israleli grid projection
[GPXSee.git] / src / GUI / mapitem.h
blobb76e157d715771dfefc1d3d3ab5d7daa69883a78
1 #ifndef MAPITEM_H
2 #define MAPITEM_H
4 #include "planeitem.h"
6 class MapAction;
7 class Projection;
9 class MapItem : public QObject, public PlaneItem
11 Q_OBJECT
13 public:
14 MapItem(MapAction *action, Map *map, GraphicsItem *parent = 0);
16 QPainterPath shape() const {return _painterPath;}
17 QRectF boundingRect() const {return _painterPath.boundingRect();}
18 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
19 QWidget *widget);
21 RectC bounds() const {return _bounds;}
22 void setMap(Map *map);
24 void setColor(const QColor &color);
25 void setOpacity(qreal opacity);
26 void setWidth(qreal width);
27 void setPenStyle(Qt::PenStyle style);
28 void setDigitalZoom(int zoom);
30 ToolTip info(bool extended) const;
32 signals:
33 void triggered();
35 protected:
36 void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
37 void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
38 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
40 private:
41 void updatePainterPath(Map *map);
43 RectC _bounds;
44 QString _name;
45 QString _fileName;
47 int _digitalZoom;
49 qreal _width;
50 QPen _pen;
51 QBrush _brush;
52 qreal _opacity;
54 QPainterPath _painterPath;
57 #endif // MAPITEM_H