CustusX  22.04-rc5
An IGT application
cxPresets.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 
13 #ifndef CXPRESETS_H_
14 #define CXPRESETS_H_
15 
16 #include "cxResourceExport.h"
17 #include "cxPrecompiledHeader.h"
18 
19 #include <QObject>
20 
21 #include <map>
22 #include <vector>
23 #include <boost/shared_ptr.hpp>
24 #include "cxXmlOptionItem.h"
25 #include "cxDefinitions.h"
26 
27 namespace cx {
28 
41 class cxResource_EXPORT Presets : public QObject
42 {
43  Q_OBJECT
44 
45 public:
46  Presets(XmlOptionFile presetFile, XmlOptionFile customFile); //used
47  virtual ~Presets(){};
48 
49  IMAGE_MODALITY getId() const;
50 
51  void addCustomPreset(QDomElement& element);
52  virtual void deleteCustomPreset(QString name);
53  virtual void save();
54  virtual void remove();
55 
56  QStringList getPresetList(IMAGE_MODALITY tag=imUNKNOWN);
57  bool isDefaultPreset(QString presetName);
58  XmlOptionFile getCustomFile();
59 
60 signals:
61  void changed();
62 
63 protected:
64  virtual QStringList generatePresetList(IMAGE_MODALITY tag);
65  XmlOptionFile getPresetNode(const QString& presetName);
66  void addDefaultPreset(QDomElement& element); //used
67  void addPreset(XmlOptionFile& file, QDomElement& element); //used
68 
69  //debugging
70  void print(QDomElement element);
71 
74 
76 private:
77  XmlOptionFile mCustomFile; //used
78  IMAGE_MODALITY mId;
79 };
80 
81 typedef boost::shared_ptr<class Presets> PresetsPtr;
82 
83 } /* namespace cx */
84 #endif /* CXPRESETS_H_ */
Base class for a group of presets in the system.
Definition: cxPresets.h:41
XmlOptionFile mPresetFile
< the name of the last custom preset removed
Definition: cxPresets.h:75
QString mLastCustomPresetRemoved
< the name of the last custom preset added
Definition: cxPresets.h:73
boost::shared_ptr< class Presets > PresetsPtr
QString mLastCustomPresetAdded
Definition: cxPresets.h:72
imUNKNOWN
virtual ~Presets()
Definition: cxPresets.h:47
void print(QString header, QRect r)
Helper class for xml files used to store ssc/cx data.
Namespace for all CustusX production code.