1.1 --- a/xlinkitem.h Thu Dec 03 22:32:24 2009 +0000
1.2 +++ b/xlinkitem.h Wed Jun 09 13:14:08 2010 +0000
1.3 @@ -2,14 +2,16 @@
1.4 #define XLINKITEM_H
1.5
1.6 class BranchItem;
1.7 +class QGraphicsScene;
1.8 class XLinkObj;
1.9 -class QGraphicsScene;
1.10
1.11 #include "mapitem.h"
1.12 +#include "xlink.h"
1.13
1.14 /*! \brief xlinks are used to draw arbitrary connections between branches (BranchObj) in the map. */
1.15
1.16 /////////////////////////////////////////////////////////////////////////////
1.17 +
1.18 class XLinkItem:public MapItem {
1.19 public:
1.20 enum XLinkState {undefinedXLink,initXLink,activeXLink,deleteXLink};
1.21 @@ -17,33 +19,13 @@
1.22 XLinkItem (const QList<QVariant> &data, TreeItem *parent=NULL);
1.23 virtual ~XLinkItem ();
1.24 virtual void init ();
1.25 - void setBegin (BranchItem*);
1.26 - BranchItem* getBegin();
1.27 - void setEnd (BranchItem*);
1.28 - void setEnd (QPointF);
1.29 - BranchItem* getEnd();
1.30 - void setColor(QColor);
1.31 - QColor getColor();
1.32 - void setWidth (int);
1.33 - int getWidth ();
1.34 - bool activate (); //! Creates a 2nd XLink (without a XLinkObj attached)
1.35 - bool isBegin(); //! true, if this is master xLink, which may have an XLinkObj attached
1.36 + void setLink (Link*);
1.37 + Link* getLink ();
1.38 void updateXLink();
1.39 - virtual void updateVisibility(); // FIXME-3 not really needed atm...
1.40 BranchItem* getPartnerBranch ();
1.41 - BranchItem* getOtherBranch (TreeItem *ti);
1.42 - XLinkItem *getPartnerXLink(); //! Partner XLink
1.43 - QString saveToDir ();
1.44 - virtual XLinkObj* createMapObj(QGraphicsScene *scene);
1.45
1.46 private:
1.47 - XLinkState xLinkState; // init during drawing or active
1.48 - QColor color;
1.49 - int width;
1.50 - BranchItem *beginBranch;
1.51 - BranchItem *endBranch;
1.52 - XLinkItem *partnerXLink;
1.53 - bool isBeginXLink;
1.54 + Link *link;
1.55 };
1.56
1.57 #endif