1.11.2 split up of xml helper functions. started to work on attributes
4 #include <QGraphicsScene>
5 #include <QGraphicsItem>
21 /*! \brief Base class for all objects visible on a map
24 class MapObj:public XMLObj {
27 MapObj (QGraphicsScene*);
31 virtual void copy (MapObj*);
32 virtual QGraphicsScene* getScene();
35 virtual qreal width();
36 virtual qreal height();
37 virtual QPointF getAbsPos();
38 virtual QString getPos(); // Return position as string (x,y)
39 virtual void move (double x,double y); // move to absolute Position
40 virtual void move (QPointF p);
41 virtual void moveBy (double x,double y); // move to relative Position
42 virtual bool inBox(const QPointF&); // Check if Point is within clickbox
43 virtual QRectF getBBox(); // returns bounding box
44 virtual QRectF addBBox(QRectF,QRectF); // returns bbox which includes both boxes
45 virtual QSizeF getSize(); // returns size of bounding box
46 virtual bool isVisibleObj();
47 virtual void setVisibility(bool);
48 virtual void positionBBox()=0;
49 virtual void calcBBoxSize()=0;
50 virtual void animate(); // called by timer for animated objects
52 QGraphicsScene* scene;
53 QRectF bbox; // bounding box of MO itself
54 QRectF clickBox; // area where mouseclicks are found
55 QPointF absPos; // Position on canvas