linkobj.h
author insilmaril
Sat, 09 Apr 2005 22:50:08 +0000
changeset 94 6783e13bb05d
parent 89 9db3eaa21237
permissions -rw-r--r--
links are now partially visible, if one end is scrolled
     1 #ifndef LINKOBJ_H
     2 #define LINKOBJ_H
     3 
     4 #include "linkablemapobj.h"
     5 
     6 enum LinkState {undefinedLink,initLink,activeLink,deleteLink};
     7 
     8 /////////////////////////////////////////////////////////////////////////////
     9 class LinkObj:public MapObj {
    10 public:
    11     LinkObj ();
    12     LinkObj (QCanvas*);
    13     ~LinkObj ();
    14     virtual void init ();
    15     virtual void copy (LinkObj*);
    16 	void setBegin (BranchObj*);
    17 	void setEnd   (BranchObj*);
    18 	void setEnd   (QPoint);
    19 	bool activate ();			// Sets pointers in branchObjects
    20 	void deactivate();			// removes those pointers
    21 	bool isUsed();				// true, if at least on branch uses it
    22 	void updateLink();
    23 	BranchObj* otherBranch (BranchObj*);
    24 	void positionBBox();
    25 	void calcBBoxSize();
    26 	void setVisibility (bool);
    27 	void setVisibility ();
    28 
    29 private:
    30 	QCanvasLine *line;
    31 	BranchObj *beginBranch;
    32 	BranchObj *endBranch;
    33 	BranchObj *visBranch;	// the "visible" part of a partially scrolled link
    34 	LinkState linkState;	// init during drawing or active
    35 	QPoint beginPos;
    36 	QPoint   endPos;
    37 };
    38 
    39 #endif