diff -r 000000000000 -r b2224ebf331f mapobj.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mapobj.h Mon Oct 06 12:28:25 2008 +0000 @@ -0,0 +1,48 @@ +#ifndef MAPOBJ_H +#define MAPOBJ_H + +#include +#include + +#include "misc.h" + +using namespace std; + +#define Z_BBOX 0 +#define Z_LINK 20 +#define Z_FRAME 50 +#define Z_SELBOX 60 +#define Z_ICON 80 +#define Z_TEXT 100 + +class MapObj:public xmlObj { +public: + MapObj (); + MapObj (QCanvas*); + MapObj (MapObj*); + virtual ~MapObj (); + virtual void init (); + virtual void copy (MapObj*); + virtual QCanvas* getCanvas(); + virtual int x(); + virtual int y(); + virtual int width(); + virtual int height(); + virtual void move (double x,double y); // move to absolute Position + virtual void moveBy (double x,double y); // move to relative Position + virtual bool inBBox(QPoint); // Check if Point is in bbox + virtual QRect getBBox(); // returns bounding box + virtual QRect addBBox(QRect,QRect); // returns bbox which includes both boxes + virtual QSize getSize(); // returns size of bounding box + virtual bool isVisibleObj(); + virtual void setVisibility(bool); +protected: + QCanvas* canvas; + QRect bbox; // bounding box of MO itself + virtual void positionBBox()=0; + virtual void calcBBoxSize()=0; + QPoint absPos; // Position on canvas + bool visible; +}; + +#endif