NorMIT-nav  22.09
An IGT application
cxDataInterface.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 #ifndef CXDATAINTERFACE_H_
12 #define CXDATAINTERFACE_H_
13 
14 #include "cxGuiExport.h"
15 #include "cxDoublePropertyBase.h"
16 #include "cxStringPropertyBase.h"
17 #include "cxForwardDeclarations.h"
19 
20 
27 namespace cx
28 {
29 typedef boost::shared_ptr<class ActiveImageProxy> ActiveImageProxyPtr;
30 typedef boost::shared_ptr<class ActiveToolProxy> ActiveToolProxyPtr;
31 
36 {
37  Q_OBJECT
38 public:
39  static boost::shared_ptr<DoublePropertyActiveToolOffset> create(ActiveToolProxyPtr activeTool)
40  {
41  return boost::shared_ptr<DoublePropertyActiveToolOffset>(new DoublePropertyActiveToolOffset(activeTool));
42  }
43 
46  virtual QString getDisplayName() const { return "Offset"; }
47  virtual QString getHelp() const
48  {
49  return "Tool tip virtual offset, in mm.";
50  }
51  virtual double getValue() const;
52  virtual bool setValue(double val);
53  virtual void connectValueSignals(bool on) {}
54  DoubleRange getValueRange() const;
55 
56 protected:
58 };
59 
63 class cxGui_EXPORT DoublePropertyToolOffset : public DoublePropertyBase
64 {
65  Q_OBJECT
66 public:
67  static boost::shared_ptr<DoublePropertyToolOffset> create(ToolPtr tool)
68  {
69  return boost::shared_ptr<DoublePropertyToolOffset>(new DoublePropertyToolOffset(tool));
70  }
71 
74  virtual QString getDisplayName() const { return "Offset"; }
75  virtual QString getHelp() const
76  {
77  return "Tool tip virtual offset, in mm.";
78  }
79  virtual double getValue() const;
80  virtual bool setValue(double val);
81  virtual void connectValueSignals(bool on) {}
82  DoubleRange getValueRange() const;
83 
84  void setTool(ToolPtr tool);
85 
86 protected:
88 };
89 
94 {
95  Q_OBJECT
96 public:
99  virtual double getValue() const;
100  virtual bool setValue(double val);
101  virtual void connectValueSignals(bool on) {}
102 private slots:
103  void activeImageChanged();
104 protected:
105  virtual double getValueInternal() const = 0;
106  virtual void setValueInternal(double val) = 0;
107 
111 };
112 
117 {
118 public:
120  virtual QString getDisplayName() const { return "Window"; }
121  virtual double getValueInternal() const;
122  virtual void setValueInternal(double val);
123  virtual DoubleRange getValueRange() const;
124 };
125 
130 {
131  Q_OBJECT
132 public:
134  virtual QString getDisplayName() const { return "Level"; }
135  virtual double getValueInternal() const;
136  virtual void setValueInternal(double val);
137  virtual DoubleRange getValueRange() const;
138 };
139 
140 typedef boost::shared_ptr<class StringPropertyParentFrame> StringPropertyParentFramePtr;
141 
146 {
147  Q_OBJECT
148 public:
151  void setData(DataPtr data);
152  virtual ~StringPropertyParentFrame();
153 
154 public: // basic methods
155  virtual QString getDisplayName() const;
156  virtual bool setValue(const QString& value);
157  virtual QString getValue() const;
158 
159 public: // optional methods
160  virtual QString getHelp() const;
161  virtual QStringList getValueRange() const;
162  virtual QString convertInternal2Display(QString internal);
163 
164 protected:
167 };
168 
169 typedef boost::shared_ptr<class StringPropertySetParentFrame> StringPropertySetParentFramePtr;
170 
176 {
177  Q_OBJECT
178 public:
182 public: // basic methods
183  virtual bool setValue(const QString& value);
184 
185 signals:
186  void parentChanged();
187 };
188 
189 
190 typedef boost::shared_ptr<class StringPropertyDataNameEditable> StringPropertyDataNameEditablePtr;
191 
196 {
197  Q_OBJECT
198 public:
201  virtual void setData(DataPtr data);
203 
204 public: // basic methods
205  virtual QString getDisplayName() const;
206  virtual bool setValue(const QString& value);
207  virtual QString getValue() const;
208 
209  virtual bool isReadOnly() const { return false; }
210  virtual bool getAllowOnlyValuesInRange() const { return false; }
211 
212 
213 private:
214  DataPtr mData;
215 };
216 
217 typedef boost::shared_ptr<class StringPropertyDataUidEditable> StringPropertyDataUidEditablePtr;
218 
223 {
224  Q_OBJECT
225 public:
228  virtual void setData(DataPtr data);
230 
231 public: // basic methods
232  virtual QString getDisplayName() const;
233  virtual bool setValue(const QString& value);
234  virtual QString getValue() const;
235 
236  virtual bool isReadOnly() const { return true; }
237  virtual bool getAllowOnlyValuesInRange() const { return false; }
238 
239 private:
240  DataPtr mData;
241 };
242 typedef boost::shared_ptr<class StringPropertyDataModality> StringPropertyDataModalityPtr;
243 
248 {
249  Q_OBJECT
250 public:
253  virtual ~StringPropertyDataModality();
254  void setData(ImagePtr data);
255 
256 public: // basic methods
257  virtual QString getDisplayName() const;
258  virtual bool setValue(const QString& value);
259  virtual QString getValue() const;
260 
261 public: // optional methods
262  virtual QString getHelp() const;
263  virtual QStringList getValueRange() const;
264 
265 protected:
268 };
269 
270 typedef boost::shared_ptr<class StringPropertyImageType> StringPropertyImageTypePtr;
271 
275 class cxGui_EXPORT StringPropertyImageType : public StringPropertyBase
276 {
277  Q_OBJECT
278 public:
279  static StringPropertyImageTypePtr New(PatientModelServicePtr patientModelService) { return StringPropertyImageTypePtr(new StringPropertyImageType(patientModelService)); }
280  StringPropertyImageType(PatientModelServicePtr patientModelService);
281  void setData(ImagePtr data);
282  virtual ~StringPropertyImageType();
283 
284 public: // basic methods
285  virtual QString getDisplayName() const;
286  virtual bool setValue(const QString& value);
287  virtual QString getValue() const;
288 
289 public: // optional methods
290  virtual QString getHelp() const;
291  virtual QStringList getValueRange() const;
292 
293 protected:
296 };
297 
298 
299 typedef boost::shared_ptr<class StringPropertyGlyphOrientationArray> StringPropertyGlyphOrientationArrayPtr;
300 
305 {
306  Q_OBJECT
307 public:
311  void setData(MeshPtr data);
312 
313 public: // basic methods
314  virtual QString getDisplayName() const;
315  virtual bool setValue(const QString& value);
316  virtual QString getValue() const;
317 
318 public: // optional methods
319  virtual QString getHelp() const;
320  virtual QStringList getValueRange() const;
321 
322 protected:
325 };
326 
327 
328 typedef boost::shared_ptr<class StringPropertyGlyphColorArray> StringPropertyGlyphColorArrayPtr;
329 
334 {
335  Q_OBJECT
336 public:
340  void setData(MeshPtr data);
341 
342 public: // basic methods
343  virtual QString getDisplayName() const;
344  virtual bool setValue(const QString& value);
345  virtual QString getValue() const;
346 
347 public: // optional methods
348  virtual QString getHelp() const;
349  virtual QStringList getValueRange() const;
350 
351 protected:
354 };
355 
356 
357 
358 typedef boost::shared_ptr<class StringPropertyGlyphLUT> StringPropertyGlyphLUTPtr;
359 
363 class cxGui_EXPORT StringPropertyGlyphLUT : public StringPropertyBase
364 {
365  Q_OBJECT
366 public:
367  static StringPropertyGlyphLUTPtr New(PatientModelServicePtr patientModelService) { return StringPropertyGlyphLUTPtr(new StringPropertyGlyphLUT(patientModelService)); }
368  StringPropertyGlyphLUT(PatientModelServicePtr patientModelService);
369  virtual ~StringPropertyGlyphLUT();
370  void setData(MeshPtr data);
371 
372 public: // basic methods
373  virtual QString getDisplayName() const;
374  virtual bool setValue(const QString& value);
375  virtual QString getValue() const;
376 
377 public: // optional methods
378  virtual QString getHelp() const;
379  virtual QStringList getValueRange() const;
380 
381 protected:
384 };
385 
386 
387 } // namespace cx
388 
389 
394 #endif /* CXDATAINTERFACE_H_ */
cx::StringPropertyParentFramePtr
boost::shared_ptr< class StringPropertyParentFrame > StringPropertyParentFramePtr
Definition: cxDataInterface.h:140
cx::StringPropertyImageType
Adapter that selects the image type of the given Data.
Definition: cxDataInterface.h:275
cx::StringPropertyGlyphColorArray::mData
MeshPtr mData
Definition: cxDataInterface.h:352
cx::StringPropertyDataUidEditable::getAllowOnlyValuesInRange
virtual bool getAllowOnlyValuesInRange() const
Definition: cxDataInterface.h:237
cx::DoublePropertyActiveImageBase
Superclass for all doubles interacting with the active image.
Definition: cxDataInterface.h:93
cx::DoublePropertyActiveToolOffset
Interface to the tool offset of the active tool.
Definition: cxDataInterface.h:35
cx::DoublePropertyActiveToolOffset::~DoublePropertyActiveToolOffset
virtual ~DoublePropertyActiveToolOffset()
Definition: cxDataInterface.h:45
cx::DoublePropertyActiveToolOffset::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxDataInterface.h:46
cx::StringPropertyDataNameEditable::isReadOnly
virtual bool isReadOnly() const
Definition: cxDataInterface.h:209
cx::DoublePropertyToolOffset::~DoublePropertyToolOffset
virtual ~DoublePropertyToolOffset()
Definition: cxDataInterface.h:73
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::StringPropertyGlyphOrientationArray::mPatientModelService
PatientModelServicePtr mPatientModelService
Definition: cxDataInterface.h:324
cx::StringPropertySetParentFramePtr
boost::shared_ptr< class StringPropertySetParentFrame > StringPropertySetParentFramePtr
Definition: cxDataInterface.h:169
cx::StringPropertyDataNameEditablePtr
boost::shared_ptr< class StringPropertyDataNameEditable > StringPropertyDataNameEditablePtr
Definition: cxDataInterface.h:190
cx::StringPropertyDataNameEditable
Adapter for displaying and changing name of a Data.
Definition: cxDataInterface.h:195
cx::DoublePropertyActiveToolOffset::create
static boost::shared_ptr< DoublePropertyActiveToolOffset > create(ActiveToolProxyPtr activeTool)
Definition: cxDataInterface.h:39
cxForwardDeclarations.h
cxDoublePropertyBase.h
cx::DoublePropertyActiveToolOffset::connectValueSignals
virtual void connectValueSignals(bool on)
Definition: cxDataInterface.h:53
cx::StringPropertyGlyphOrientationArray::New
static StringPropertyGlyphOrientationArrayPtr New(PatientModelServicePtr patientModelService)
Definition: cxDataInterface.h:308
cx::DoublePropertyActiveImageBase::mImage
ImagePtr mImage
Definition: cxDataInterface.h:108
cx::DoubleProperty2DWindow::~DoubleProperty2DWindow
virtual ~DoubleProperty2DWindow()
Definition: cxDataInterface.h:119
cx::DoublePropertyActiveImageBase::~DoublePropertyActiveImageBase
virtual ~DoublePropertyActiveImageBase()
Definition: cxDataInterface.h:98
cx::StringPropertyDataUidEditable::isReadOnly
virtual bool isReadOnly() const
Definition: cxDataInterface.h:236
cx::DoublePropertyToolOffset::mTool
ToolPtr mTool
Definition: cxDataInterface.h:87
cx::StringPropertyDataModality::mPatientModelService
PatientModelServicePtr mPatientModelService
Definition: cxDataInterface.h:267
cx::StringPropertyParentFrame::New
static StringPropertyParentFramePtr New(PatientModelServicePtr patientModelService)
Definition: cxDataInterface.h:149
cx::StringPropertyGlyphColorArray::mPatientModelService
PatientModelServicePtr mPatientModelService
Definition: cxDataInterface.h:353
cx::ActiveToolProxyPtr
boost::shared_ptr< class ActiveToolProxy > ActiveToolProxyPtr
Definition: cxStatusBar.h:32
cx::DoubleProperty2DLevel::~DoubleProperty2DLevel
virtual ~DoubleProperty2DLevel()
Definition: cxDataInterface.h:133
cx::StringPropertyDataModality::mData
ImagePtr mData
Definition: cxDataInterface.h:266
cx::StringPropertyGlyphOrientationArray
Adapter that selects the glyph orientation array.
Definition: cxDataInterface.h:304
cx::StringPropertySetParentFrame::~StringPropertySetParentFrame
virtual ~StringPropertySetParentFrame()
Definition: cxDataInterface.h:181
cx::StringPropertyDataUidEditablePtr
boost::shared_ptr< class StringPropertyDataUidEditable > StringPropertyDataUidEditablePtr
Definition: cxDataInterface.h:217
cx::DoublePropertyActiveImageBase::connectValueSignals
virtual void connectValueSignals(bool on)
Definition: cxDataInterface.h:101
cx::StringPropertyDataModalityPtr
boost::shared_ptr< class StringPropertyDataModality > StringPropertyDataModalityPtr
Definition: cxDataInterface.h:242
cx::DoubleProperty2DLevel::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxDataInterface.h:134
cx::DoubleProperty2DLevel
DataInterface implementation for the LUT 2D level value.
Definition: cxDataInterface.h:129
cx::StringPropertyParentFrame::mData
DataPtr mData
Definition: cxDataInterface.h:165
cx::StringPropertyGlyphOrientationArrayPtr
boost::shared_ptr< class StringPropertyGlyphOrientationArray > StringPropertyGlyphOrientationArrayPtr
Definition: cxDataInterface.h:299
cx::StringPropertyGlyphLUT
Adapter that selects the glyph color LUT.
Definition: cxDataInterface.h:363
cx::ActiveImageProxyPtr
boost::shared_ptr< class ActiveImageProxy > ActiveImageProxyPtr
Definition: cxDataInterface.h:29
cx::StringPropertyImageType::mPatientModelService
PatientModelServicePtr mPatientModelService
Definition: cxDataInterface.h:295
cx::StringPropertyImageType::New
static StringPropertyImageTypePtr New(PatientModelServicePtr patientModelService)
Definition: cxDataInterface.h:279
cx::StringPropertyDataNameEditable::New
static StringPropertyDataNameEditablePtr New()
Definition: cxDataInterface.h:199
cx::MeshPtr
boost::shared_ptr< class Mesh > MeshPtr
Definition: cxForwardDeclarations.h:48
cx::StringPropertyDataUidEditable
Adapter for displaying and changing name of a Data.
Definition: cxDataInterface.h:222
cx::StringPropertyGlyphLUT::mData
MeshPtr mData
Definition: cxDataInterface.h:382
cx::StringPropertySetParentFrame
Adapter that force sets the parent frame of the given Data, i.e. overwriting history....
Definition: cxDataInterface.h:175
cx::DoublePropertyToolOffset::connectValueSignals
virtual void connectValueSignals(bool on)
Definition: cxDataInterface.h:81
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cx::DoublePropertyToolOffset::getHelp
virtual QString getHelp() const
Definition: cxDataInterface.h:75
cx::StringPropertyGlyphColorArray
Adapter that selects the glyph color array.
Definition: cxDataInterface.h:333
cx::StringPropertyDataUidEditable::~StringPropertyDataUidEditable
virtual ~StringPropertyDataUidEditable()
Definition: cxDataInterface.h:229
cx::DoubleProperty2DWindow
DataInterface implementation for the LUT 2D window value.
Definition: cxDataInterface.h:116
cx::DataPtr
boost::shared_ptr< class Data > DataPtr
Definition: cxRegistrationApplicator.h:22
cxCoordinateSystemHelpers.h
cx::DoublePropertyActiveImageBase::mActiveData
ActiveDataPtr mActiveData
Definition: cxDataInterface.h:110
cx::DoublePropertyActiveImageBase::mActiveImageProxy
ActiveImageProxyPtr mActiveImageProxy
Definition: cxDataInterface.h:109
cx::StringPropertyGlyphColorArray::New
static StringPropertyGlyphColorArrayPtr New(PatientModelServicePtr patientModelService)
Definition: cxDataInterface.h:337
cx::StringPropertyImageTypePtr
boost::shared_ptr< class StringPropertyImageType > StringPropertyImageTypePtr
Definition: cxDataInterface.h:270
cx::ImagePtr
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
cx::StringPropertyParentFrame
Adapter that selects the parent frame of the given Data.
Definition: cxDataInterface.h:145
cx::StringPropertyImageType::mData
ImagePtr mData
Definition: cxDataInterface.h:294
cx::StringPropertyDataNameEditable::~StringPropertyDataNameEditable
virtual ~StringPropertyDataNameEditable()
Definition: cxDataInterface.h:202
cx::StringPropertyGlyphLUTPtr
boost::shared_ptr< class StringPropertyGlyphLUT > StringPropertyGlyphLUTPtr
Definition: cxDataInterface.h:358
cx::StringPropertyDataUidEditable::New
static StringPropertyDataUidEditablePtr New()
Definition: cxDataInterface.h:226
cx::StringPropertyDataNameEditable::getAllowOnlyValuesInRange
virtual bool getAllowOnlyValuesInRange() const
Definition: cxDataInterface.h:210
cx::StringPropertyParentFrame::mPatientModelService
PatientModelServicePtr mPatientModelService
Definition: cxDataInterface.h:166
cx::DoublePropertyActiveToolOffset::mActiveTool
ActiveToolProxyPtr mActiveTool
Definition: cxDataInterface.h:57
cx::StringPropertyDataModality
Adapter that selects the modality of the given Data.
Definition: cxDataInterface.h:247
cx::StringPropertyDataModality::New
static StringPropertyDataModalityPtr New(PatientModelServicePtr patientModelService)
Definition: cxDataInterface.h:251
cx::DoublePropertyBase
Definition: cxDoublePropertyBase.h:70
cx::DoublePropertyToolOffset
Interface to the tool offset of a tool.
Definition: cxDataInterface.h:63
cx::DoublePropertyToolOffset::create
static boost::shared_ptr< DoublePropertyToolOffset > create(ToolPtr tool)
Definition: cxDataInterface.h:67
cx::ToolPtr
boost::shared_ptr< class Tool > ToolPtr
Definition: cxVideoConnectionWidget.h:43
cx::DoubleProperty2DWindow::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxDataInterface.h:120
cxStringPropertyBase.h
cx::DoublePropertyToolOffset::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxDataInterface.h:74
cx::StringPropertyBase
Abstract interface for interaction with internal string-valued data.
Definition: cxStringPropertyBase.h:65
cx::DoublePropertyActiveToolOffset::getHelp
virtual QString getHelp() const
Definition: cxDataInterface.h:47
cx::DoubleRange
Utility class for describing a bounded numeric range.
Definition: cxDoubleRange.h:32
cx::ActiveDataPtr
boost::shared_ptr< class ActiveData > ActiveDataPtr
Definition: cxColorWidget.h:21
cx::StringPropertyGlyphLUT::New
static StringPropertyGlyphLUTPtr New(PatientModelServicePtr patientModelService)
Definition: cxDataInterface.h:367
cx::StringPropertyGlyphLUT::mPatientModelService
PatientModelServicePtr mPatientModelService
Definition: cxDataInterface.h:383
cx::StringPropertySetParentFrame::New
static StringPropertySetParentFramePtr New(PatientModelServicePtr patientModelService)
Definition: cxDataInterface.h:179
cx::StringPropertyGlyphOrientationArray::mData
MeshPtr mData
Definition: cxDataInterface.h:323
cx::StringPropertyGlyphColorArrayPtr
boost::shared_ptr< class StringPropertyGlyphColorArray > StringPropertyGlyphColorArrayPtr
Definition: cxDataInterface.h:328