Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
TransitionItem Class Reference

Represents a transition between two nodes in a graphical representation. More...

#include <transition.h>

Inheritance diagram for TransitionItem:

Public Types

enum class  Edge { }
 Enumerates the types of edges that can be used for transitions. More...

Public Member Functions

 TransitionItem (std::shared_ptr< TransitionSaveInfo > storage)
 Constructs a new TransitionItem with the given storage information.
virtual ~TransitionItem ()
 Destructor for TransitionItem.
QString id () const
 Retrieves the unique identifier of this transition item.
int type () const override
 Retrieves the type of this graphics item.
void setStart (const QString &id, const QPointF &point, const QPointF &controlShift)
 Sets the start point and control shift for the transition.
void setEnd (const QString &id, const QPointF &point, const QPointF &controlShift)
 Sets the end point and control shift for the transition.
void done (NodeItem *source, NodeItem *destination)
 Completes the transition by setting source and destination nodes.
NodeItem * source () const
 Retrieves the source node of this transition.
NodeItem * destination () const
 Retrieves the destination node of this transition.
void move (const QString &id, QPointF pos)
 Moves the transition to a new position.
void updatePath (QPainterPath painterPath={})
 Updates the path of this transition item.
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
 Paints this graphics item using the given painter.
QPainterPath shape () const override
 Retrieves the shape of this graphics item.
TransitionSaveInfo saveInfo () const
 Retrieves the save information for this transition.
std::shared_ptr< TransitionSaveInfo > storage () const
 Retrieves the shared pointer to the storage information.
QString getName () const
 Retrieves the name of this transition.
void setName (const QString &name)
 Sets the name of this transition.
QString getEvent () const
 Retrieves the event associated with this transition.
void setEvent (const QString &name)
 Sets the event associated with this transition.
void setEdge (Edge edge)
 Sets the type of edge for this transition.

Public Attributes

std::function< void(TransitionItem *item)> transitionModified
 Signal emitted when the transition is deleted.

Private Member Functions

void updateLabelPosition ()
 Shared pointer to the storage information.

Private Attributes

const QString mId
 Signal emitted when the transition is modified.
bool mComplete
 Unique identifier for this transition.
Edge mEdge = Edge::NONE
 Flag indicating if the transition is complete.
NodeItem * mSource
 Type of edge used in the transition.
NodeItem * mDestination
 Pointer to the source node item.
QGraphicsTextItem * mLabel = nullptr
 Pointer to the destination node item.
std::shared_ptr< TransitionSaveInfo > mStorage
 Pointer to the label text item.

Detailed Description

Represents a transition between two nodes in a graphical representation.

Member Enumeration Documentation

◆ Edge

enum class TransitionItem::Edge
strong

Enumerates the types of edges that can be used for transitions.

Enumerator
FORWARD 

No edge type.

BACKWARD 

Forward transition edge.

ARC 

Backward transition edge.

Arc-shaped transition edge.

Constructor & Destructor Documentation

◆ TransitionItem()

TransitionItem::TransitionItem ( std::shared_ptr< TransitionSaveInfo > storage)

Constructs a new TransitionItem with the given storage information.

Parameters
storageShared pointer to the transition save info.

Member Function Documentation

◆ destination()

NodeItem * TransitionItem::destination ( ) const

Retrieves the destination node of this transition.

Returns
Pointer to the destination node item.

◆ done()

void TransitionItem::done ( NodeItem * source,
NodeItem * destination )

Completes the transition by setting source and destination nodes.

Parameters
sourcePointer to the source node item.
destinationPointer to the destination node item.

◆ getEvent()

QString TransitionItem::getEvent ( ) const

Retrieves the event associated with this transition.

Returns
The event as a QString.

◆ getName()

QString TransitionItem::getName ( ) const

Retrieves the name of this transition.

Returns
The name as a QString.

◆ id()

QString TransitionItem::id ( ) const

Retrieves the unique identifier of this transition item.

Returns
The ID as a QString.

◆ move()

void TransitionItem::move ( const QString & id,
QPointF pos )

Moves the transition to a new position.

Parameters
idUnique identifier for the node being moved.
posNew position.

◆ paint()

void TransitionItem::paint ( QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget )
override

Paints this graphics item using the given painter.

Parameters
painterPointer to the QPainter object.
optionPointer to the QStyleOptionGraphicsItem object.
widgetPointer to the QWidget object.

◆ saveInfo()

TransitionSaveInfo TransitionItem::saveInfo ( ) const

Retrieves the save information for this transition.

Returns
The TransitionSaveInfo object.

◆ setEdge()

void TransitionItem::setEdge ( Edge edge)

Sets the type of edge for this transition.

Parameters
edgeThe new Edge value.

◆ setEnd()

void TransitionItem::setEnd ( const QString & id,
const QPointF & point,
const QPointF & controlShift )

Sets the end point and control shift for the transition.

Parameters
idUnique identifier for the end node.
pointEnd position.
controlShiftControl point shift.

◆ setEvent()

void TransitionItem::setEvent ( const QString & name)

Sets the event associated with this transition.

Parameters
nameNew event for the transition.

◆ setName()

void TransitionItem::setName ( const QString & name)

Sets the name of this transition.

Parameters
nameNew name for the transition.

◆ setStart()

void TransitionItem::setStart ( const QString & id,
const QPointF & point,
const QPointF & controlShift )

Sets the start point and control shift for the transition.

Parameters
idUnique identifier for the start node.
pointStart position.
controlShiftControl point shift.

◆ shape()

QPainterPath TransitionItem::shape ( ) const
override

Retrieves the shape of this graphics item.

Returns
The QPainterPath representing the shape.

◆ source()

NodeItem * TransitionItem::source ( ) const

Retrieves the source node of this transition.

Returns
Pointer to the source node item.

◆ storage()

std::shared_ptr< TransitionSaveInfo > TransitionItem::storage ( ) const

Retrieves the shared pointer to the storage information.

Returns
Shared pointer to the TransitionSaveInfo.

◆ type()

int TransitionItem::type ( ) const
override

Retrieves the type of this graphics item.

Returns
The type as an integer.

The documentation for this class was generated from the following files:
  • /__w/maki/maki/app/elements/transition.h
  • /__w/maki/maki/app/elements/transition.cpp