4 #include <QGraphicsScene>
5 #include <QGraphicsItem>
18 /*! \brief Base class for all objects visible on a map
21 class MapObj:public XMLObj {
24 MapObj (QGraphicsScene*);
28 virtual void copy (MapObj*);
29 virtual QGraphicsScene* getScene();
32 virtual qreal width();
33 virtual qreal height();
34 virtual QPointF getAbsPos();
35 virtual QString getPos(); // Return position as string (x,y)
36 virtual void move (double x,double y); // move to absolute Position
37 virtual void move (QPointF p);
38 virtual void moveBy (double x,double y); // move to relative Position
39 virtual QRectF getBBox(); // returns bounding box
40 virtual QRectF getClickBox(); // returns box to click
41 virtual QSizeF getSize(); // returns size of bounding box
42 virtual bool isVisibleObj();
43 virtual void setVisibility(bool);
44 virtual void positionBBox()=0;
45 virtual void calcBBoxSize()=0;
47 QGraphicsScene* scene;
48 QRectF bbox; // bounding box of MO itself
49 QRectF clickBox; // area where mouseclicks are found
50 QPointF absPos; // Position on canvas