Fraxinus  18.10
An IGT application
cxSelectDataStringPropertyBase.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 CXSELECTDATASTRINGPROPERTYBASE_H_
13 #define CXSELECTDATASTRINGPROPERTYBASE_H_
14 
15 #include "cxResourceExport.h"
16 #include "cxStringPropertyBase.h"
17 #include "cxForwardDeclarations.h"
18 
19 namespace cx
20 {
21 
22 typedef boost::shared_ptr<class SelectDataStringPropertyBase> SelectDataStringPropertyBasePtr;
23 typedef boost::shared_ptr<class PatientModelService> PatientModelServicePtr;
24 
32 class cxResource_EXPORT SelectDataStringPropertyBase : public StringPropertyBase
33 {
34  Q_OBJECT
35 public:
37 
38 public: // basic methods
39  virtual QString getDisplayName() const;
40 
41 public: // optional methods
42  virtual QStringList getValueRange() const;
43  virtual QString convertInternal2Display(QString internal);
44  virtual QString getHelp() const;
45 
46 public: // interface extension
47  virtual DataPtr getData() const;
48  virtual DataPtr getData(QString uid) const;
49  virtual void setValueName(const QString name);
50  virtual void setHelp(QString text);
51  virtual void setUidRegexp(QString regexp);
52  static std::map<QString, DataPtr> filterOnType(std::map<QString, DataPtr> input, QString regexp);
53  virtual void setTypeRegexp(QString regexp);
54 
55  void setOnly2DImagesFilter(bool only2D);
56 signals:
57  void dataChanged(QString);
58 protected:
62  explicit SelectDataStringPropertyBase(PatientModelServicePtr patientModelService, QString typeRegexp = ".*");
63  std::map<QString, DataPtr> filterOnUid(std::map<QString, DataPtr> input, QString regexp) const;
64  std::map<QString, DataPtr> filterImagesOn2D(std::map<QString, DataPtr> input, bool only2D) const;
65  QString mTypeRegexp;
66  QString mUidRegexp;
67  bool mOnly2D;
68  QString mValueName;
69  QString mHelp;
70 
71  PatientModelServicePtr mPatientModelService;
72 };
73 
74 } // cx
75 #endif // CXSELECTDATASTRINGPROPERTYBASE_H_
Abstract interface for interaction with internal string-valued data.
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class SelectDataStringPropertyBase > SelectDataStringPropertyBasePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Namespace for all CustusX production code.