StateItem Class Reference

#include <ArmarXGui/gui-plugins/StatechartViewerPlugin/view/StateItem.h>

+ Inheritance diagram for StateItem:

Public Slots

void adjustSize ()
 
void forwardTransitionContextMenuRequested (statechartmodel::TransitionCPtr transition, QPoint mouseScreenPos, QPointF mouseItemPos)
 
void notifyStateChanged (statechartmodel::SignalType signalType)
 
void notifySubstateChanged (statechartmodel::StateInstancePtr substate, statechartmodel::SignalType signalType)
 
void notifyTransitionChanged (statechartmodel::TransitionCPtr transition, statechartmodel::SignalType signalType)
 
void notifyTransitionsChanged (statechartmodel::StateInstancePtr transition, statechartmodel::SignalType signalType)
 
void setActiveState (bool active)
 
void setActiveSubstate (const QString &substateName)
 
void setInstanceName (const QString &value)
 
void transitionMoved (statechartmodel::TransitionCPtr transition, QPointF dropPoint)
 
void viewAll ()
 

Signals

void stateContextMenuRequested (statechartmodel::StateInstancePtr stateInstace, QPoint mouseScreenPos, QPointF mouseItemPos)
 
void stateItemBoundingBoxChanged (float newSquareBoundingBoxSize)
 
void stateItemMoved (QPointF newPosition)
 
void stateItemResized (QSizeF newSize)
 
void transitionContextMenuRequested (statechartmodel::TransitionCPtr transition, statechartmodel::StatePtr state, QPoint mouseScreenPos, QPointF mouseItemPos)
 

Public Member Functions

void clearActiveSubstate ()
 
QString getFullStatePath () const
 
QString getInstanceName () const
 
LevelOfDetail getLevelOfDetail (float levelOfDetail) const override
 
int getMaxShownSubstateLevel () const
 
StateItemgetParentStateItem () const
 
statechartmodel::StateInstancePtr getStateInstance () const
 
QVector< StateItem * > getSubstateItems () const
 
QVector< TransitionItem * > getTransitionItems () const
 
bool hasAncestor (statechartmodel::StatePtr state) const
 
bool hasDescendant (statechartmodel::StatePtr state) const
 
void setMaxShownSubstateLevel (int value)
 
 StateItem (statechartmodel::StateInstancePtr state, QGraphicsItem *parent=0)
 
 ~StateItem () override
 
- Public Member Functions inherited from RoundRectItem
void adjustScale (float &resultScalefactor)
 
QRectF boundingRect () const override
 
bool isEditable () const
 
bool isLevelOfDetailLow (QGraphicsSceneEvent *event) const
 
QVariant itemChange (QGraphicsItem::GraphicsItemChange change, const QVariant &value) override
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) override
 
 RoundRectItem (const QRectF &bounds, const QColor &color, QGraphicsItem *parent=0)
 
void setBounds (QRectF newBounds)
 
void setColor (QColor newColor)
 
void setEditable (bool editable)
 
void setRimPen (QPen newPen)
 
void setSize (const QSizeF &newSize)
 
- Public Member Functions inherited from Logging
SpamFilterDataPtr deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
 disables the logging for the current line for the given amount of seconds. More...
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More...
 
void setTag (const LogTag &tag)
 
void setTag (const std::string &tagName)
 
virtual ~Logging ()
 
- Public Member Functions inherited from MorphingItem
virtual LevelOfDetail getLevelOfDetail (QPainter *painter) const
 
virtual LevelOfDetail getLevelOfDetailByParent (QPainter *painter, MorphingItem *parent) const
 
 MorphingItem (QGraphicsItem *derivedItem)
 

Protected Types

using StateInstanceItemMap = QMap< statechartmodel::StateInstancePtr, QPointer< StateItem > >
 
using TransitionMap = QMap< statechartmodel::TransitionCPtr, QPointer< TransitionItem > >
 

Protected Member Functions

QPointF adjustPosition (QPointF &newPos) override
 
void connectSlots ()
 
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event) override
 
void dragEnterEvent (QGraphicsSceneDragDropEvent *event) override
 
void dragMoveEvent (QGraphicsSceneDragDropEvent *event) override
 
void dropEvent (QGraphicsSceneDragDropEvent *event) override
 
int getInstanceLevel () const
 
void initialCreation ()
 
void itemBoundingBoxChanged (float oldSize, float size) override
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 
void itemMoved (const QPointF &oldPos, const QPointF &newPos) override
 
void itemResized (const QRectF &oldSize, const QRectF &newSize) override
 
bool itemResizing (const QRectF &oldSize, QRectF &proposedSize) override
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
 
void removeChildren ()
 
void setRimColor ()
 
void setStateColor ()
 
void setup (QGraphicsItem *parent)
 
void updateToolTip ()
 
- Protected Member Functions inherited from RoundRectItem
void adjustCursor (Qt::CursorShape shape)
 
QRectF getBottomResizeBB () const
 
QRectF getLeftResizeBB () const
 
QRectF getRightResizeBB () const
 
