4 #include <QGraphicsScene>
6 #include "mapcenterobj.h"
10 /*! \brief This will later be divided into Model/View
13 class VymModel : public QObject{
21 void setMapEditor(MapEditor *me); // FIXME should not be necessary in Model/View
22 MapEditor* getMapEditor();
23 void setVersion(const QString &);
24 void setAuthor (const QString &);
26 void setComment (const QString &);
27 QString getComment ();
29 void setScene(QGraphicsScene *s);
30 QGraphicsScene *getScene();
31 MapCenterObj* addMapCenter();
32 MapCenterObj* addMapCenter(QPointF absPos);
33 MapCenterObj* removeMapCenter(MapCenterObj *mco);
34 MapCenterObj* getMapCenterNum (int i);
35 int countMapCenters ();
38 BranchObj* first(); // FIXME replaced by ModelIndex later
39 BranchObj* next(BranchObj *bo); // FIXME replaced by ModelIndex later
41 LinkableMapObj* findMapObj(QPointF,LinkableMapObj*); // find MapObj
42 LinkableMapObj* findObjBySelect (const QString &s); // find MapObj by select string
43 LinkableMapObj* findID (const QString &s); // find MapObj by previously set ID
44 QString saveToDir (const QString&,const QString&,int, const QPointF&);// Save data recursivly to tempdir
47 ////////////////////////////////////////// View related
48 // void updateLink(); FIXME needed?
49 void updateRelPositions();
51 QRectF getTotalBBox();
52 void reposition(); //!< Call reposition for all MCOs
53 void setHideTmp (HideTmpMode mode);
54 QPolygonF shape(BranchObj *bo); //!< Returns arbitrary shape of subtree
55 void moveAway (LinkableMapObj *lmo);//!< Autolayout: Move all out of the way
57 // Animation **experimental**
59 void animate(); //!< Called by timer to animate stuff
61 void startAnimation (const QPointF &start, const QPointF &dest);
62 void stopAnimation (MapObj *mo);
64 QTimer *animationTimer;
67 uint animationInterval;
68 int timerId; // animation timer
69 QList <MapObj*> animObjList;// list with animated objects
71 ////////////////////////////////////////// Selection related
73 LinkableMapObj* getSelection();
74 BranchObj* getSelectedBranch();
75 bool select (const QString &s);
76 QString getSelectString (LinkableMapObj *lmo);
79 QGraphicsScene *mapScene;
81 QList <MapCenterObj*> mapCenters;
82 QString version; //!< version string saved in vym file