insilmaril@0
|
1 |
#ifndef BRANCHOBJ_H
|
insilmaril@0
|
2 |
#define BRANCHOBJ_H
|
insilmaril@0
|
3 |
|
insilmaril@0
|
4 |
#include "floatimageobj.h"
|
insilmaril@0
|
5 |
#include "linkablemapobj.h"
|
insilmaril@0
|
6 |
#include "ornamentedobj.h"
|
insilmaril@95
|
7 |
#include "xlinkobj.h"
|
insilmaril@390
|
8 |
|
insilmaril@462
|
9 |
bool isAbove(BranchObj*,BranchObj*);
|
insilmaril@146
|
10 |
|
insilmaril@462
|
11 |
/*! \brief A branch visible in the map */
|
insilmaril@411
|
12 |
|
insilmaril@0
|
13 |
/////////////////////////////////////////////////////////////////////////////
|
insilmaril@0
|
14 |
class BranchObj:public OrnamentedObj {
|
insilmaril@0
|
15 |
public:
|
insilmaril@462
|
16 |
/*! New branches will get use same color for heading as parent */
|
insilmaril@462
|
17 |
enum BranchModification {NewBranch, MovedBranch};
|
insilmaril@462
|
18 |
|
insilmaril@790
|
19 |
BranchObj (QGraphicsScene*,TreeItem *ti=NULL);
|
insilmaril@0
|
20 |
~BranchObj ();
|
insilmaril@0
|
21 |
bool operator< ( const BranchObj & );
|
insilmaril@0
|
22 |
bool operator== ( const BranchObj & );
|
insilmaril@0
|
23 |
virtual void init ();
|
insilmaril@0
|
24 |
virtual void copy (BranchObj*);
|
insilmaril@0
|
25 |
void clear();
|
insilmaril@749
|
26 |
|
insilmaril@408
|
27 |
virtual void setParObjTmp (LinkableMapObj*,QPointF,int);// Only for moving Obj around
|
insilmaril@0
|
28 |
virtual void unsetParObjTmp(); // reuse original ParObj
|
insilmaril@0
|
29 |
|
insilmaril@0
|
30 |
virtual void setVisibility(bool,int); // set visibility
|
insilmaril@0
|
31 |
virtual void setVisibility(bool); // set vis. for w
|
insilmaril@0
|
32 |
virtual void setLinkColor(); // set the color of link
|
insilmaril@0
|
33 |
|
insilmaril@753
|
34 |
virtual void updateContentSize();
|
insilmaril@334
|
35 |
virtual void positionContents();
|
insilmaril@0
|
36 |
virtual void move (double x,double y);
|
insilmaril@408
|
37 |
virtual void move (QPointF);
|
insilmaril@0
|
38 |
virtual void moveBy (double x,double y);
|
insilmaril@408
|
39 |
virtual void moveBy (QPointF);
|
insilmaril@0
|
40 |
virtual void positionBBox();
|
insilmaril@0
|
41 |
virtual void calcBBoxSize();
|
insilmaril@223
|
42 |
virtual void setDockPos();
|
insilmaril@754
|
43 |
|
insilmaril@767
|
44 |
virtual void updateData(); //! Update represantatio of heading, flags, etc.
|
insilmaril@749
|
45 |
|
insilmaril@0
|
46 |
protected:
|
insilmaril@146
|
47 |
virtual void savePosInAngle(); // write pos in angle for resorting
|
insilmaril@755
|
48 |
public:
|
insilmaril@146
|
49 |
virtual void setDefAttr (BranchModification); // set default attributes (font, size, ...)
|
insilmaril@760
|
50 |
|
insilmaril@721
|
51 |
virtual void alignRelativeTo(const QPointF, bool alignSelf=false );
|
insilmaril@0
|
52 |
virtual void reposition();
|
insilmaril@382
|
53 |
virtual void unsetAllRepositionRequests();
|
insilmaril@0
|
54 |
|
insilmaril@721
|
55 |
virtual QRectF getTotalBBox(); // return BBox including children
|
insilmaril@721
|
56 |
virtual QRectF getBBoxSizeWithChildren(); // return size of BBox including children
|
insilmaril@793
|
57 |
virtual ConvexPolygon getBoundingPolygon();
|
insilmaril@721
|
58 |
virtual void calcBBoxSizeWithChildren(); // calc size of BBox including children recursivly
|
insilmaril@0
|
59 |
|
insilmaril@0
|
60 |
virtual QString getSelectString();
|
insilmaril@688
|
61 |
virtual void setAnimation(const AnimPoint &ap);
|
insilmaril@688
|
62 |
virtual bool animate();
|
insilmaril@0
|
63 |
|
insilmaril@0
|
64 |
protected:
|
insilmaril@406
|
65 |
QList<XLinkObj*> xlink; // xlinks to other branches
|
insilmaril@688
|
66 |
|
insilmaril@688
|
67 |
AnimPoint anim;
|
insilmaril@688
|
68 |
|
insilmaril@0
|
69 |
public:
|
insilmaril@0
|
70 |
float angle; // used in mainbranch to reorder mainbranches
|
insilmaril@0
|
71 |
};
|
insilmaril@0
|
72 |
|
insilmaril@0
|
73 |
|
insilmaril@0
|
74 |
#endif
|
insilmaril@0
|
75 |
|