mapobj.h
branchvendor
changeset 0 7a96bd401351
child 2 608f976aa7bb
child 129 9b9c7e8b9147
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mapobj.h	Sun Jan 30 12:58:47 2005 +0000
     1.3 @@ -0,0 +1,48 @@
     1.4 +#ifndef MAPOBJ_H
     1.5 +#define MAPOBJ_H
     1.6 +
     1.7 +#include <qcanvas.h>
     1.8 +#include <iostream>
     1.9 +
    1.10 +#include "misc.h"
    1.11 +
    1.12 +using namespace std;
    1.13 +
    1.14 +#define Z_BBOX     0
    1.15 +#define Z_LINK    20
    1.16 +#define Z_FRAME   50
    1.17 +#define Z_SELBOX  60
    1.18 +#define Z_ICON    80
    1.19 +#define Z_TEXT   100
    1.20 +
    1.21 +class MapObj:public xmlObj {
    1.22 +public:
    1.23 +    MapObj ();
    1.24 +    MapObj (QCanvas*);
    1.25 +    MapObj (MapObj*);
    1.26 +    virtual ~MapObj ();
    1.27 +    virtual void init ();
    1.28 +    virtual void copy (MapObj*);
    1.29 +	virtual QCanvas* getCanvas();
    1.30 +    virtual int x();
    1.31 +    virtual int y();
    1.32 +	virtual int width();
    1.33 +	virtual int height();
    1.34 +    virtual void move (double x,double y);      // move to absolute Position
    1.35 +    virtual void moveBy (double x,double y);    // move to relative Position
    1.36 +    virtual bool inBBox(QPoint);				// Check if Point is in bbox
    1.37 +    virtual QRect getBBox();					// returns bounding box
    1.38 +    virtual QRect addBBox(QRect,QRect);			// returns bbox which includes both boxes
    1.39 +    virtual QSize getSize();					// returns size of bounding box
    1.40 +    virtual bool isVisibleObj();
    1.41 +    virtual void setVisibility(bool);
    1.42 +protected:  
    1.43 +    QCanvas* canvas;
    1.44 +    QRect bbox;									// bounding box of MO itself
    1.45 +    virtual void positionBBox()=0;       
    1.46 +	virtual void calcBBoxSize()=0;
    1.47 +    QPoint absPos;							    // Position on canvas
    1.48 +    bool visible;
    1.49 +};
    1.50 +
    1.51 +#endif