4 #include <QGraphicsScene>
5 #include <QGraphicsItem>
17 #define Z_LINEEDIT 110
23 /*! \brief Base class for all objects visible on a map
26 class MapObj:public XMLObj {
29 MapObj (QGraphicsScene *scene,TreeItem *ti=NULL);
33 virtual void copy (MapObj*);
35 virtual void setTreeItem(TreeItem *);
36 virtual TreeItem* getTreeItem() const;
38 virtual QGraphicsScene* getScene();
41 virtual qreal width();
42 virtual qreal height();
43 virtual QPointF getAbsPos();
44 virtual QString getPos(); //! Return position as string (x,y)
45 virtual void move (double x,double y); //! move to absolute Position
46 virtual void move (QPointF p);
47 virtual void moveBy (double x,double y); //! move to relative Position
48 virtual QRectF getBBox(); //! returns bounding box
49 virtual ConvexPolygon getBoundingPolygon(); //! return bounding convex polygon
50 virtual QRectF getClickBox(); //! returns box to click
51 virtual bool isInClickBox (const QPointF &p); //! Checks if p is in clickBox
52 virtual QSizeF getSize(); //! returns size of bounding box
53 virtual bool isVisibleObj();
54 virtual void setVisibility(bool);
55 virtual void positionBBox()=0;
56 virtual void calcBBoxSize()=0;
58 QGraphicsScene* scene;
59 QRectF bbox; // bounding box of MO itself
60 QRectF clickBox; // area where mouseclicks are found
61 QPointF absPos; // Position on canvas
64 TreeItem *treeItem; //! Crossrefence to treemodel
66 QGraphicsPolygonItem *pi; //FIXME-3 testing only