author | insilmaril |
Wed, 29 Apr 2009 18:46:31 +0000 | |
changeset 760 | 59614eaf5fbb |
child 762 | ffb95cd03156 |
permissions | -rw-r--r-- |
insilmaril@760 | 1 |
#ifndef MAPITEM_H |
insilmaril@760 | 2 |
#define MAPITEM_H |
insilmaril@760 | 3 |
|
insilmaril@760 | 4 |
#include <QPointF> |
insilmaril@760 | 5 |
|
insilmaril@760 | 6 |
class LinkableMapObj; |
insilmaril@760 | 7 |
|
insilmaril@760 | 8 |
/*! /brief MapItem is used to store information of MapObj and inherited |
insilmaril@760 | 9 |
classes. |
insilmaril@760 | 10 |
|
insilmaril@760 | 11 |
This is done even while no QGraphicsView is availabe, e.g. on a |
insilmaril@760 | 12 |
mobile device. |
insilmaril@760 | 13 |
*/ |
insilmaril@760 | 14 |
|
insilmaril@760 | 15 |
class MapItem |
insilmaril@760 | 16 |
{ |
insilmaril@760 | 17 |
protected: |
insilmaril@760 | 18 |
enum PositionMode {Unused,Absolute,Relative}; |
insilmaril@760 | 19 |
QPointF pos; |
insilmaril@760 | 20 |
PositionMode posMode; |
insilmaril@760 | 21 |
|
insilmaril@760 | 22 |
public: |
insilmaril@760 | 23 |
MapItem(); |
insilmaril@760 | 24 |
|
insilmaril@760 | 25 |
/*! Used to save relative position while map is not in QGraphicsView */ |
insilmaril@760 | 26 |
virtual void setRelPos(const QPointF&); |
insilmaril@760 | 27 |
|
insilmaril@760 | 28 |
/*! Used to save absolute position while map is not in QGraphicsView */ |
insilmaril@760 | 29 |
virtual void setAbsPos(const QPointF&); |
insilmaril@760 | 30 |
|
insilmaril@760 | 31 |
protected: |
insilmaril@760 | 32 |
LinkableMapObj *lmo; |
insilmaril@760 | 33 |
public: |
insilmaril@760 | 34 |
/*! Returns pointer to related LinkableMapObj in QGraphicsView */ |
insilmaril@760 | 35 |
virtual LinkableMapObj* getLMO(); |
insilmaril@760 | 36 |
|
insilmaril@760 | 37 |
/*! Set pointer to related LinkableMapObj in QGraphicsView */ |
insilmaril@760 | 38 |
virtual void setLMO (LinkableMapObj*); |
insilmaril@760 | 39 |
|
insilmaril@760 | 40 |
/*! Initialize LinkableMapObj with data in MapItem */ |
insilmaril@760 | 41 |
virtual void initLMO(); |
insilmaril@760 | 42 |
}; |
insilmaril@760 | 43 |
|
insilmaril@760 | 44 |
|
insilmaril@760 | 45 |
#endif |