mapobj.h
author insilmaril
Thu, 17 Jul 2008 09:27:20 +0000
branchrelease-1-12-maintained
changeset 39 e37153bea487
parent 0 7a96bd401351
child 2 608f976aa7bb
child 129 9b9c7e8b9147
permissions -rw-r--r--
removed pixel garbage on right side of exported images
     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