#include <ArmarXGui/gui-plugins/StatechartViewerPlugin/layout/StateModelLayoutMediator.h>
◆ StateModelLayoutMediator()
LayoutWorker Sets state and id as specified.
Initializes an empty Graph.
- Parameters
-
| state | The state which this worker layouts. |
| id | The mediator's ID for communication with the LayoutController. |
◆ boundingRectForAgraph()
| QRectF boundingRectForAgraph |
( |
Agraph_t * | graph | ) |
const |
◆ buildUpGraph
buildUpGraph To be called when the corresponding worker initialized the graph.
Traverses the state and adds all transitions and states to the graph as well as to EdgeList and NodeMap.
- Parameters
-
| graph | The graphviz graph that shall represent the state. |
◆ deleteMe
| void deleteMe |
( |
size_t | id | ) |
|
|
signal |
deleteMe To be emitted when this mediator and its worker ought to be deleted because their corresponding state was deleted.
- Parameters
-
◆ getGraphAttribute()
| std::string getGraphAttribute |
( |
ElementType * | element, |
|
|
const std::string & | attributeName ) const |
|
inline |
◆ getID()
getID Returns this mediator's id.
- Returns
- ID for communication with the LayoutController
◆ getState()
getState Returns the state associated with this mediator.
- Returns
- The state that is layouted by the mediator's worker.
◆ hasGraphAttribute()
| bool hasGraphAttribute |
( |
ElementType * | element, |
|
|
const std::string & | attributeName ) const |
|
inline |
◆ isConnected()
isConnected Indicates whether this mediator is connected to a worker.
- Returns
- True if it is connected to a worker.
◆ layout
| void layout |
( |
bool | layoutAll | ) |
|
|
signal |
layout Tells worker to layout the graph.
- Parameters
-
| layoutAll | True: layout nodes and edgese. False: layout only edges. |
◆ layoutingFinished
| void layoutingFinished |
( |
| ) |
|
|
signal |
layoutingFinished Notifies that the latest layout task was finished.
◆ mediatorDeleted
mediatorDeleted Tells worker that is has to be deleted.
◆ scheduleMe
| void scheduleMe |
( |
size_t | id, |
|
|
bool | layoutAll ) |
|
signal |
scheduleMe To be called when its graph should be layouted.
Is meant for the Controller to schedule this mediator in its layout queue.
- Parameters
-
| id | This mediator's id. |
| layoutAll | Indicates whether the whole graph (including nodes) should be layouted or only the edges. |
◆ setGraphAttribute()
| int setGraphAttribute |
( |
ElementType * | element, |
|
|
const std::string & | attributeName, |
|
|
const ValueType & | value ) const |
|
inline |
◆ startLayouting
| void startLayouting |
( |
bool | layoutAll, |
|
|
int | counter ) |
|
slot |
layout Tells the worker to layout edges and, if layoutAlgo is true, nodes of the graph.
Signals changes of positions to the state.
- Parameters
-
| layoutAll | If true, nodes and edges are layouted, if false, node positions are assumed to be fixed and only edges are routed. |
◆ stateChanged
comment to prevent warnings if (!isConnectedToWorker) { return; }
switch (signalType)
{
case (statechartmodel::eUnchanged):
case (statechartmodel::eActivated):
nothing to do return; case (statechartmodel::eAdded): case (statechartmodel::eRemoved): case (statechartmodel::eChanged): auto sizeString = GraphvizConverter::convertFromPoint(QPointF(m_state->getSize().width() / dpi.width(), m_state->getSize().height() / dpi.height())); ARMARX_INFO_S << "state changed for" << m_state->getStateName(); ARMARX_INFO_S << "Graphviz graph size: " << sizeString; setGraphAttribute(m_graph->graph, "size", sizeString); setGraphAttribute(m_graph->graph, "ratio", m_state->getSize().height() / m_state->getSize().width()); default: ARMARX_WARNING << "CASE NOT HANDLED " << signalType; }
emit scheduleMe(id, true);
◆ stateDeleted
stateDeleted To be called when the corresponding state is deleted.
◆ substateChanged
substateAdded To be called when a substate of state has changed.
- Parameters
-
| substate | The changed substate. |
| signalType | The type of signal (added, removed, moved etc.). |
◆ substateFound
substateFound To be emitted when a substate is found when building up the graph for the first time.
- Parameters
-
| substate | The substate that was discovered. |
| signalType | Type of change to the substate. Should be eAdded. |
◆ supportPointsChanged
supportPointsChanged Notifies of changed support points of the given transition.
- Parameters
-
| transition | Transition whose support points have changed. |
| suppPoints | New support points. |
◆ transitionChanged
transitionAdded To be called when a transition of state has changed.
- Parameters
-
| transition | The changed transition. |
| signalType | The type of signal (added, removed, moved etc.). |
◆ workerFinishedLayouting
| void workerFinishedLayouting |
( |
| ) |
|
|
slot |
workerFinishedLayouting To be called when the worker is finished layouting.
Notifies the controller.
The documentation for this class was generated from the following files: