Fraxinus  18.10
An IGT application
cxRegistrationWidget.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 CXREGISTRATIONWIDGET_H_
13 #define CXREGISTRATIONWIDGET_H_
14 
15 #include "org_custusx_registration_gui_Export.h"
16 #include "cxTabbedWidget.h"
19 #include "cxForwardDeclarations.h"
20 #include "cxXmlOptionItem.h"
21 class QVBoxLayout;
22 class QComboBox;
23 class QStackedWidget;
24 
25 namespace cx
26 {
27 typedef boost::shared_ptr<class StringPropertyBase> StringPropertyBasePtr;
28 
29 
41 {
42  Q_OBJECT
43 public:
44  RegistrationTypeWidget(QString type, QString defVal, XmlOptionFile options, QWidget* parent = 0);
46 
47  void selectRegistrationMethod(QString registrationMethodName);
48 
49  void addMethod(RegistrationMethodService* service);
51 
52 private slots:
53  void onIndexChanged();
54 private:
55  void removeWidgetFromStackedWidget(QString widgetName);
56 
57  QStackedWidget *mStackedWidget;
58  XmlOptionFile mOptions;
59  StringPropertyPtr mMethodSelector;
60 };
61 
71 class org_custusx_registration_gui_EXPORT RegistrationWidget : public TabbedWidget
72 {
73  Q_OBJECT
74 public:
75  RegistrationWidget(ctkPluginContext *pluginContext, QWidget* parent = 0);
76  virtual ~RegistrationWidget() {}
77 
78  void selectRegistrationMethod(QString registrationType, QString registrationMethodName);
79 
80 private slots:
81  void onCurrentChanged(int index);
82 private:
83  void initRegistrationTypesWidgets();
84  void initServiceListener();
85 
86  void onServiceAdded(RegistrationMethodService *service);
87  void onServiceRemoved(RegistrationMethodService *service);
88 
89  ctkPluginContext* mPluginContext;
90  boost::shared_ptr<ServiceTrackerListener<RegistrationMethodService> > mServiceListener;
91 
92  StringPropertyPtr mTypeSelector;
93  std::map<QString, RegistrationTypeWidget*> mRegistrationTypeMap;
94  QStringList mRegistrationTypes;
95  XmlOptionFile mOptions;
96 };
97 
98 } /* namespace cx */
99 
100 #endif /* CXREGISTRATIONWIDGET_H_ */
void removeMethod(RegistrationMethodService *service)
void selectRegistrationMethod(QString registrationMethodName)
boost::shared_ptr< class StringProperty > StringPropertyPtr
Registration Method services.
boost::shared_ptr< class StringPropertyBase > StringPropertyBasePtr
Interface for making widgets with a hierarchy of tabs.
RegistrationTypeWidget(QString type, QString defVal, XmlOptionFile options, QWidget *parent=0)
void addMethod(RegistrationMethodService *service)
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
Helper class for xml files used to store ssc/cx data.
Namespace for all CustusX production code.