QRectF getTopResizeBB () const
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 
void hoverMoveEvent (QGraphicsSceneHoverEvent *event) override
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 
- Protected Member Functions inherited from Logging
bool checkLogLevel (MessageTypeT level) const
 
const LogSenderPtrgetLogSender () const
 Retrieve log sender. More...
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 

Protected Attributes

bool active = false
 
QString instanceName
 
int maxShownSubstateLevel = -1
 
statechartmodel::StateInstancePtr state
 
StateScenestateScene
 
StateInstanceItemMap subStates
 
QWidget * subWidget
 
TransitionMap transitions
 
- Protected Attributes inherited from RoundRectItem
QRectF bounds
 
- Protected Attributes inherited from Logging
MessageTypeT minimumLoggingLevel
 
SpamFilterDataPtr spamFilter
 
LogTag tag
 

Additional Inherited Members

- Static Public Member Functions inherited from MorphingItem
static QGraphicsView * getView (QGraphicsSceneEvent *event)
 
- Static Public Attributes inherited from MorphingItem
static constexpr float hideOnHighDeZoomThreshold = 10.f
 
static constexpr float minSizeToShowSubstates = 70.f
 

Detailed Description

Definition at line 58 of file StateItem.h.

Member Typedef Documentation

◆ StateInstanceItemMap

Definition at line 127 of file StateItem.h.

◆ TransitionMap

using TransitionMap = QMap<statechartmodel::TransitionCPtr, QPointer<TransitionItem> >
protected

Definition at line 130 of file StateItem.h.

Constructor & Destructor Documentation

◆ StateItem()

StateItem ( statechartmodel::StateInstancePtr  state,
QGraphicsItem *  parent = 0 
)
explicit

Definition at line 52 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~StateItem()

~StateItem ( )
override

Definition at line 77 of file StateItem.cpp.

Member Function Documentation

◆ adjustPosition()

QPointF adjustPosition ( QPointF &  newPos)
overrideprotectedvirtual

Reimplemented from RoundRectItem.

Definition at line 617 of file StateItem.cpp.

◆ adjustSize

void adjustSize ( )
slot

Definition at line 422 of file StateItem.cpp.

+ Here is the caller graph for this function:

◆ clearActiveSubstate()

void clearActiveSubstate ( )

Definition at line 655 of file StateItem.cpp.

+ Here is the call graph for this function:

◆ connectSlots()

void connectSlots ( )
protected

Definition at line 443 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ contextMenuEvent()

void contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
overrideprotected

Definition at line 772 of file StateItem.cpp.

+ Here is the call graph for this function:

◆ dragEnterEvent()

void dragEnterEvent ( QGraphicsSceneDragDropEvent *  event)
overrideprotected

Definition at line 838 of file StateItem.cpp.

+ Here is the caller graph for this function:

◆ dragMoveEvent()

void dragMoveEvent ( QGraphicsSceneDragDropEvent *  event)
overrideprotected

Definition at line 855 of file StateItem.cpp.

+ Here is the call graph for this function:

◆ dropEvent()

void dropEvent ( QGraphicsSceneDragDropEvent *  event)
overrideprotected

Definition at line 862 of file StateItem.cpp.

+ Here is the call graph for this function:

◆ forwardTransitionContextMenuRequested

void forwardTransitionContextMenuRequested ( statechartmodel::TransitionCPtr  transition,
QPoint  mouseScreenPos,
QPointF  mouseItemPos 
)
slot

Definition at line 383 of file StateItem.cpp.

+ Here is the caller graph for this function:

◆ getFullStatePath()

QString getFullStatePath ( ) const

Definition at line 664 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstanceLevel()

int getInstanceLevel ( ) const
protected

Definition at line 605 of file StateItem.cpp.

+ Here is the caller graph for this function:

◆ getInstanceName()

QString getInstanceName ( ) const

Definition at line 710 of file StateItem.cpp.

+ Here is the caller graph for this function:

◆ getLevelOfDetail()

LevelOfDetail getLevelOfDetail ( float  levelOfDetail) const
overridevirtual

Reimplemented from MorphingItem.

Definition at line 971 of file StateItem.cpp.

+ Here is the call graph for this function:

◆ getMaxShownSubstateLevel()

int getMaxShownSubstateLevel ( ) const

Definition at line 627 of file StateItem.cpp.

◆ getParentStateItem()

StateItem * getParentStateItem ( ) const

Definition at line 676 of file StateItem.cpp.

◆ getStateInstance()

statechartmodel::StateInstancePtr getStateInstance ( ) const
inline

Definition at line 70 of file StateItem.h.

+ Here is the caller graph for this function:

◆ getSubstateItems()

QVector< StateItem * > getSubstateItems ( ) const

Definition at line 682 of file StateItem.cpp.

+ Here is the caller graph for this function:

◆ getTransitionItems()

QVector< TransitionItem * > getTransitionItems ( ) const

Definition at line 696 of file StateItem.cpp.

◆ hasAncestor()

bool hasAncestor ( statechartmodel::StatePtr  state) const

Definition at line 936 of file StateItem.cpp.

+ Here is the caller graph for this function:

◆ hasDescendant()

