Go to the documentation of this file.
26 #include <QAbstractItemModel>
27 #include <QSortFilterProxyModel>
39 #include "../StatechartViewerPlugin/model/StateMimeData.h"
40 #include "../StatechartViewerPlugin/model/stateinstance/StateInstance.h"
50 class StatechartProfiles;
54 class StateTreeController;
64 QList<QVariant> headerInfo,
66 QLineEdit* filterLineEdit,
73 QVariant
data(
const QModelIndex&
index,
int role)
const override;
74 Qt::ItemFlags
flags(
const QModelIndex&
index)
const override;
77 int role = Qt::DisplayRole)
const override;
79 index(
int row,
int column,
const QModelIndex& parentIndex = QModelIndex())
const override;
80 QModelIndex
parent(
const QModelIndex&
index)
const override;
81 int rowCount(
const QModelIndex&
parent = QModelIndex())
const override;
86 const QString& groupPath,
87 const QString& description,
88 const QString& packageName,
89 const QList<QString> proxies,
91 const QMap<QString, QString>& statechartGroupConfigurations);
109 bool createDynamicRemoteState =
false);
165 void processOutputReady();
166 void processErrorsReady();
167 void stateAddedOrRemoved();
168 void expandFilterResults(
const QString& filterString);
172 QString buildStateUsageString(QList<statechartmodel::StateInstancePtr> instances);
175 QList<QVariant> headerInfo;
182 QMenu* contextMenuGroup;
183 QMenu* contextMenuFolder;
184 QMenu* contextMenuState;
185 QAction* actionNewStateDefinition;
186 QAction* actionNewDynamicRemoteStateDefinition;
187 QAction* actionNewFolder;
188 QAction* actionDeleteNode;
189 QAction* actionMakeStatePublic;
190 QAction* actionFindStateUsages;
191 QAction* actionRenameState;
192 QAction* actionOpenCMakeProject;
193 QAction* actionShowFullPath;
194 QAction* actionOpenStateCPP;
195 QAction* actionExecuteGroup;
198 QAction* actionGenerateStateCPP;
199 QAction* actionCloneGroup;
200 QAction* actionRenameGroup;
201 QAction* actionGroupProperties;
206 QMap<QString, QProcess*> processes;
216 bool isPublic()
const override;
223 bool retrieveNewStateName(QString& newStateName,
225 bool& createCPPFiles,
226 bool askForCPPFiles);
232 QIcon getIcon(
const QString& path)
const;
233 mutable QMap<QString, QIcon> icons;
237 QMimeData*
mimeData(
const QModelIndexList& indexes)
const override;
StateTreeNodePtr getNodeByState(statechartmodel::StatePtr state)
The AbstractStateMimeData class is used to transport state data from the treeview to the stateview an...
StateTreeNodePtr getSelectedNode()
std::shared_ptr< StateTreeModel > StateTreeModelPtr
StateTreeNodePtr createNewState(QString name, StateTreeNodePtr parent, bool createDynamicRemoteState=false)
ScalarT Orientation(const VectorXD< 2, ScalarT > &p1, const VectorXD< 2, ScalarT > &p2, const VectorXD< 2, ScalarT > &c)
std::shared_ptr< ArmarXPackageToolInterface > ArmarXPackageToolInterfacePtr
void onStatechartFinished(int exitCode)
std::shared_ptr< StateTreeNode > StateTreeNodePtr
std::shared_ptr< Application > ApplicationPtr
void selectNodeByState(statechartmodel::StatePtr state)
Qt::ItemFlags flags(const QModelIndex &index) const override
bool selectedNodeIsFolder()
bool selectedNodeIsFolderOrGroup()
void removeFolder(StateTreeNodePtr folderNode)
void stopGroupExecutionWithDependencies(StatechartGroupPtr group)
std::shared_ptr< class StatechartProfile > StatechartProfilePtr
The EditorFileOpener class.
bool selectedNodeIsState()
void removeNodeFromTree(StateTreeNodePtr node)
QModelIndex index(int row, int column, const QModelIndex &parentIndex=QModelIndex()) const override
void onMakeStatePublic(bool enable)
~StateTreeController() override
StatechartGroupPtr addNewGroup(const QString &groupName, const QString &groupPath, const QString &description, const QString &packageName, const QList< QString > proxies, bool generateContext, const QMap< QString, QString > &statechartGroupConfigurations)
std::shared_ptr< GroupCloner > GroupClonerPtr
void openStateCPP(StateTreeNodePtr node)
int columnCount(const QModelIndex &parent=QModelIndex()) const override
std::shared_ptr< StatechartProfiles > StatechartProfilesPtr
void onNewStateDefinition()
void closeAllTabsRequested()
bool nodeIsState(StateTreeNodePtr node)
StatechartGroupPtr loadGroup(QString groupDefinitionFile)
void stopGroupExecution(StatechartGroupPtr group)
bool selectedNodeIsGroup()
StateTreeNodePtr tryCreateNewState(QString name)
void onNewDynamicRemoteStateDefinition()
StatechartGroupPtr loadAndAddGroup(QString groupDefinitionFile)
void removeState(StateTreeNodePtr stateNode)
void executeGroup(StatechartGroupPtr group, QString startState="")
std::shared_ptr< StatechartGroup > StatechartGroupPtr
void onContextMenu(const QPoint &point)
QMimeData * mimeData(const QModelIndexList &indexes) const override
StateTreeNodePtr getNode(QModelIndex index) const
StateTreeNodePtr createNewFolder(QString name, StateTreeNodePtr parent)
void onOpenCMakeProject()
bool nodeIsGroup(StateTreeNodePtr node)
std::shared_ptr< VariantInfo > VariantInfoPtr
void onGenerateStateCppFiles()
QModelIndex parent(const QModelIndex &index) const override
QStringList mimeTypes() const override
QVariant data(const QModelIndex &index, int role) const override
std::shared_ptr< State > StatePtr
This proxy model reimplements the filterAcceptsRow function with a new behavior: All elements that fi...
std::shared_ptr< GroupRenamer > GroupRenamerPtr
void selectNode(StateTreeNodePtr node)
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
void onOpenGroup(QString groupFile="")
void executeGroupWithDependencies(StatechartGroupPtr group, QString startState)
This file offers overloads of toIce() and fromIce() functions for STL container types.
StateTreeNodePtr getClosestParentFolderOrGroupNode(StateTreeNodePtr node)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
std::shared_ptr< StateTreeController > StateTreeControllerPtr
bool nodeIsFolderOrGroup(StateTreeNodePtr node)
bool nodeIsFolder(StateTreeNodePtr node)
StateTreeController(Ice::CommunicatorPtr ic, VariantInfoPtr variantInfo, QList< QVariant > headerInfo, QTreeView *treeView, QLineEdit *filterLineEdit, const ArmarXPackageToolInterfacePtr &packageTool, const StatechartProfilesPtr &statechartProfiles, StatechartProfilePtr currentProfile, QObject *parent=0)