QGC2DIcon.h 882 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#ifndef QGC2DICON_H
#define QGC2DICON_H

#include <QGraphicsItem>
#include <QPointF>

class QGC2DIcon : public QGraphicsItem
{
public:
    QGC2DIcon(QPointF localOriginInGlobalCoords, bool onlyLocal=false, QGraphicsItem* parent = 0);
    QGC2DIcon(bool onlyLocal=false, QGraphicsItem* parent = 0);
    explicit QGC2DIcon(QGraphicsItem* parent = 0);
    ~QGC2DIcon();

    QPointF getGlobalPosition();
    QPointF getLocalPosition();

    void setGlobalPosition(QPointF pos);
    void setLocalPosition(QPointF pos);
    void setLocalPosition(float x, float y);

    bool isLocal();
    virtual QRectF boundingRect() const = 0;
    virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) = 0;

signals:

public slots:

protected:
    QPointF localOriginInGlobalCoords;
    QPointF globalPosition;
    QPointF localPosition;
    bool local;

};

#endif // QGC2DICON_H