4 #include <QGraphicsItem>
8 #define dZ_BBOX 0 // testing
10 #define dZ_FRAME_LOW 10
13 #define dZ_FLOATIMG 70
19 #define Z_LINEEDIT 10000
25 /*! \brief Base class for all objects visible on a map
28 class MapObj : public XMLObj, public QGraphicsItem {
30 MapObj(QGraphicsItem *parent = NULL, TreeItem *ti = NULL);
33 virtual void copy(MapObj *);
35 virtual void setTreeItem(TreeItem *);
36 virtual TreeItem *getTreeItem() const;
40 virtual qreal width();
41 virtual qreal height();
42 virtual QPointF getAbsPos();
43 virtual QString getPos(); //! Return position as string (x,y)
44 virtual void move(double x, double y); //! move to absolute Position
45 virtual void move(QPointF p);
46 virtual void moveBy(double x, double y); //! move to relative Position
48 virtual QRectF boundingRect() const;
49 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
51 virtual QRectF getBBox(); //! returns bounding box
53 getBoundingPolygon(); //! return bounding convex polygon
54 virtual QPolygonF getClickPoly(); //! returns polygon to click
55 virtual QPainterPath getSelectionPath(); //! returns path for selection
56 virtual bool isInClickBox(const QPointF &p); //! Checks if p is in clickBox
57 virtual QSizeF getSize(); //! returns size of bounding box
59 virtual void setRotation(const qreal &a);
60 virtual qreal getRotation();
61 virtual bool isVisibleObj();
62 virtual void setVisibility(bool);
63 virtual void positionBBox();
64 virtual void calcBBoxSize();
67 QRectF bbox; // bounding box of MO itself
68 QPolygonF clickPoly; // area where mouseclicks are found
69 QPointF absPos; // Position on canvas
72 qreal angle; //! Rotation angle
74 TreeItem *treeItem; //! Crossrefence to treemodel