xlinkobj.h
author insilmaril
Mon, 18 Apr 2005 06:17:00 +0000
changeset 95 f688a9913724
child 97 0b048b6bb6f4
permissions -rw-r--r--
added basic xLink functions
     1 #ifndef XLINKOBJ_H
     2 #define XLINKOBJ_H
     3 
     4 #include "linkablemapobj.h"
     5 
     6 enum XLinkState {undefinedXLink,initXLink,activeXLink,deleteXLink};
     7 
     8 /////////////////////////////////////////////////////////////////////////////
     9 class XLinkObj:public MapObj {
    10 public:
    11     XLinkObj ();
    12     XLinkObj (QCanvas*);
    13     ~XLinkObj ();
    14     virtual void init ();
    15     virtual void copy (XLinkObj*);
    16 	void setBegin (BranchObj*);
    17 	void setEnd   (BranchObj*);
    18 	void setEnd   (QPoint);
    19 	void setColor(QColor);
    20 	bool activate ();			// Sets pointers in branchObjects
    21 	void deactivate();			// removes those pointers
    22 	bool isUsed();				// true, if at least on branch uses it
    23 	void updateXLink();
    24 	BranchObj* otherBranch (BranchObj*);
    25 	void positionBBox();
    26 	void calcBBoxSize();
    27 	void setVisibility (bool);
    28 	void setVisibility ();
    29 	QString saveToDir ();
    30 
    31 private:
    32 	static int arrowSize;
    33 	static QColor defXLinkColor;
    34 	QColor xLinkColor;
    35 	QCanvasLine *line;
    36 	QCanvasPolygon *poly;
    37 	BranchObj *beginBranch;
    38 	BranchObj *endBranch;
    39 	BranchObj *visBranch;	// the "visible" part of a partially scrolled link
    40 	XLinkState xLinkState;	// init during drawing or active
    41 	QPoint beginPos;
    42 	QPoint   endPos;
    43 };
    44 
    45 #endif