author | insilmaril |
Thu Apr 02 09:57:36 2009 +0000 (2009-04-02) | |
branch | release-1-12-maintained |
changeset 64 | 4f305c07dd7c |
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