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;
46 virtual void animate(); // called by timer for animated objects
48 QGraphicsScene* scene;
49 QRectF bbox; // bounding box of MO itself
50 QRectF clickBox; // area where mouseclicks are found
51 QPointF absPos; // Position on canvas