StateEditorController.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
26 
28 
29 #include "../StatechartViewerPlugin/model/State.h"
30 
33 
34 #include <QObject>
35 
37 
39 
41 
42 namespace armarx
43 {
44 
45  class StateTreeController;
46  using StateTreeControllerPtr = std::shared_ptr<StateTreeController>;
47  class StateTreeNode;
48  using StateTreeNodePtr = std::shared_ptr<StateTreeNode>;
49 
50  class StateTabWidget;
51  class StateEditorController : public QObject
52  {
53  Q_OBJECT
54 
55  public:
57 
58  QList<QString> getRelevantProfiles() const;
59  signals:
60 
61  public slots:
62  void showStateContextMenu(statechartmodel::StateInstancePtr stateInstance, QPoint mouseScreenPos, QPointF mouseItemPos);
63  void showTransitionContextMenu(statechartmodel::TransitionCPtr transition, statechartmodel::StatePtr state, QPoint mouseScreenPos, QPointF mouseItemPos);
64  void setLockRemoteStatesByDefault(bool lock);
65  void editSelectedState();
66  private slots:
67  void connectToStateTab(int index);
68  protected:
70 
71  QMenu* createStateContextMenu();
73 
80  QPointer<TipDialog> tipDialog;
82  QMenu menu;
83  QAction* editState;
84  QAction* deleteState;
85  QAction* layoutState;
86  QAction* setstartstate;
87 
88  QAction* newEndstate;
89  QAction* replaceState;
90  QAction* openCode;
91  QAction* findStateInTree;
92  };
93  using StateEditorControllerPtr = std::shared_ptr<StateEditorController>;
94 
95 }
96 
armarx::StateEditorController::editState
QAction * editState
Definition: StateEditorController.h:83
armarx::StateTreeNode
Definition: StateTreeNode.h:40
armarx::StateEditorController::editSelectedState
void editSelectedState()
Definition: StateEditorController.cpp:340
armarx::StateEditorController::replaceState
QAction * replaceState
Definition: StateEditorController.h:89
armarx::StateEditorControllerPtr
std::shared_ptr< StateEditorController > StateEditorControllerPtr
Definition: StateEditorController.h:93
armarx::StateEditorController::getRelevantProfiles
QList< QString > getRelevantProfiles() const
Definition: StateEditorController.cpp:322
armarx::StateTreeNodePtr
std::shared_ptr< StateTreeNode > StateTreeNodePtr
Definition: StatechartGroupDefs.h:31
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::StateEditorController::communicator
Ice::CommunicatorPtr communicator
Definition: StateEditorController.h:77
armarx::StateEditorController::createStateContextMenu
QMenu * createStateContextMenu()
armarx::StateEditorController::tipDialog
QPointer< TipDialog > tipDialog
Definition: StateEditorController.h:80
armarx::StateEditorController::StateEditorController
StateEditorController(StatechartEditorMainWindow *mainWindow, StateTreeControllerPtr treeController, Ice::CommunicatorPtr communicator, VariantInfoPtr variantInfo, StatechartProfilePtr currentProfile, QPointer< TipDialog > tipDialog, QObject *parent=0)
Definition: StateEditorController.cpp:41
armarx::StateDialog
Definition: StateDialog.h:53
armarx::StatechartProfilePtr
std::shared_ptr< class StatechartProfile > StatechartProfilePtr
Definition: StatechartContext.h:52
StateDialog.h
armarx::EditorFileOpener
The EditorFileOpener class.
Definition: editorfileopener.h:40
armarx::StateEditorController
Definition: StateEditorController.h:51
StatechartEditorMainWindow.h
armarx::StateEditorController::openCode
QAction * openCode
Definition: StateEditorController.h:90
armarx::statechartmodel::StateInstancePtr
std::shared_ptr< StateInstance > StateInstancePtr
Definition: StateInstance.h:138
armarx::StateEditorController::treeController
StateTreeControllerPtr treeController
Definition: StateEditorController.h:75
IceInternal::Handle< ::Ice::Communicator >
armarx::StateEditorController::menu
QMenu menu
Definition: StateEditorController.h:82
armarx::StateEditorController::createTransitionContextMenu
QMenu * createTransitionContextMenu()
armarx::StateEditorController::currentProfile
StatechartProfilePtr currentProfile
Definition: StateEditorController.h:79
armarx::StateEditorController::deleteState
QAction * deleteState
Definition: StateEditorController.h:84
armarx::StateEditorController::findStateInTree
QAction * findStateInTree
Definition: StateEditorController.h:91
StatechartProfiles.h
armarx::StateEditorController::variantInfo
VariantInfoPtr variantInfo
Definition: StateEditorController.h:78
armarx::StateEditorController::stateDialogAccepted
void stateDialogAccepted(statechartmodel::StateInstancePtr stateInstance, const armarx::StateDialog &d)
Definition: StateEditorController.cpp:76
armarx::StateEditorController::setstartstate
QAction * setstartstate
Definition: StateEditorController.h:86
editorfileopener.h
armarx::StateTabWidget
Definition: StateTabWidget.h:34
armarx::StatechartEditorMainWindow
Definition: StatechartEditorMainWindow.h:46
armarx::StateEditorController::newEndstate
QAction * newEndstate
Definition: StateEditorController.h:88
armarx::StateEditorController::opener
EditorFileOpener opener
Definition: StateEditorController.h:76
armarx::StateEditorController::mainWindow
StatechartEditorMainWindow * mainWindow
Definition: StateEditorController.h:74
armarx::VariantInfoPtr
std::shared_ptr< VariantInfo > VariantInfoPtr
Definition: VariantInfo.h:39
armarx::statechartmodel::TransitionCPtr
std::shared_ptr< const Transition > TransitionCPtr
Definition: Transition.h:94
armarx::statechartmodel::StatePtr
std::shared_ptr< State > StatePtr
Definition: State.h:46
TipDialog.h
armarx::StateEditorController::showTransitionContextMenu
void showTransitionContextMenu(statechartmodel::TransitionCPtr transition, statechartmodel::StatePtr state, QPoint mouseScreenPos, QPointF mouseItemPos)
Definition: StateEditorController.cpp:206
armarx::StateEditorController::setLockRemoteStatesByDefault
void setLockRemoteStatesByDefault(bool lock)
Definition: StateEditorController.cpp:378
armarx::StateEditorController::layoutState
QAction * layoutState
Definition: StateEditorController.h:85
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::StateEditorController::lockRemoteStates
bool lockRemoteStates
Definition: StateEditorController.h:81
armarx::StateEditorController::showStateContextMenu
void showStateContextMenu(statechartmodel::StateInstancePtr stateInstance, QPoint mouseScreenPos, QPointF mouseItemPos)
Definition: StateEditorController.cpp:112
armarx::StateTreeControllerPtr
std::shared_ptr< StateTreeController > StateTreeControllerPtr
Definition: StateEditorController.h:46
VariantInfo.h