author | insilmaril |
Mon May 08 13:25:46 2006 +0000 (2006-05-08) | |
changeset 316 | 25f100aa30b2 |
parent 97 | 0b048b6bb6f4 |
child 366 | e95081c21da2 |
permissions | -rw-r--r-- |
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@299 | 17 |
BranchObj* getBegin(); |
insilmaril@95 | 18 |
void setEnd (BranchObj*); |
insilmaril@95 | 19 |
void setEnd (QPoint); |
insilmaril@299 | 20 |
BranchObj* getEnd(); |
insilmaril@95 | 21 |
void setColor(QColor); |
insilmaril@97 | 22 |
QColor getColor(); |
insilmaril@97 | 23 |
void setWidth (int); |
insilmaril@97 | 24 |
int getWidth (); |
insilmaril@95 | 25 |
bool activate (); // Sets pointers in branchObjects |
insilmaril@95 | 26 |
void deactivate(); // removes those pointers |
insilmaril@95 | 27 |
bool isUsed(); // true, if at least on branch uses it |
insilmaril@95 | 28 |
void updateXLink(); |
insilmaril@95 | 29 |
BranchObj* otherBranch (BranchObj*); |
insilmaril@95 | 30 |
void positionBBox(); |
insilmaril@95 | 31 |
void calcBBoxSize(); |
insilmaril@95 | 32 |
void setVisibility (bool); |
insilmaril@95 | 33 |
void setVisibility (); |
insilmaril@95 | 34 |
QString saveToDir (); |
insilmaril@95 | 35 |
|
insilmaril@95 | 36 |
private: |
insilmaril@95 | 37 |
static int arrowSize; |
insilmaril@97 | 38 |
QColor color; |
insilmaril@97 | 39 |
int width; |
insilmaril@95 | 40 |
QCanvasLine *line; |
insilmaril@95 | 41 |
QCanvasPolygon *poly; |
insilmaril@95 | 42 |
BranchObj *beginBranch; |
insilmaril@95 | 43 |
BranchObj *endBranch; |
insilmaril@95 | 44 |
BranchObj *visBranch; // the "visible" part of a partially scrolled link |
insilmaril@95 | 45 |
XLinkState xLinkState; // init during drawing or active |
insilmaril@95 | 46 |
QPoint beginPos; |
insilmaril@95 | 47 |
QPoint endPos; |
insilmaril@95 | 48 |
}; |
insilmaril@95 | 49 |
|
insilmaril@95 | 50 |
#endif |