author | insilmaril |
Wed, 30 Jul 2008 14:42:03 +0000 | |
branch | release-1-12-maintained |
changeset 43 | cf274b28e5fe |
parent 0 | 7a96bd401351 |
child 2 | 608f976aa7bb |
child 129 | 9b9c7e8b9147 |
permissions | -rw-r--r-- |
1 #ifndef MAPOBJ_H
2 #define MAPOBJ_H
4 #include <qcanvas.h>
5 #include <iostream>
7 #include "misc.h"
9 using namespace std;
11 #define Z_BBOX 0
12 #define Z_LINK 20
13 #define Z_FRAME 50
14 #define Z_SELBOX 60
15 #define Z_ICON 80
16 #define Z_TEXT 100
18 class MapObj:public xmlObj {
19 public:
20 MapObj ();
21 MapObj (QCanvas*);
22 MapObj (MapObj*);
23 virtual ~MapObj ();
24 virtual void init ();
25 virtual void copy (MapObj*);
26 virtual QCanvas* getCanvas();
27 virtual int x();
28 virtual int y();
29 virtual int width();
30 virtual int height();
31 virtual void move (double x,double y); // move to absolute Position
32 virtual void moveBy (double x,double y); // move to relative Position
33 virtual bool inBBox(QPoint); // Check if Point is in bbox
34 virtual QRect getBBox(); // returns bounding box
35 virtual QRect addBBox(QRect,QRect); // returns bbox which includes both boxes
36 virtual QSize getSize(); // returns size of bounding box
37 virtual bool isVisibleObj();
38 virtual void setVisibility(bool);
39 protected:
40 QCanvas* canvas;
41 QRect bbox; // bounding box of MO itself
42 virtual void positionBBox()=0;
43 virtual void calcBBoxSize()=0;
44 QPoint absPos; // Position on canvas
45 bool visible;
46 };
48 #endif