Computer Assited Medical Intervention Tool Kit  version 5.0
ComponentCreationState.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 COMPONENTCREATIONSTATE_H
26 #define COMPONENTCREATIONSTATE_H
27 
28 #include <QState>
29 #include <QWidget>
30 
31 class WizardMainWindow;
33 
34 // Sub-States
41 
42 // Dependency from cepcoreschema
43 // Declaration here to avoid declaration in dependant projects.
44 namespace cepcoreschema {
45 class ComponentExtension;
46 class Component;
47 }
48 
58 class ComponentCreationState : public QState {
59 
60  Q_OBJECT;
61 
62 public:
66  ~ComponentCreationState() override = default;
67 
68  void resetDomComponentExtension(cepcoreschema::ComponentExtension* domComponentExtension);
69 
70 signals:
71  void nextCCS();
72 
73 public slots:
74  virtual void componentFinished();
75  virtual void componentCancelled();
76 
77 protected:
80  void onEntry(QEvent* event) override;
81 
82  void onExit(QEvent* event) override;
84 
85  // Substates (to be updated with domComponent at each entry)
92 
93 private:
94  void createSubStates(WizardMainWindow* mainWindow);
95 
96  bool cancelled;
97  QString name;
98  cepcoreschema::ComponentExtension* domComponentExtension;
99  cepcoreschema::Component* domComponent;
100 
101 };
102 #endif
ComponentExtensionCreationState
State to create component extension.
Definition: ComponentExtensionCreationState.h:57
WizardMainWindow
The main window of the Wizard. All state widgets are contained in this window.
Definition: WizardMainWindow.h:43
ComponentCreationState::onExit
void onExit(QEvent *event) override
Definition: ComponentCreationState.cpp:73
ComponentSummaryWidget
Widget to summarise the component creation.
Definition: ComponentSummaryWidget.h:42
ComponentCreationState::resetDomComponentExtension
void resetDomComponentExtension(cepcoreschema::ComponentExtension *domComponentExtension)
Definition: ComponentCreationState.cpp:52
ComponentCreationState
State to create one component.
Definition: ComponentCreationState.h:58
ComponentCreationState::componentCancelled
virtual void componentCancelled()
Definition: ComponentCreationState.cpp:90
ComponentSummaryWidget.h
ComponentSummaryState
State to summarise component creation.
Definition: ComponentSummaryState.h:45
ComponentDescriptionState::resetDomComponent
void resetDomComponent(cepcoreschema::Component *domComponent, cepcoreschema::ComponentExtension *domComponentExtension)
Definition: ComponentDescriptionState.cpp:45
ComponentCreationState::ComponentCreationState
ComponentCreationState(QString name, WizardMainWindow *mainWidnow, ComponentExtensionCreationState *parent)
Constructor.
Definition: ComponentCreationState.cpp:42
ComponentCreationState::componentSummaryWidget
ComponentSummaryWidget * componentSummaryWidget
Definition: ComponentCreationState.h:90
ComponentCreationState::componentAddPropertyState
ComponentAddPropertyState * componentAddPropertyState
Definition: ComponentCreationState.h:89
ComponentSummaryState::resetComponent
void resetComponent(cepcoreschema::Component *domComponent)
Definition: ComponentSummaryState.cpp:41
ComponentCreationState::componentSummaryState
ComponentSummaryState * componentSummaryState
Definition: ComponentCreationState.h:91
ComponentDescriptionState.h
ComponentCreationState::cancelled
bool cancelled
Definition: ComponentCreationState.h:96
ComponentDescriptionWidget.h
ComponentCreationState::domComponentExtension
cepcoreschema::ComponentExtension * domComponentExtension
Definition: ComponentCreationState.h:98
ComponentCreationState::nextCCS
void nextCCS()
ComponentAddPropertyState.h
ComponentExtensionCreationState.h
ComponentAddPropertyWidget
Widget to add or remove properties to the component.
Definition: ComponentAddPropertyWidget.h:46
ComponentSummaryState.h
ComponentDescriptionState
State to describe component.
Definition: ComponentDescriptionState.h:47
ComponentCreationState.h
ComponentDescriptionWidget
Widget to describe component.
Definition: ComponentDescriptionWidget.h:41
ComponentCreationState::componentDescriptionWidget
ComponentDescriptionWidget * componentDescriptionWidget
Definition: ComponentCreationState.h:86
ComponentCreationState::onEntry
void onEntry(QEvent *event) override
Reimplemented from QState.
Definition: ComponentCreationState.cpp:57
Component
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
ComponentCreationState::name
QString name
Definition: ComponentCreationState.h:97
ComponentCreationState::componentAddPropertyWidget
ComponentAddPropertyWidget * componentAddPropertyWidget
Definition: ComponentCreationState.h:88
ComponentCreationState::componentFinished
virtual void componentFinished()
Definition: ComponentCreationState.cpp:85
ComponentCreationState::createSubStates
void createSubStates(WizardMainWindow *mainWindow)
Definition: ComponentCreationState.cpp:95
ComponentAddPropertyState::resetDomComponent
void resetDomComponent(cepcoreschema::Component *domComponent)
Definition: ComponentAddPropertyState.cpp:45
ComponentCreationState::componentDescriptionState
ComponentDescriptionState * componentDescriptionState
Definition: ComponentCreationState.h:87
ComponentAddPropertyState
State to add a property to a component.
Definition: ComponentAddPropertyState.h:49
ComponentCreationState::~ComponentCreationState
~ComponentCreationState() override=default
Destructor.
cepcoreschema
Definition: ActionExtensionGenerator.h:36
WizardMainWindow.h
ComponentAddPropertyWidget.h
ComponentCreationState::domComponent
cepcoreschema::Component * domComponent
Definition: ComponentCreationState.h:99