X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=src%2Fbranchobj.h;fp=src%2Fbranchobj.h;h=340d6f356544fc2453f5806345bba977a10c3e35;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=0000000000000000000000000000000000000000;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/src/branchobj.h b/src/branchobj.h new file mode 100644 index 0000000..340d6f3 --- /dev/null +++ b/src/branchobj.h @@ -0,0 +1,66 @@ +#ifndef BRANCHOBJ_H +#define BRANCHOBJ_H + +#include "floatimageobj.h" +#include "linkablemapobj.h" +#include "ornamentedobj.h" +#include "xlinkobj.h" + +/*! \brief A branch visible in the map */ + +///////////////////////////////////////////////////////////////////////////// +class BranchObj : public OrnamentedObj { + public: + /*! New branches will get use same color for heading as parent */ + enum BranchModification { NewBranch, MovedBranch }; + + BranchObj(QGraphicsItem *parent = NULL, TreeItem *ti = NULL); + ~BranchObj(); + virtual void init(); + virtual void copy(BranchObj *); + void clear(); + + virtual void setParObjTmp(LinkableMapObj *, QPointF, + int); // Only for moving Obj around + virtual void unsetParObjTmp(); // reuse original ParObj + + virtual void setVisibility(bool, int); // set visibility + virtual void setVisibility(bool); // set vis. for w + + virtual void positionContents(); + virtual void move(double x, double y); + virtual void move(QPointF); + virtual void moveBy(double x, double y); + virtual void moveBy(QPointF); + + virtual void positionBBox(); + virtual void calcBBoxSize(); + virtual void setDockPos(); + + virtual void + updateVisuals(); //! Update represantatio of heading, flags, etc. + + public: + virtual void + setDefAttr(BranchModification, + bool keepFrame = + false); // set default attributes (frame, font, size, ...) + + virtual void alignRelativeTo(const QPointF, bool alignSelf = false); + virtual void reposition(); + virtual void unsetAllRepositionRequests(); + + virtual QRectF getTotalBBox(); // return size of BBox including children + virtual ConvexPolygon getBoundingPolygon(); + virtual void calcBBoxSizeWithChildren(); // calc size of BBox including + // children recursivly + + virtual void setAnimation(const AnimPoint &ap); + virtual void stopAnimation(); + virtual bool animate(); + + protected: + AnimPoint anim; +}; + +#endif