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