X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=src%2Farrowobj.h;fp=src%2Farrowobj.h;h=be8c70ae29a39ea25103f17fa7d9e874eaccafc2;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=0000000000000000000000000000000000000000;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/src/arrowobj.h b/src/arrowobj.h new file mode 100644 index 0000000..be8c70a --- /dev/null +++ b/src/arrowobj.h @@ -0,0 +1,56 @@ +#ifndef ARROWOBJ_H +#define ARROWOBJ_H + +#include "mapobj.h" + +#include + +/*! \brief arrows are used to indicate partially hidden ends of xlinks and + also the ends of xlinks. +*/ + +///////////////////////////////////////////////////////////////////////////// + +class ArrowObj : public MapObj { + public: + enum OrnamentStyle { None, HeadFull, Foot }; + ArrowObj(MapObj *parent); + virtual ~ArrowObj(); + virtual void init(); + void setPen(QPen pen); + QPen getPen(); + void setArrowSize(qreal r); + qreal getArrowSize(); + void setFixedLength(int i); + int getFixedLength(); + void setUseFixedLength(bool b); + bool getUseFixedLength(); + void show(); + void hide(); + void setVisibility(bool b); + void setEndPoint(QPointF p); + QPointF getEndPoint(); + void setStyleBegin(OrnamentStyle os); + void setStyleBegin(const QString &s); + OrnamentStyle getStyleBegin(); + void setStyleEnd(const QString &s); + void setStyleEnd(OrnamentStyle os); + OrnamentStyle getStyleEnd(); + static QString styleToString(const OrnamentStyle &os); + + private: + QPolygonF getArrowHead(); + QPen pen; + qreal arrowSize; + int fixedLength; + bool useFixedLength; + QGraphicsPolygonItem *arrowEnd; + QGraphicsPolygonItem *arrowBegin; + QGraphicsLineItem *line; + QPointF endPoint; + + OrnamentStyle styleBegin; + OrnamentStyle styleEnd; +}; + +#endif