branchobj.h
author insilmaril
Thu, 03 Sep 2009 08:52:00 +0000
changeset 790 133e2ed6b9c5
parent 785 5987f9f15bac
child 792 7d67be709091
permissions -rw-r--r--
More work on xLinks
     1 #ifndef BRANCHOBJ_H
     2 #define BRANCHOBJ_H
     3 
     4 #include "floatimageobj.h"
     5 #include "linkablemapobj.h"
     6 #include "ornamentedobj.h"
     7 #include "xlinkobj.h"
     8 
     9 
    10 bool isAbove(BranchObj*,BranchObj*);
    11 
    12 /*! \brief A branch visible in the map */
    13 
    14 /////////////////////////////////////////////////////////////////////////////
    15 class BranchObj:public OrnamentedObj {
    16 public:
    17 	/*! New branches will get use same color for heading as parent */
    18 	enum BranchModification {NewBranch, MovedBranch};
    19 
    20     BranchObj (QGraphicsScene*,TreeItem *ti=NULL);
    21     ~BranchObj ();
    22 	bool operator< ( const BranchObj & );
    23 	bool operator== ( const BranchObj & );
    24     virtual void init ();
    25     virtual void copy (BranchObj*);
    26     void clear();
    27 
    28     virtual void setParObjTmp (LinkableMapObj*,QPointF,int);// Only for moving Obj around
    29 	virtual void unsetParObjTmp();			// reuse original ParObj
    30 
    31 	virtual void setVisibility(bool,int);	// set visibility
    32     virtual void setVisibility(bool);	    // set vis. for w
    33 	virtual void setLinkColor();			// set the color of link
    34 
    35 	virtual void updateContentSize();
    36 	virtual void positionContents();
    37     virtual void move (double x,double y);
    38     virtual void move (QPointF);
    39     virtual void moveBy (double x,double y);
    40     virtual void moveBy (QPointF);
    41     virtual void positionBBox();
    42     virtual void calcBBoxSize();
    43 	virtual void setDockPos();
    44     
    45     virtual void updateData();	//! Update represantatio of heading, flags, etc.
    46 
    47 protected:	
    48 	virtual void savePosInAngle();					// write pos in angle for resorting			
    49 public:	
    50 	virtual void setDefAttr (BranchModification);	// set default attributes (font, size, ...)
    51 
    52     virtual void sortChildren();
    53     virtual void alignRelativeTo(const QPointF, bool alignSelf=false );
    54 	virtual void reposition();
    55 	virtual void unsetAllRepositionRequests();
    56 
    57 	virtual QPolygonF shape();				//!< Returns arbitrary bounding polygon
    58 	virtual QRectF getTotalBBox();			// return BBox including children			
    59 	virtual QRectF getBBoxSizeWithChildren();	// return size of BBox including children  
    60 	virtual void calcBBoxSizeWithChildren();	// calc size of  BBox including children recursivly
    61 
    62 	virtual QString getSelectString();
    63 	virtual void setAnimation(const AnimPoint &ap);
    64 	virtual bool animate();
    65 
    66 protected:
    67 	QList<XLinkObj*> xlink;			// xlinks to other branches
    68 
    69 	AnimPoint anim;
    70 
    71 public:	
    72 	float angle;					// used in mainbranch to reorder mainbranches
    73 };
    74 
    75 
    76 #endif
    77