mapobj.h
author insilmaril
Mon Aug 08 16:15:57 2005 +0000 (2005-08-08)
changeset 148 401f76b830d1
parent 0 7a96bd401351
child 175 728f51b71e71
permissions -rw-r--r--
added spanish translation
insilmaril@0
     1
#ifndef MAPOBJ_H
insilmaril@0
     2
#define MAPOBJ_H
insilmaril@0
     3
insilmaril@0
     4
#include <qcanvas.h>
insilmaril@0
     5
#include <iostream>
insilmaril@0
     6
insilmaril@0
     7
#include "misc.h"
insilmaril@0
     8
insilmaril@0
     9
using namespace std;
insilmaril@0
    10
insilmaril@0
    11
#define Z_BBOX     0
insilmaril@129
    12
#define Z_XLINK   10
insilmaril@0
    13
#define Z_LINK    20
insilmaril@0
    14
#define Z_FRAME   50
insilmaril@0
    15
#define Z_SELBOX  60
insilmaril@0
    16
#define Z_ICON    80
insilmaril@0
    17
#define Z_TEXT   100
insilmaril@0
    18
insilmaril@0
    19
class MapObj:public xmlObj {
insilmaril@0
    20
public:
insilmaril@0
    21
    MapObj ();
insilmaril@0
    22
    MapObj (QCanvas*);
insilmaril@0
    23
    MapObj (MapObj*);
insilmaril@0
    24
    virtual ~MapObj ();
insilmaril@0
    25
    virtual void init ();
insilmaril@0
    26
    virtual void copy (MapObj*);
insilmaril@0
    27
	virtual QCanvas* getCanvas();
insilmaril@0
    28
    virtual int x();
insilmaril@0
    29
    virtual int y();
insilmaril@0
    30
	virtual int width();
insilmaril@0
    31
	virtual int height();
insilmaril@129
    32
	virtual QString getPos();					// Return position as string (x,y)
insilmaril@0
    33
    virtual void move (double x,double y);      // move to absolute Position
insilmaril@0
    34
    virtual void moveBy (double x,double y);    // move to relative Position
insilmaril@0
    35
    virtual bool inBBox(QPoint);				// Check if Point is in bbox
insilmaril@0
    36
    virtual QRect getBBox();					// returns bounding box
insilmaril@0
    37
    virtual QRect addBBox(QRect,QRect);			// returns bbox which includes both boxes
insilmaril@0
    38
    virtual QSize getSize();					// returns size of bounding box
insilmaril@0
    39
    virtual bool isVisibleObj();
insilmaril@0
    40
    virtual void setVisibility(bool);
insilmaril@0
    41
protected:  
insilmaril@0
    42
    QCanvas* canvas;
insilmaril@0
    43
    QRect bbox;									// bounding box of MO itself
insilmaril@0
    44
    virtual void positionBBox()=0;       
insilmaril@0
    45
	virtual void calcBBoxSize()=0;
insilmaril@0
    46
    QPoint absPos;							    // Position on canvas
insilmaril@0
    47
    bool visible;
insilmaril@0
    48
};
insilmaril@0
    49
insilmaril@0
    50
#endif