mapobj.h
author insilmaril
Tue Jun 03 08:34:56 2008 +0000 (2008-06-03)
changeset 710 e2c23e0cefc0
parent 645 2abfdb7e85f4
child 754 db0ec4bcf416
permissions -rw-r--r--
Workaround for unreadable file with Qt 4.4
     1 #ifndef MAPOBJ_H
     2 #define MAPOBJ_H
     3 
     4 #include <QGraphicsScene>
     5 #include <QGraphicsItem>
     6 
     7 #include "xmlobj.h"
     8 
     9 #define Z_BBOX      0
    10 #define Z_XLINK    10
    11 #define Z_LINK     20
    12 #define Z_FRAME    50
    13 #define Z_SELBOX   60
    14 #define Z_FLOATIMG 65
    15 #define Z_ICON     80
    16 #define Z_TEXT    100
    17 
    18 /*! \brief Base class for all objects visible on a map
    19 */
    20 
    21 class MapObj:public XMLObj {
    22 public:
    23     MapObj ();
    24     MapObj (QGraphicsScene*);
    25     MapObj (MapObj*);
    26     virtual ~MapObj ();
    27     virtual void init ();
    28     virtual void copy (MapObj*);
    29 	virtual QGraphicsScene* getScene();
    30     virtual qreal x();
    31     virtual qreal y();
    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 protected:  
    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
    51     bool visible;
    52 };
    53 
    54 #endif