SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
smtk::extension::qtBaseArc Class Referenceabstract

A graphics item that represents an arc between nodes in a diagram. More...

#include <qtBaseArc.h>

Inheritance diagram for smtk::extension::qtBaseArc:
[legend]
Collaboration diagram for smtk::extension::qtBaseArc:
[legend]

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.
 
qtDiagramGeneratorgenerator () const
 
qtDiagramScenescene () const
 
ArcType arcType () const
 
qtBaseNodepredecessor () const
 
qtBaseNodesuccessor () const
 

Protected Member Functions

void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
 Draw the arc into the scene.
 

Protected Attributes

qtDiagramGeneratorm_generator { nullptr }
 
qtBaseNodem_predecessor { nullptr }
 
qtBaseNodem_successor { nullptr }
 
ArcType m_arcType
 
QPainterPath m_computedPath
 
QPainterPath m_arrowPath
 

Detailed Description

A graphics item that represents an arc between nodes in a diagram.

Constructor & Destructor Documentation

◆ qtBaseArc()

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).

this->scene()->addItem(this);

Arcs have caching turned off since they are cheap to draw and often have large bounding boxes that are mostly empty.


The documentation for this class was generated from the following files:
smtk::extension::qtBaseArc::updateArcPoints
virtual int updateArcPoints()=0
Recompute points specifying the shape of the arc based on the current endpoint-node positions and geo...