1.1 --- a/mapobj.h Tue Sep 05 09:47:14 2006 +0000
1.2 +++ b/mapobj.h Wed Apr 11 09:21:14 2007 +0000
1.3 @@ -1,7 +1,8 @@
1.4 #ifndef MAPOBJ_H
1.5 #define MAPOBJ_H
1.6
1.7 -#include <q3canvas.h>
1.8 +#include <QGraphicsScene>
1.9 +#include <QGraphicsItem>
1.10 #include <iostream>
1.11
1.12 #include "misc.h"
1.13 @@ -20,33 +21,34 @@
1.14 class MapObj:public xmlObj {
1.15 public:
1.16 MapObj ();
1.17 - MapObj (Q3Canvas*);
1.18 + MapObj (QGraphicsScene*);
1.19 MapObj (MapObj*);
1.20 virtual ~MapObj ();
1.21 virtual void init ();
1.22 virtual void copy (MapObj*);
1.23 - virtual Q3Canvas* getCanvas();
1.24 - virtual int x();
1.25 - virtual int y();
1.26 - virtual int width();
1.27 - virtual int height();
1.28 - virtual QPoint getAbsPos();
1.29 + virtual QGraphicsScene* getScene();
1.30 + virtual qreal x();
1.31 + virtual qreal y();
1.32 + virtual qreal width();
1.33 + virtual qreal height();
1.34 + virtual QPointF getAbsPos();
1.35 virtual QString getPos(); // Return position as string (x,y)
1.36 virtual void move (double x,double y); // move to absolute Position
1.37 + virtual void move (QPointF p);
1.38 virtual void moveBy (double x,double y); // move to relative Position
1.39 - virtual bool inBox(const QPoint&); // Check if Point is within clickbox
1.40 - virtual QRect getBBox(); // returns bounding box
1.41 - virtual QRect addBBox(QRect,QRect); // returns bbox which includes both boxes
1.42 - virtual QSize getSize(); // returns size of bounding box
1.43 + virtual bool inBox(const QPointF&); // Check if Point is within clickbox
1.44 + virtual QRectF getBBox(); // returns bounding box
1.45 + virtual QRectF addBBox(QRectF,QRectF); // returns bbox which includes both boxes
1.46 + virtual QSizeF getSize(); // returns size of bounding box
1.47 virtual bool isVisibleObj();
1.48 virtual void setVisibility(bool);
1.49 virtual void positionBBox()=0;
1.50 virtual void calcBBoxSize()=0;
1.51 protected:
1.52 - Q3Canvas* canvas;
1.53 - QRect bbox; // bounding box of MO itself
1.54 - QRect clickBox; // area where mouseclicks are found
1.55 - QPoint absPos; // Position on canvas
1.56 + QGraphicsScene* scene;
1.57 + QRectF bbox; // bounding box of MO itself
1.58 + QRectF clickBox; // area where mouseclicks are found
1.59 + QPointF absPos; // Position on canvas
1.60 bool visible;
1.61 };
1.62