CustusX  18.04
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 class ctkPluginContext;
21 class QPushButton;
22 
23 namespace cx {
24 
25 typedef boost::shared_ptr<class HelpEngine> HelpEnginePtr;
26 class HelpBrowser;
27 
28 
38 class org_custusx_training_EXPORT TrainingWidget : public BaseWidget
39 {
40  Q_OBJECT
41 
42 public:
43  explicit TrainingWidget(RegServicesPtr services, QString objectName, QString windowTitle, QWidget* parent = NULL);
44  virtual ~TrainingWidget();
45 
46 protected:
47  void resetSteps();
48 
49  typedef boost::function<void(void)> func_t;
50  typedef std::vector<func_t> funcs_t;
51  void registrateTransition( func_t transition);
52 
53 protected:
54  void makeUnavailable(QString uidPart, bool makeModalityUnavailable = false);
55  void makeAvailable(QString uidPart, bool makeModalityUnavailable);
57 
58  QString getFirstUSVolume();
59  MeshPtr getMesh(QString uidPart);
60 private slots:
61  void onImportSimulatedPatient();
62 
63 private:
64  void createActions();
65  void createSteps(unsigned numberOfSteps);
66  CXToolButton *addToolButtonFor(QHBoxLayout *layout, QAction *action);
67  void toWelcomeStep();
68  void onStep(int delta);
69  void stepTo(int step);
70  void transitionToStep(int step);
71  void setAvailability(std::map<QString, DataPtr> datas, bool available, QString uidPart, bool makeModalityUnavailable);
72 
73  HelpEnginePtr mEngine;
74  HelpBrowser* mBrowser;
75 
76  funcs_t mTransitions;
77 
78  int mCurrentStep;
79  QAction* mPreviousAction;
80  QAction* mNextAction;
81  QAction* mCurrentAction;
82  QAction* mImportAction;
83  QStringList mSessionIDs;
84 };
85 
86 } /* namespace cx */
87 #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