xlinkobj.h
author insilmaril
Tue, 10 Apr 2007 13:22:51 +0000
changeset 446 c56ce5d81cc3
parent 408 c2a05fa925a1
child 478 f4aae4fdc1bc
permissions -rw-r--r--
1.8.71 Basic support for macros
     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 (QGraphicsScene*);
    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   (QPointF);
    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 	QPen pen;
    39 	QColor color;
    40 	int width;
    41 	QGraphicsLineItem *line;
    42 	QGraphicsPolygonItem *poly;
    43 	BranchObj *beginBranch;
    44 	BranchObj *endBranch;
    45 	BranchObj *visBranch;	// the "visible" part of a partially scrolled link
    46 	XLinkState xLinkState;	// init during drawing or active
    47 	QPointF beginPos;
    48 	QPointF   endPos;
    49 };
    50 
    51 #endif