linkobj.h
author insilmaril
Sun, 30 Jan 2005 23:28:08 +0000
changeset 86 0ed77eb5d1cd
child 89 9db3eaa21237
permissions -rw-r--r--
added linkobj.*
insilmaril@86
     1
#ifndef LINKOBJ_H
insilmaril@86
     2
#define LINKOBJ_H
insilmaril@86
     3
insilmaril@86
     4
#include "linkablemapobj.h"
insilmaril@86
     5
insilmaril@86
     6
enum LinkState {undefinedLink,initLink,activeLink,deleteLink};
insilmaril@86
     7
insilmaril@86
     8
/////////////////////////////////////////////////////////////////////////////
insilmaril@86
     9
class LinkObj:public MapObj {
insilmaril@86
    10
public:
insilmaril@86
    11
    LinkObj ();
insilmaril@86
    12
    LinkObj (QCanvas*);
insilmaril@86
    13
    ~LinkObj ();
insilmaril@86
    14
    virtual void init ();
insilmaril@86
    15
    virtual void copy (LinkObj*);
insilmaril@86
    16
	void setBegin (BranchObj*);
insilmaril@86
    17
	void setEnd   (BranchObj*);
insilmaril@86
    18
	void setEnd   (QPoint);
insilmaril@86
    19
	bool activate ();			// Sets pointers in branchObjects
insilmaril@86
    20
	void deactivate();			// removes those pointers
insilmaril@86
    21
	bool isUsed();				// true, if at least on branch uses it
insilmaril@86
    22
	void updateLink();
insilmaril@86
    23
	void positionBBox();
insilmaril@86
    24
	void calcBBoxSize();
insilmaril@86
    25
	void setVisibility (bool);
insilmaril@86
    26
insilmaril@86
    27
private:
insilmaril@86
    28
	QCanvasLine *line;
insilmaril@86
    29
	BranchObj *beginBranch;
insilmaril@86
    30
	BranchObj *endBranch;
insilmaril@86
    31
	LinkState linkState;	// init during drawing or active
insilmaril@86
    32
	QPoint beginPos;
insilmaril@86
    33
	QPoint   endPos;
insilmaril@86
    34
};
insilmaril@86
    35
insilmaril@86
    36
#endif