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