branchobj.h
author insilmaril
Tue May 26 11:24:51 2009 +0000 (2009-05-26)
changeset 774 2f002657dada
parent 772 e3f722759c7e
child 785 5987f9f15bac
permissions -rw-r--r--
added missing new files
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@0
    37
insilmaril@753
    38
	virtual void updateContentSize();
insilmaril@334
    39
	virtual void positionContents();
insilmaril@0
    40
    virtual void move (double x,double y);
insilmaril@408
    41
    virtual void move (QPointF);
insilmaril@0
    42
    virtual void moveBy (double x,double y);
insilmaril@408
    43
    virtual void moveBy (QPointF);
insilmaril@0
    44
    virtual void positionBBox();
insilmaril@0
    45
    virtual void calcBBoxSize();
insilmaril@223
    46
	virtual void setDockPos();
insilmaril@754
    47
    
insilmaril@767
    48
    virtual void updateData();	//! Update represantatio of heading, flags, etc.
insilmaril@749
    49
insilmaril@95
    50
	virtual void addXLink (XLinkObj*);
insilmaril@146
    51
	virtual void removeXLinkRef (XLinkObj*);// Remove ref in list
insilmaril@146
    52
	virtual void deleteXLink (XLinkObj*);	// remove references and delete XLinkObj 
insilmaril@95
    53
	virtual void deleteXLinkAt (int);		// remove references and delete XLinkObj 
insilmaril@97
    54
	virtual XLinkObj* XLinkAt (int);		// return reference of XLinkObj 
insilmaril@95
    55
	virtual BranchObj* XLinkTargetAt (int);
insilmaril@749
    56
insilmaril@169
    57
	void setIncludeImagesVer(bool);
insilmaril@169
    58
	bool getIncludeImagesVer();
insilmaril@169
    59
	void setIncludeImagesHor(bool);
insilmaril@169
    60
	bool getIncludeImagesHor();
insilmaril@169
    61
	QString getIncludeImageAttr();
insilmaril@749
    62
insilmaril@395
    63
	virtual FloatImageObj* addFloatImage();
insilmaril@395
    64
	virtual FloatImageObj* addFloatImage(FloatImageObj*);
insilmaril@0
    65
	virtual void removeFloatImage(FloatImageObj*);
insilmaril@0
    66
    virtual FloatImageObj* getFirstFloatImage();
insilmaril@0
    67
    virtual FloatImageObj* getLastFloatImage();
insilmaril@0
    68
	virtual FloatImageObj* getFloatImageNum(const uint &);
insilmaril@0
    69
protected:	
insilmaril@146
    70
	virtual void savePosInAngle();					// write pos in angle for resorting			
insilmaril@755
    71
public:	
insilmaril@146
    72
	virtual void setDefAttr (BranchModification);	// set default attributes (font, size, ...)
insilmaril@760
    73
insilmaril@604
    74
    virtual void sortChildren();
insilmaril@721
    75
    virtual void alignRelativeTo(const QPointF, bool alignSelf=false );
insilmaril@0
    76
	virtual void reposition();
insilmaril@382
    77
	virtual void unsetAllRepositionRequests();
insilmaril@0
    78
insilmaril@661
    79
	virtual QPolygonF shape();				//!< Returns arbitrary bounding polygon
insilmaril@721
    80
	virtual QRectF getTotalBBox();			// return BBox including children			
insilmaril@721
    81
	virtual QRectF getBBoxSizeWithChildren();	// return size of BBox including children  
insilmaril@721
    82
	virtual void calcBBoxSizeWithChildren();	// calc size of  BBox including children recursivly
insilmaril@0
    83
insilmaril@0
    84
	virtual QString getSelectString();
insilmaril@688
    85
	virtual void setAnimation(const AnimPoint &ap);
insilmaril@688
    86
	virtual bool animate();
insilmaril@0
    87
insilmaril@0
    88
protected:
insilmaril@404
    89
	QList<FloatImageObj*> floatimage;// child images
insilmaril@406
    90
	QList<XLinkObj*> xlink;			// xlinks to other branches
insilmaril@688
    91
insilmaril@688
    92
	AnimPoint anim;
insilmaril@688
    93
insilmaril@0
    94
public:	
insilmaril@0
    95
	float angle;					// used in mainbranch to reorder mainbranches
insilmaril@0
    96
protected:	
insilmaril@169
    97
	bool includeImagesVer;			// include floatimages in bbox vertically
insilmaril@169
    98
	bool includeImagesHor;			// include floatimages in bbox horizontally
insilmaril@0
    99
};
insilmaril@0
   100
insilmaril@0
   101
insilmaril@0
   102
#endif
insilmaril@0
   103