author | insilmaril |
Fri Feb 01 15:28:35 2008 +0000 (2008-02-01) | |
changeset 662 | 9abdd5e6c3dc |
parent 650 | 65c5a0c28d20 |
child 665 | a7db20d79c32 |
permissions | -rw-r--r-- |
insilmaril@650 | 1 |
#ifndef VYMMODEL_H |
insilmaril@650 | 2 |
#define VYMMODEL_H |
insilmaril@650 | 3 |
|
insilmaril@650 | 4 |
#include <QGraphicsScene> |
insilmaril@650 | 5 |
|
insilmaril@650 | 6 |
#include "mapcenterobj.h" |
insilmaril@650 | 7 |
#include "mapeditor.h" |
insilmaril@650 | 8 |
|
insilmaril@650 | 9 |
|
insilmaril@650 | 10 |
/*! \brief This will later be divided into Model/View |
insilmaril@650 | 11 |
*/ |
insilmaril@650 | 12 |
|
insilmaril@650 | 13 |
class VymModel{ |
insilmaril@650 | 14 |
public: |
insilmaril@650 | 15 |
VymModel(); |
insilmaril@650 | 16 |
~VymModel (); |
insilmaril@650 | 17 |
void clear(); |
insilmaril@650 | 18 |
void init(); |
insilmaril@650 | 19 |
void setMapEditor(MapEditor *me); // FIXME should not be necessary in Model/View |
insilmaril@650 | 20 |
MapEditor* getMapEditor(); |
insilmaril@650 | 21 |
void setVersion(const QString &); |
insilmaril@650 | 22 |
void setAuthor (const QString &); |
insilmaril@650 | 23 |
QString getAuthor (); |
insilmaril@650 | 24 |
void setComment (const QString &); |
insilmaril@650 | 25 |
QString getComment (); |
insilmaril@650 | 26 |
QString getDate(); |
insilmaril@650 | 27 |
void setScene(QGraphicsScene *s); |
insilmaril@650 | 28 |
QGraphicsScene *getScene(); |
insilmaril@650 | 29 |
MapCenterObj* addMapCenter(); |
insilmaril@650 | 30 |
MapCenterObj* removeMapCenter(MapCenterObj *mco); |
insilmaril@652 | 31 |
|
insilmaril@650 | 32 |
BranchObj* first(); // FIXME replaced by ModelIndex later |
insilmaril@650 | 33 |
BranchObj* next(BranchObj *bo); // FIXME replaced by ModelIndex later |
insilmaril@650 | 34 |
|
insilmaril@652 | 35 |
LinkableMapObj* findMapObj(QPointF,LinkableMapObj*); // find MapObj |
insilmaril@652 | 36 |
LinkableMapObj* findObjBySelect (const QString &s); // find MapObj by select string |
insilmaril@652 | 37 |
LinkableMapObj* findID (const QString &s); // find MapObj by previously set ID |
insilmaril@652 | 38 |
QString saveToDir (const QString&,const QString&,int, const QPointF&);// Save data recursivly to tempdir |
insilmaril@652 | 39 |
|
insilmaril@652 | 40 |
|
insilmaril@652 | 41 |
////////////////////////////////////////// View related |
insilmaril@652 | 42 |
// void updateLink(); FIXME needed? |
insilmaril@650 | 43 |
void updateRelPositions(); |
insilmaril@650 | 44 |
|
insilmaril@650 | 45 |
QRectF getTotalBBox(); |
insilmaril@650 | 46 |
void reposition(); //!< Call reposition for all MCOs |
insilmaril@650 | 47 |
void setHideTmp (HideTmpMode mode); |
insilmaril@652 | 48 |
|
insilmaril@652 | 49 |
////////////////////////////////////////// Selection related |
insilmaril@652 | 50 |
LinkableMapObj* getSelection(); |
insilmaril@652 | 51 |
BranchObj* getSelectedBranch(); |
insilmaril@652 | 52 |
bool select (const QString &s); |
insilmaril@652 | 53 |
QString getSelectString (LinkableMapObj *lmo); |
insilmaril@652 | 54 |
|
insilmaril@650 | 55 |
private: |
insilmaril@650 | 56 |
QGraphicsScene *mapScene; |
insilmaril@650 | 57 |
MapEditor *mapEditor; |
insilmaril@650 | 58 |
QList <MapCenterObj*> mapCenters; |
insilmaril@650 | 59 |
QString version; //!< version string saved in vym file |
insilmaril@650 | 60 |
QString author; |
insilmaril@650 | 61 |
QString comment; |
insilmaril@650 | 62 |
QDate date; |
insilmaril@650 | 63 |
}; |
insilmaril@650 | 64 |
|
insilmaril@650 | 65 |
|
insilmaril@650 | 66 |
#endif |