NorMIT-nav  2023.01.05-dev+develop.0da12
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_ */
cx::XmlOptionFile
Helper class for xml files used to store ssc/cx data.
Definition: cxXmlOptionItem.h:78
cxServiceTrackerListener.h
cx::RegistrationMethodService
Registration Method services.
Definition: cxRegistrationMethodService.h:36
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::BaseWidget
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
cxForwardDeclarations.h
cx::RegistrationTypeWidget::selectRegistrationMethod
void selectRegistrationMethod(QString registrationMethodName)
Definition: cxRegistrationWidget.cpp:56
cx::RegistrationTypeWidget
Definition: cxRegistrationWidget.h:40
cx::RegistrationTypeWidget::addMethod
void addMethod(RegistrationMethodService *service)
Definition: cxRegistrationWidget.cpp:69
cxRegistrationMethodService.h
cxXmlOptionItem.h
cx::StringPropertyPtr
boost::shared_ptr< class StringProperty > StringPropertyPtr
Definition: cxVideoConnectionWidget.h:42
cx::TabbedWidget
Interface for making widgets with a hierarchy of tabs.
Definition: cxTabbedWidget.h:34
cx::RegistrationTypeWidget::removeMethod
void removeMethod(RegistrationMethodService *service)
Definition: cxRegistrationWidget.cpp:86
cx::RegistrationWidget
Definition: cxRegistrationWidget.h:71
cxTabbedWidget.h
cx::RegistrationWidget::~RegistrationWidget
virtual ~RegistrationWidget()
Definition: cxRegistrationWidget.h:76
cx::StringPropertyBasePtr
boost::shared_ptr< class StringPropertyBase > StringPropertyBasePtr
Definition: cxIGTLinkStreamerService.h:20
cx::RegistrationTypeWidget::~RegistrationTypeWidget
virtual ~RegistrationTypeWidget()
Definition: cxRegistrationWidget.h:45
cx::RegistrationTypeWidget::RegistrationTypeWidget
RegistrationTypeWidget(QString type, QString defVal, XmlOptionFile options, QWidget *parent=0)
Definition: cxRegistrationWidget.cpp:34