Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxTrainingWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXTRAININGWIDGET_H_
13 #define CXTRAININGWIDGET_H_
14 
15 #include "cxBaseWidget.h"
16 #include "boost/shared_ptr.hpp"
17 #include "org_custusx_training_Export.h"
18 #include <boost/function.hpp>
19 #include "cxForwardDeclarations.h"
20 #include "cxDefinitions.h"
21 class ctkPluginContext;
22 class QPushButton;
23 
24 namespace cx {
25 
26 typedef boost::shared_ptr<class HelpEngine> HelpEnginePtr;
27 class HelpBrowser;
28 
29 
39 class org_custusx_training_EXPORT TrainingWidget : public BaseWidget
40 {
41  Q_OBJECT
42 
43 public:
44  explicit TrainingWidget(RegServicesPtr services, QString objectName, QString windowTitle, QWidget* parent = NULL);
45  virtual ~TrainingWidget();
46 
47 protected:
48  void resetSteps();
49 
50  typedef boost::function<void(void)> func_t;
51  typedef std::vector<func_t> funcs_t;
52  void registrateTransition( func_t transition);
53 
54 protected:
55  void makeUnavailable(IMAGE_MODALITY modality, bool makeModalityUnavailable = false);
56  void makeAvailable(IMAGE_MODALITY modality, bool makeModalityUnavailable);
58 
59  QString getFirstUSVolume();
60  MeshPtr getMesh(QString uidPart);
61 private slots:
62  void onImportSimulatedPatient();
63 
64 private:
65  void createActions();
66  void createSteps(unsigned numberOfSteps);
67  CXToolButton *addToolButtonFor(QHBoxLayout *layout, QAction *action);
68  void toWelcomeStep();
69  void onStep(int delta);
70  void stepTo(int step);
71  void transitionToStep(int step);
72  void setAvailability(std::map<QString, DataPtr> datas, bool available, IMAGE_MODALITY modality, bool makeModalityUnavailable);
73 
74  HelpEnginePtr mEngine;
75  HelpBrowser* mBrowser;
76 
77  funcs_t mTransitions;
78 
79  int mCurrentStep;
80  QAction* mPreviousAction;
81  QAction* mNextAction;
82  QAction* mCurrentAction;
83  QAction* mImportAction;
84  QStringList mSessionIDs;
85 };
86 
87 } /* namespace cx */
88 #endif /* CXTRAININGWIDGET_H_ */
boost::shared_ptr< class RegServices > RegServicesPtr
Definition: cxRegServices.h:20
RegServicesPtr mServices
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
boost::function< void(void)> func_t
boost::shared_ptr< HelpEngine > HelpEnginePtr
Definition: cxHelpEngine.h:61
boost::shared_ptr< class Mesh > MeshPtr
Namespace for all CustusX production code.
std::vector< func_t > funcs_t