4#include "elements/transition.h"
26 explicit BehaviourCanvas(std::shared_ptr<FlowSaveInfo> flow,
const QString& flowOwner, std::shared_ptr<EdgeRouter> router, QObject* parent =
nullptr);
34 virtual Types::LibraryTypes
type()
const override;
38 void nodeStarted(
NodeItem* node)
override;
40 QString requestCreateNode(
NodeSaveInfo info, NodeCreation creation)
override;
68 QVector<TransitionSaveInfo> transitionsOfNode(
const QString& nodeId)
override;
85 void onNodeGeometryChanged(
NodeItem* node,
const QRectF& oldRect)
override;
87 void ensureMinimumSpacing(
const QString& nodeId)
override;
98 void onSubFlowCollapsed(
NodeItem* node,
const QString& subflowId,
bool collapsed)
override;
100 void createNodeContextMenu(QMenu* menu,
NodeItem* node,
const QList<NodeItem*>& items)
override;
107 const QString mOwner;
109 TransitionSaveInfo makeTransitionInfo(
const QString& sourceId,
const QString& destinationId,
const QString& event,
const QString& label)
const;
111 QList<NodeItem*> getNeighboursOf(
const NodeItem* node,
int depth = -1)
const;
113 QPointF transitionPortAnchor(
NodeItem* node, Types::Port port,
const QPointF& fallback)
const;
114 void pushDownstreamNodes(
NodeItem* source, qreal deltaX);
void cleanFlow()
Deletes the Flow managed by this Canvas. This should not be called if the Flow is created by a NodeIt...
Definition behaviour_canvas.cpp:79
void onNodeMoved(NodeItem *node, bool done) override
Callback triggered whenever a node moves significantly.
Definition behaviour_canvas.cpp:375
PFlow mFlow
A pointer to the Flow object associated with this canvas.
Definition behaviour_canvas.h:106
TransitionConfig nextTransition(NodeItem *node) const override
Gets the next transition configuration for a given node.
Definition behaviour_canvas.cpp:189
virtual Types::LibraryTypes type() const override
Retrieves the type of library associated with this canvas.
Definition behaviour_canvas.cpp:29
void addTransition(TransitionItem *transition) override
Add the TransitionItem to the Flow managed by this Canvas.
Definition behaviour_canvas.cpp:229
void removeTransition(TransitionItem *transition) override
Removed the TransitionItem from the Flow managed by this Canvas.
Definition behaviour_canvas.cpp:235
QVector< QGraphicsItem * > cleanTransitionsOfNode(const QString &nodeId) override
Remove all transitions to and from a node with id nodeId.
Definition behaviour_canvas.cpp:201
bool canAddTransition(NodeItem *node, PortItem *port) const override
Checkes whether it is possible to add a new trasition to a node.
Definition behaviour_canvas.cpp:164
BehaviourCanvas(std::shared_ptr< FlowSaveInfo > flow, const QString &flowOwner, std::shared_ptr< EdgeRouter > router, QObject *parent=nullptr)
Constructs a BehaviourCanvas object.
Definition behaviour_canvas.cpp:16
Canvas(const QString &canvasId, std::shared_ptr< EdgeRouter > router, QObject *parent=nullptr)
Constructs a new Canvas object.
Definition canvas.cpp:52
Represents a graphical node item in a flowchart.
Definition node.h:28
Represents a node that can be saved and loaded.
Definition node_info.h:16
Configuration for a transition between nodes.
Definition config.h:44
Represents a transition between two nodes in a graphical representation.
Definition transition.h:16
Represents transition save information.
Definition transition_info.h:14