bool hasDescendant ( statechartmodel::StatePtr  state) const

Definition at line 961 of file StateItem.cpp.

◆ initialCreation()

void initialCreation ( )
protected

Definition at line 465 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itemBoundingBoxChanged()

void itemBoundingBoxChanged ( float  oldSize,
float  size 
)
overrideprotectedvirtual

Reimplemented from RoundRectItem.

Definition at line 761 of file StateItem.cpp.

◆ itemChange()

QVariant itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
overrideprotected

Definition at line 791 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itemMoved()

void itemMoved ( const QPointF &  oldPos,
const QPointF &  newPos 
)
overrideprotectedvirtual

Reimplemented from RoundRectItem.

Definition at line 750 of file StateItem.cpp.

◆ itemResized()

void itemResized ( const QRectF &  oldSize,
const QRectF &  newSize 
)
overrideprotectedvirtual

Reimplemented from RoundRectItem.

Definition at line 742 of file StateItem.cpp.

◆ itemResizing()

bool itemResizing ( const QRectF &  oldSize,
QRectF &  proposedSize 
)
overrideprotectedvirtual

Reimplemented from RoundRectItem.

Definition at line 730 of file StateItem.cpp.

◆ notifyStateChanged

void notifyStateChanged ( statechartmodel::SignalType  signalType)
slot

Definition at line 196 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notifySubstateChanged

void notifySubstateChanged ( statechartmodel::StateInstancePtr  substate,
statechartmodel::SignalType  signalType 
)
slot

Definition at line 213 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notifyTransitionChanged

void notifyTransitionChanged ( statechartmodel::TransitionCPtr  transition,
statechartmodel::SignalType  signalType 
)
slot

Definition at line 303 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notifyTransitionsChanged

void notifyTransitionsChanged ( statechartmodel::StateInstancePtr  transition,
statechartmodel::SignalType  signalType 
)
slot

Definition at line 368 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ paint()

void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
overrideprotected

Definition at line 82 of file StateItem.cpp.

+ Here is the call graph for this function:

◆ removeChildren()

void removeChildren ( )
protected

Definition at line 583 of file StateItem.cpp.

+ Here is the call graph for this function:

◆ setActiveState

void setActiveState ( bool  active)
slot

Definition at line 724 of file StateItem.cpp.

+ Here is the call graph for this function:

◆ setActiveSubstate

void setActiveSubstate ( const QString &  substateName)
slot

Definition at line 645 of file StateItem.cpp.

+ Here is the call graph for this function:

◆ setInstanceName

void setInstanceName ( const QString &  value)
slot

Definition at line 715 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMaxShownSubstateLevel()

void setMaxShownSubstateLevel ( int  value)

Definition at line 632 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRimColor()

void setRimColor ( )
protected

Definition at line 551 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStateColor()

void setStateColor ( )
protected

Definition at line 494 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setup()

void setup ( QGraphicsItem *  parent)
protected

Definition at line 435 of file StateItem.cpp.

+ Here is the caller graph for this function:

◆ stateContextMenuRequested

void stateContextMenuRequested ( statechartmodel::StateInstancePtr  stateInstace,
QPoint  mouseScreenPos,
QPointF  mouseItemPos 
)
signal
+ Here is the caller graph for this function:

◆ stateItemBoundingBoxChanged

void stateItemBoundingBoxChanged ( float  newSquareBoundingBoxSize)
signal
+ Here is the caller graph for this function:

◆ stateItemMoved

void stateItemMoved ( QPointF  newPosition)
signal
+ Here is the caller graph for this function:

◆ stateItemResized

void stateItemResized ( QSizeF  newSize)
signal
+ Here is the caller graph for this function:

◆ transitionContextMenuRequested

void transitionContextMenuRequested ( statechartmodel::TransitionCPtr  transition,
statechartmodel::StatePtr  state,
QPoint  mouseScreenPos,
QPointF  mouseItemPos 
)
signal
+ Here is the caller graph for this function:

◆ transitionMoved

void transitionMoved ( statechartmodel::TransitionCPtr  transition,
QPointF  dropPoint 
)
slot

Definition at line 388 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateToolTip()

void updateToolTip ( )
protected

Definition at line 565 of file StateItem.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ viewAll

void viewAll ( )
slot

Definition at line 417 of file StateItem.cpp.

Member Data Documentation

◆ active

bool active = false
protected

Definition at line 133 of file StateItem.h.

◆ instanceName

QString instanceName
protected

Definition at line 129 of file StateItem.h.

◆ maxShownSubstateLevel

int maxShownSubstateLevel = -1
protected

Definition at line 132 of file StateItem.h.

◆ state

Definition at line 126 of file StateItem.h.

◆ stateScene

StateScene* stateScene
protected

Definition at line 125 of file StateItem.h.

◆ subStates

StateInstanceItemMap subStates
protected

Definition at line 128 of file StateItem.h.

◆ subWidget

QWidget* subWidget
protected

Definition at line 124 of file StateItem.h.

◆ transitions

TransitionMap transitions
protected

Definition at line 131 of file StateItem.h.


The documentation for this class was generated from the following files: