linkobj.h
author insilmaril
Thu Mar 24 21:10:38 2005 +0000 (2005-03-24)
changeset 93 31c6ce8efbc7
parent 86 0ed77eb5d1cd
child 94 6783e13bb05d
permissions -rw-r--r--
added modifier modes (color,link,copy). Not fully functional yet
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@89
    23
	BranchObj* otherBranch (BranchObj*);
insilmaril@86
    24
	void positionBBox();
insilmaril@86
    25
	void calcBBoxSize();
insilmaril@86
    26
	void setVisibility (bool);
insilmaril@86
    27
insilmaril@86
    28
private:
insilmaril@86
    29
	QCanvasLine *line;
insilmaril@86
    30
	BranchObj *beginBranch;
insilmaril@86
    31
	BranchObj *endBranch;
insilmaril@86
    32
	LinkState linkState;	// init during drawing or active
insilmaril@86
    33
	QPoint beginPos;
insilmaril@86
    34
	QPoint   endPos;
insilmaril@86
    35
};
insilmaril@86
    36
insilmaril@86
    37
#endif