mapobj.h
author insilmaril
Tue Jul 12 12:02:55 2005 +0000 (2005-07-12)
changeset 126 1ad2d5c80848
child 2 608f976aa7bb
child 129 9b9c7e8b9147
permissions -rw-r--r--
1.7.0
     1 #ifndef MAPOBJ_H
     2 #define MAPOBJ_H
     3 
     4 #include <qcanvas.h>
     5 #include <iostream>
     6 
     7 #include "misc.h"
     8 
     9 using namespace std;
    10 
    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
    17 
    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 };
    47 
    48 #endif