Computer Assited Medical Intervention Tool Kit  version 5.0
ActionCreationState.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 #ifndef ACTIONCREATIONSTATE_H
26 #define ACTIONCREATIONSTATE_H
27 
28 #include <QState>
29 #include <QWidget>
30 
31 class WizardMainWindow;
33 
34 // Sub-states
42 class ActionSummaryState;
43 
44 // Dependency from cepcoreschema
45 // Declaration here to avoid declaration in dependant projects.
46 namespace cepcoreschema {
47 class ActionExtension;
48 class Action;
49 class Cep;
50 }
51 
61 class ActionCreationState : public QState {
62 
63  Q_OBJECT;
64 
65 public:
67  ActionCreationState(QString name, WizardMainWindow* mainWidnow, cepcoreschema::Cep* domCep, ActionExtensionCreationState* parent);
68 
70  ~ActionCreationState() override = default;
71 
72  void resetDomActionExtension(cepcoreschema::ActionExtension* domActionExtension);
73 
74 signals:
75  void nextACS();
76 
77 public slots:
78  virtual void actionFinished();
79  virtual void actionCancelled();
80 
81 protected:
84  void onEntry(QEvent* event) override;
85 
86  void onExit(QEvent* event) override;
88 
98 
99 
100 private:
101  void createSubStates(WizardMainWindow* mainWindow);
102 
103  bool cancelled;
104  QString name;
105  cepcoreschema::ActionExtension* domActionExtension;
106  cepcoreschema::Action* domAction;
107  cepcoreschema::Cep* domCep;
108 
109 };
110 #endif
ActionCreationState
State to create one action.
Definition: ActionCreationState.h:61
WizardMainWindow
The main window of the Wizard. All state widgets are contained in this window.
Definition: WizardMainWindow.h:43
ActionAddParameterWidget
Widget to add or remove parameters to the action.
Definition: ActionAddParameterWidget.h:46
ActionCreationState::domCep
cepcoreschema::Cep * domCep
Definition: ActionCreationState.h:107
ActionAddParameterState::resetDomAction
void resetDomAction(cepcoreschema::Action *domAction)
Definition: ActionAddParameterState.cpp:45
ActionClassificationWidget.h
ActionSummaryWidget
Widget to summarize the created action.
Definition: ActionSummaryWidget.h:42
ActionSummaryState
State to summarize the created action.
Definition: ActionSummaryState.h:45
ActionCreationState::createSubStates
void createSubStates(WizardMainWindow *mainWindow)
Definition: ActionCreationState.cpp:98
ActionCreationState::actionAddParameterState
ActionAddParameterState * actionAddParameterState
Definition: ActionCreationState.h:93
ActionCreationState::ActionCreationState
ActionCreationState(QString name, WizardMainWindow *mainWidnow, cepcoreschema::Cep *domCep, ActionExtensionCreationState *parent)
Constructor.
Definition: ActionCreationState.cpp:44
ActionClassificationState.h
ActionDescriptionState.h
ActionCreationState::~ActionCreationState
~ActionCreationState() override=default
Destructor.
ActionDescriptionState::resetDomAction
void resetDomAction(cepcoreschema::Action *domAction, cepcoreschema::ActionExtension *domActionExtension)
Definition: ActionDescriptionState.cpp:53
ActionCreationState::actionCancelled
virtual void actionCancelled()
Definition: ActionCreationState.cpp:93
ActionSummaryWidget.h
ActionCreationState::nextACS
void nextACS()
ActionCreationState::onEntry
void onEntry(QEvent *event) override
Reimplemented from QState.
Definition: ActionCreationState.cpp:59
ActionCreationState::actionClassificationWidget
ActionClassificationWidget * actionClassificationWidget
Definition: ActionCreationState.h:94
ActionAddParameterWidget.h
ActionDescriptionWidget.h
ActionSummaryState::resetAction
void resetAction(cepcoreschema::Action *domAction)
Definition: ActionSummaryState.cpp:43
ActionCreationState.h
ActionDescriptionWidget
Widget to describe action.
Definition: ActionDescriptionWidget.h:41
ActionClassificationState
State to class the action and to attribute a tag to it.
Definition: ActionClassificationState.h:46
ActionCreationState::name
QString name
Definition: ActionCreationState.h:104
ActionSummaryState.h
ActionCreationState::actionClassificationState
ActionClassificationState * actionClassificationState
Definition: ActionCreationState.h:95
ActionExtensionCreationState
State to create an action extension. .
Definition: ActionExtensionCreationState.h:60
ActionDescriptionState
State to describe action.
Definition: ActionDescriptionState.h:48
ActionCreationState::domActionExtension
cepcoreschema::ActionExtension * domActionExtension
Definition: ActionCreationState.h:105
ActionCreationState::onExit
void onExit(QEvent *event) override
Definition: ActionCreationState.cpp:76
ActionCreationState::actionSummaryState
ActionSummaryState * actionSummaryState
Definition: ActionCreationState.h:97
ActionCreationState::actionFinished
virtual void actionFinished()
Definition: ActionCreationState.cpp:88
ActionCreationState::resetDomActionExtension
void resetDomActionExtension(cepcoreschema::ActionExtension *domActionExtension)
Definition: ActionCreationState.cpp:55
ActionAddParameterState
State to add parameters in the action.
Definition: ActionAddParameterState.h:49
ActionClassificationWidget
Widget to class the action and to attribute a tag to it.
Definition: ActionClassificationWidget.h:43
ActionCreationState::actionDescriptionState
ActionDescriptionState * actionDescriptionState
Definition: ActionCreationState.h:91
ActionCreationState::cancelled
bool cancelled
Definition: ActionCreationState.h:103
ActionCreationState::domAction
cepcoreschema::Action * domAction
Definition: ActionCreationState.h:106
ActionClassificationState::resetDomAction
void resetDomAction(cepcoreschema::Action *domAction)
Definition: ActionClassificationState.cpp:44
ActionAddParameterState.h
ActionExtensionCreationState.h
ActionCreationState::actionAddParameterWidget
ActionAddParameterWidget * actionAddParameterWidget
Definition: ActionCreationState.h:92
cepcoreschema
Definition: ActionExtensionGenerator.h:36
WizardMainWindow.h
ActionCreationState::actionDescriptionWidget
ActionDescriptionWidget * actionDescriptionWidget
Substates (to be updated with domAction at each entry)
Definition: ActionCreationState.h:90
ActionCreationState::actionSummaryWidget
ActionSummaryWidget * actionSummaryWidget
Definition: ActionCreationState.h:96