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