NorMIT-nav  18.04
An IGT application
cxFiltersWidget.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 CXFiltersWidget_H_
13 #define CXFiltersWidget_H_
14 
15 #include "cxGuiExport.h"
16 
17 #include "cxBaseWidget.h"
18 #include "cxFilter.h"
19 #include "cxFilterGroup.h"
20 #include "cxFilterTimedAlgorithm.h"
21 #include "cxFilterSetupWidget.h"
23 
24 namespace cx {
25 typedef boost::shared_ptr<class VisServices> VisServicesPtr;
26 
38 class cxGui_EXPORT FiltersWidget : public BaseWidget
39 {
40  Q_OBJECT
41 public:
49  FiltersWidget(VisServicesPtr services, QWidget* parent, QStringList wantedFilters = QStringList(), QString optionfileTag="filterwidget");
50  QString generateHelpText() const;
51 
52 protected slots:
53  void addRunButton(QHBoxLayout* filterLayout);
54 
55 private slots:
56  void filterChangedSlot();
57  void toggleDetailsSlot();
58  void runFilterSlot();
59  void finishedSlot();
60 
61 private:
62  void onServiceAdded(Filter* service);
63  void onServiceRemoved(Filter *service);
64  void appendFiltersThatAreNotServices(VisServicesPtr services);
65  void appendFilterServices();
66  void appendFilters(VisServicesPtr services);
67  void appendFilterIfWanted(FilterPtr filter);
68  void configureFilterSelector(XmlOptionFile options);
69  void addDetailedButton(QHBoxLayout* filterLayout);
70  QHBoxLayout * addFilterSelector(QVBoxLayout* topLayout);
71  void addProgressBar(QVBoxLayout* topLayout);
72  void addFilterWidget(XmlOptionFile options, VisServicesPtr services, QVBoxLayout* topLayout);
73  void setWindowTitleAndObjectNameBasedOnWantedFilters();
74  void setupLayout(VisServicesPtr services, XmlOptionFile options);
75 
76  QStringList mWantedFilters; //empty list means all available filters
77  FilterGroupPtr mFilters;
78  FilterPtr mCurrentFilter;
79  StringPropertyPtr mFilterSelector;
81  FilterSetupWidget* mSetupWidget;
82  TimedAlgorithmProgressBar* mTimedAlgorithmProgressBar;
83  boost::shared_ptr<ServiceTrackerListener<Filter> > mServiceListener;
84 };
85 
86 } /* namespace cx */
87 #endif /* CXFiltersWidget_H_ */
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
Show progress for a TimedBaseAlgorithm.
boost::shared_ptr< class StringProperty > StringPropertyPtr
boost::shared_ptr< class Filter > FilterPtr
boost::shared_ptr< FilterGroup > FilterGroupPtr
Definition: cxFilterGroup.h:65
boost::shared_ptr< class FilterTimedAlgorithm > FilterTimedAlgorithmPtr
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.