author | insilmaril |
Fri Jan 05 11:17:32 2007 +0000 (2007-01-05) | |
changeset 417 | 1cc7bbf75f0b |
parent 366 | e95081c21da2 |
child 478 | f4aae4fdc1bc |
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@408 | 12 |
XLinkObj (QGraphicsScene*); |
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@408 | 19 |
void setEnd (QPointF); |
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@408 | 38 |
QPen pen; |
insilmaril@97 | 39 |
QColor color; |
insilmaril@97 | 40 |
int width; |
insilmaril@408 | 41 |
QGraphicsLineItem *line; |
insilmaril@408 | 42 |
QGraphicsPolygonItem *poly; |
insilmaril@95 | 43 |
BranchObj *beginBranch; |
insilmaril@95 | 44 |
BranchObj *endBranch; |
insilmaril@95 | 45 |
BranchObj *visBranch; // the "visible" part of a partially scrolled link |
insilmaril@95 | 46 |
XLinkState xLinkState; // init during drawing or active |
insilmaril@408 | 47 |
QPointF beginPos; |
insilmaril@408 | 48 |
QPointF endPos; |
insilmaril@95 | 49 |
}; |
insilmaril@95 | 50 |
|
insilmaril@95 | 51 |
#endif |