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@0
|
9 |
|
insilmaril@462
|
10 |
bool isAbove(BranchObj*,BranchObj*);
|
insilmaril@146
|
11 |
|
insilmaril@462
|
12 |
/*! \brief A branch visible in the map */
|
insilmaril@411
|
13 |
|
insilmaril@0
|
14 |
/////////////////////////////////////////////////////////////////////////////
|
insilmaril@0
|
15 |
class BranchObj:public OrnamentedObj {
|
insilmaril@0
|
16 |
public:
|
insilmaril@462
|
17 |
/*! New branches will get use same color for heading as parent */
|
insilmaril@462
|
18 |
enum BranchModification {NewBranch, MovedBranch};
|
insilmaril@462
|
19 |
|
insilmaril@462
|
20 |
|
insilmaril@0
|
21 |
BranchObj ();
|
insilmaril@408
|
22 |
BranchObj (QGraphicsScene*);
|
insilmaril@408
|
23 |
BranchObj (QGraphicsScene*, LinkableMapObj* parent);
|
insilmaril@0
|
24 |
~BranchObj ();
|
insilmaril@0
|
25 |
bool operator< ( const BranchObj & );
|
insilmaril@0
|
26 |
bool operator== ( const BranchObj & );
|
insilmaril@0
|
27 |
virtual void init ();
|
insilmaril@0
|
28 |
virtual void copy (BranchObj*);
|
insilmaril@0
|
29 |
void clear();
|
insilmaril@749
|
30 |
|
insilmaril@408
|
31 |
virtual void setParObjTmp (LinkableMapObj*,QPointF,int);// Only for moving Obj around
|
insilmaril@0
|
32 |
virtual void unsetParObjTmp(); // reuse original ParObj
|
insilmaril@0
|
33 |
|
insilmaril@0
|
34 |
virtual void setVisibility(bool,int); // set visibility
|
insilmaril@0
|
35 |
virtual void setVisibility(bool); // set vis. for w
|
insilmaril@0
|
36 |
virtual void setLinkColor(); // set the color of link
|
insilmaril@417
|
37 |
virtual void setColorSubtree(QColor); // set the color of heading
|
insilmaril@0
|
38 |
|
insilmaril@753
|
39 |
virtual void updateContentSize();
|
insilmaril@334
|
40 |
virtual void positionContents();
|
insilmaril@0
|
41 |
virtual void move (double x,double y);
|
insilmaril@408
|
42 |
virtual void move (QPointF);
|
insilmaril@0
|
43 |
virtual void moveBy (double x,double y);
|
insilmaril@408
|
44 |
virtual void moveBy (QPointF);
|
insilmaril@0
|
45 |
virtual void positionBBox();
|
insilmaril@0
|
46 |
virtual void calcBBoxSize();
|
insilmaril@223
|
47 |
virtual void setDockPos();
|
insilmaril@754
|
48 |
|
insilmaril@767
|
49 |
virtual void updateData(); //! Update represantatio of heading, flags, etc.
|
insilmaril@749
|
50 |
|
insilmaril@95
|
51 |
virtual void addXLink (XLinkObj*);
|
insilmaril@146
|
52 |
virtual void removeXLinkRef (XLinkObj*);// Remove ref in list
|
insilmaril@146
|
53 |
virtual void deleteXLink (XLinkObj*); // remove references and delete XLinkObj
|
insilmaril@95
|
54 |
virtual void deleteXLinkAt (int); // remove references and delete XLinkObj
|
insilmaril@97
|
55 |
virtual XLinkObj* XLinkAt (int); // return reference of XLinkObj
|
insilmaril@95
|
56 |
virtual BranchObj* XLinkTargetAt (int);
|
insilmaril@749
|
57 |
|
insilmaril@169
|
58 |
void setIncludeImagesVer(bool);
|
insilmaril@169
|
59 |
bool getIncludeImagesVer();
|
insilmaril@169
|
60 |
void setIncludeImagesHor(bool);
|
insilmaril@169
|
61 |
bool getIncludeImagesHor();
|
insilmaril@169
|
62 |
QString getIncludeImageAttr();
|
insilmaril@749
|
63 |
|
insilmaril@395
|
64 |
virtual FloatImageObj* addFloatImage();
|
insilmaril@395
|
65 |
virtual FloatImageObj* addFloatImage(FloatImageObj*);
|
insilmaril@0
|
66 |
virtual void removeFloatImage(FloatImageObj*);
|
insilmaril@0
|
67 |
virtual FloatImageObj* getFirstFloatImage();
|
insilmaril@0
|
68 |
virtual FloatImageObj* getLastFloatImage();
|
insilmaril@0
|
69 |
virtual FloatImageObj* getFloatImageNum(const uint &);
|
insilmaril@0
|
70 |
protected:
|
insilmaril@146
|
71 |
virtual void savePosInAngle(); // write pos in angle for resorting
|
insilmaril@755
|
72 |
public:
|
insilmaril@146
|
73 |
virtual void setDefAttr (BranchModification); // set default attributes (font, size, ...)
|
insilmaril@760
|
74 |
|
insilmaril@760
|
75 |
virtual void removeBranchHere(BranchObj*); //FIXME-3
|
insilmaril@721
|
76 |
virtual void removeChildren();
|
insilmaril@0
|
77 |
virtual void removeBranch(BranchObj*);
|
insilmaril@83
|
78 |
virtual void removeBranchPtr (BranchObj*);
|
insilmaril@749
|
79 |
|
insilmaril@604
|
80 |
virtual void sortChildren();
|
insilmaril@721
|
81 |
virtual void alignRelativeTo(const QPointF, bool alignSelf=false );
|
insilmaril@0
|
82 |
virtual void reposition();
|
insilmaril@382
|
83 |
virtual void unsetAllRepositionRequests();
|
insilmaril@0
|
84 |
|
insilmaril@661
|
85 |
virtual QPolygonF shape(); //!< Returns arbitrary bounding polygon
|
insilmaril@721
|
86 |
virtual QRectF getTotalBBox(); // return BBox including children
|
insilmaril@721
|
87 |
virtual QRectF getBBoxSizeWithChildren(); // return size of BBox including children
|
insilmaril@721
|
88 |
virtual void calcBBoxSizeWithChildren(); // calc size of BBox including children recursivly
|
insilmaril@0
|
89 |
|
insilmaril@0
|
90 |
virtual QString getSelectString();
|
insilmaril@688
|
91 |
virtual void setAnimation(const AnimPoint &ap);
|
insilmaril@688
|
92 |
virtual bool animate();
|
insilmaril@0
|
93 |
|
insilmaril@0
|
94 |
protected:
|
insilmaril@404
|
95 |
QList<FloatImageObj*> floatimage;// child images
|
insilmaril@406
|
96 |
QList<XLinkObj*> xlink; // xlinks to other branches
|
insilmaril@688
|
97 |
|
insilmaril@688
|
98 |
AnimPoint anim;
|
insilmaril@688
|
99 |
|
insilmaril@0
|
100 |
public:
|
insilmaril@0
|
101 |
float angle; // used in mainbranch to reorder mainbranches
|
insilmaril@0
|
102 |
protected:
|
insilmaril@169
|
103 |
bool includeImagesVer; // include floatimages in bbox vertically
|
insilmaril@169
|
104 |
bool includeImagesHor; // include floatimages in bbox horizontally
|
insilmaril@0
|
105 |
};
|
insilmaril@0
|
106 |
|
insilmaril@0
|
107 |
|
insilmaril@0
|
108 |
#endif
|
insilmaril@0
|
109 |
|