SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A graphics item that represents an arc between nodes in a diagram. More...
#include <qtBaseArc.h>
Public Types | |
using | ArcType = smtk::string::Token |
Public Slots | |
virtual int | updateArcPoints ()=0 |
Recompute points specifying the shape of the arc based on the current endpoint-node positions and geometry. | |
Public Member Functions | |
smtkSuperclassMacro (QGraphicsPathItem) | |
smtkTypeMacroBase (smtk::extension::qtBaseArc) | |
qtBaseArc (qtDiagramGenerator *generator, qtBaseNode *predecessor, qtBaseNode *successor, ArcType arcType, QGraphicsItem *parent=nullptr) | |
Construct an arc. More... | |
QRectF | boundingRect () const override |
Get the bounding box of the node, which includes the border width and the label. | |
qtDiagramGenerator * | generator () const |
qtDiagramScene * | scene () const |
ArcType | arcType () const |
qtBaseNode * | predecessor () const |
qtBaseNode * | successor () const |
Protected Member Functions | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override |
Draw the arc into the scene. | |
Protected Attributes | |
qtDiagramGenerator * | m_generator { nullptr } |
qtBaseNode * | m_predecessor { nullptr } |
qtBaseNode * | m_successor { nullptr } |
ArcType | m_arcType |
QPainterPath | m_computedPath |
QPainterPath | m_arrowPath |
A graphics item that represents an arc between nodes in a diagram.
smtk::extension::qtBaseArc::qtBaseArc | ( | qtDiagramGenerator * | generator, |
qtBaseNode * | predecessor, | ||
qtBaseNode * | successor, | ||
ArcType | arcType, | ||
QGraphicsItem * | parent = nullptr |
||
) |
Construct an arc.
By default, arcs monitor their predecessor and successor nodes; when either is moved, the pure-virtual updateArcPoints() is called and the arc geometry is updated.
Note that because qtBaseArc has pure virtual methods, your subclass must call the following in its constructor (assuming your subclass provides implementations of pure virtual methods).
Arcs have caching turned off since they are cheap to draw and often have large bounding boxes that are mostly empty.