xlinkobj.h
author insilmaril
Thu Jun 01 14:51:57 2006 +0000 (2006-06-01)
changeset 347 4a3c06183639
parent 97 0b048b6bb6f4
child 366 e95081c21da2
permissions -rw-r--r--
Bugfix for duplicate xLinks
     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 	BranchObj* getBegin();
    18 	void setEnd   (BranchObj*);
    19 	void setEnd   (QPoint);
    20 	BranchObj* getEnd();
    21 	void setColor(QColor);
    22 	QColor getColor();
    23 	void setWidth (int);
    24 	int getWidth ();
    25 	bool activate ();			// Sets pointers in branchObjects
    26 	void deactivate();			// removes those pointers
    27 	bool isUsed();				// true, if at least on branch uses it
    28 	void updateXLink();
    29 	BranchObj* otherBranch (BranchObj*);
    30 	void positionBBox();
    31 	void calcBBoxSize();
    32 	void setVisibility (bool);
    33 	void setVisibility ();
    34 	QString saveToDir ();
    35 
    36 private:
    37 	static int arrowSize;
    38 	QColor color;
    39 	int width;
    40 	QCanvasLine *line;
    41 	QCanvasPolygon *poly;
    42 	BranchObj *beginBranch;
    43 	BranchObj *endBranch;
    44 	BranchObj *visBranch;	// the "visible" part of a partially scrolled link
    45 	XLinkState xLinkState;	// init during drawing or active
    46 	QPoint beginPos;
    47 	QPoint   endPos;
    48 };
    49 
    50 #endif