Menu

[357496]: / xlinkobj.h  Maximize  Restore  History

Download this file

79 lines (68 with data), 2.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef XLINKOBJ_H
#define XLINKOBJ_H
#include <QPen>
#include "arrowobj.h"
#include "linkablemapobj.h"
#include "mapobj.h"
#include "xlink.h"
class BranchObj;
class BranchItem;
/*! \brief xlinks are used to draw arbitrary connections between branches (BranchObj) in the map. */
/////////////////////////////////////////////////////////////////////////////
class XLinkObj:public MapObj {
public:
enum CurrentSelection {Unselected, Path, C0, C1};
XLinkObj (QGraphicsItem*, Link* l );
virtual ~XLinkObj ();
virtual void init ();
virtual QPointF getAbsPos();
void setStyleBegin(const QString &s);
void setStyleBegin(ArrowObj::OrnamentStyle os);
ArrowObj::OrnamentStyle getStyleBegin();
void setStyleEnd(const QString &s);
void setStyleEnd(ArrowObj::OrnamentStyle os);
ArrowObj::OrnamentStyle getStyleEnd();
QPointF getBeginPos();
QPointF getEndPos();
virtual void move (QPointF p);
virtual void setEnd (QPointF);
void setSelection (int cp);
void setSelection (CurrentSelection s);
void updateXLink();
void positionBBox();
void calcBBoxSize();
void setVisibility (bool);
void setVisibility ();
void initC0();
void setC0 (const QPointF &p);
QPointF getC0();
void initC1();
void setC1 (const QPointF &p);
QPointF getC1();
bool isInClickBox (const QPointF &p);
int ctrlPointInClickBox (const QPointF &p);
QPainterPath getClickPath();
private:
enum StateVis {Hidden,OnlyBegin,OnlyEnd,Full,FullShowControls};
StateVis stateVis;
static int arrowSize;
static int clickBorder;
static int pointRadius;
static int d_control;
QPainterPath clickPath;
QGraphicsPolygonItem *poly;// Arrowhead, when one end is not visible
ArrowObj *pointerBegin; // Arrowhead
ArrowObj *pointerEnd; // Arrowhead
QGraphicsPathItem *path;
QPointF beginPos;
QPointF endPos;
QPointF c0,c1; // Controlpoints for Bezier path
LinkableMapObj::Orientation beginOrient;
LinkableMapObj::Orientation endOrient;
QGraphicsEllipseItem *ctrl_p0;
QGraphicsEllipseItem *ctrl_p1;
CurrentSelection curSelection;
BranchItem *visBranch; // the "visible" part of a partially scrolled li
Link *link;
};
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.