xlinkobj.h
changeset 790 133e2ed6b9c5
parent 621 c60984c46f9f
child 791 f1006de05c54
     1.1 --- a/xlinkobj.h	Mon Aug 24 14:39:07 2009 +0000
     1.2 +++ b/xlinkobj.h	Thu Sep 03 08:52:00 2009 +0000
     1.3 @@ -1,55 +1,35 @@
     1.4  #ifndef XLINKOBJ_H
     1.5  #define XLINKOBJ_H
     1.6  
     1.7 -#include "linkablemapobj.h"
     1.8 +#include "mapobj.h"
     1.9  
    1.10  class BranchObj;
    1.11 -
    1.12 -enum XLinkState {undefinedXLink,initXLink,activeXLink,deleteXLink};
    1.13 +class BranchItem;
    1.14  
    1.15  /*! \brief xlinks are used to draw arbitrary connections between branches (BranchObj) in the map. */
    1.16  
    1.17  /////////////////////////////////////////////////////////////////////////////
    1.18  class XLinkObj:public MapObj {
    1.19  public:
    1.20 -    XLinkObj ();
    1.21 -    XLinkObj (QGraphicsScene*);
    1.22 +    XLinkObj (QGraphicsScene* scene, TreeItem* ti);
    1.23      ~XLinkObj ();
    1.24      virtual void init ();
    1.25 -    virtual void copy (XLinkObj*);
    1.26 -	void setBegin (BranchObj*);
    1.27 -	BranchObj* getBegin();
    1.28 -	void setEnd   (BranchObj*);
    1.29 -	void setEnd   (QPointF);
    1.30 -	BranchObj* getEnd();
    1.31 -	void setColor(QColor);
    1.32 -	QColor getColor();
    1.33 -	void setWidth (int);
    1.34 -	int getWidth ();
    1.35 -	bool activate ();			// Sets pointers in branchObjects
    1.36 -	void deactivate();			// removes those pointers
    1.37 -	bool isUsed();				// true, if at least on branch uses it
    1.38 +	virtual void setEnd (QPointF);
    1.39  	void updateXLink();
    1.40 -	BranchObj* otherBranch (BranchObj*);
    1.41  	void positionBBox();
    1.42  	void calcBBoxSize();
    1.43  	void setVisibility (bool);
    1.44  	void setVisibility ();
    1.45 -	QString saveToDir ();
    1.46  
    1.47  private:
    1.48  	static int arrowSize;
    1.49  	QPen pen;
    1.50 -	QColor color;
    1.51 -	int width;
    1.52  	QGraphicsLineItem *line;
    1.53  	QGraphicsPolygonItem *poly;
    1.54 -	BranchObj *beginBranch;
    1.55 -	BranchObj *endBranch;
    1.56 -	BranchObj *visBranch;	// the "visible" part of a partially scrolled link
    1.57 -	XLinkState xLinkState;	// init during drawing or active
    1.58  	QPointF beginPos;
    1.59  	QPointF   endPos;
    1.60 +
    1.61 +	BranchItem *visBranch;	// the "visible" part of a partially scrolled li
    1.62  };
    1.63  
    1.64  #endif