Fraxinus  2023.01.05-dev+develop.0da12
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 
44  DoublePropertyActiveToolOffset(ActiveToolProxyPtr activeTool);
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:
57  ActiveToolProxyPtr mActiveTool;
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 
109  ActiveImageProxyPtr mActiveImageProxy;
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:
149  static StringPropertyParentFramePtr New(PatientModelServicePtr patientModelService) { return StringPropertyParentFramePtr(new StringPropertyParentFrame(patientModelService)); }
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:
179  static StringPropertySetParentFramePtr New(PatientModelServicePtr patientModelService) { return StringPropertySetParentFramePtr(new StringPropertySetParentFrame(patientModelService)); }
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:
199  static StringPropertyDataNameEditablePtr New() { return StringPropertyDataNameEditablePtr(new StringPropertyDataNameEditable()); }
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:
226  static StringPropertyDataUidEditablePtr New() { return StringPropertyDataUidEditablePtr(new StringPropertyDataUidEditable()); }
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:
251  static StringPropertyDataModalityPtr New(PatientModelServicePtr patientModelService) { return StringPropertyDataModalityPtr(new StringPropertyDataModality(patientModelService)); }
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:
308  static StringPropertyGlyphOrientationArrayPtr New(PatientModelServicePtr patientModelService) { return StringPropertyGlyphOrientationArrayPtr(new StringPropertyGlyphOrientationArray(patientModelService)); }
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:
337  static StringPropertyGlyphColorArrayPtr New(PatientModelServicePtr patientModelService) { return StringPropertyGlyphColorArrayPtr(new StringPropertyGlyphColorArray(patientModelService)); }
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_ */
static StringPropertyParentFramePtr New(PatientModelServicePtr patientModelService)
boost::shared_ptr< class StringPropertyDataUidEditable > StringPropertyDataUidEditablePtr
DataInterface implementation for the LUT 2D window value.
Superclass for all doubles interacting with the active image.
Adapter that selects the glyph orientation array.
boost::shared_ptr< class StringPropertyParentFrame > StringPropertyParentFramePtr
virtual void connectValueSignals(bool on)
boost::shared_ptr< class StringPropertyImageType > StringPropertyImageTypePtr
boost::shared_ptr< class StringPropertyGlyphColorArray > StringPropertyGlyphColorArrayPtr
static StringPropertyDataModalityPtr New(PatientModelServicePtr patientModelService)
virtual bool isReadOnly() const
Utility class for describing a bounded numeric range.
Definition: cxDoubleRange.h:32
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
boost::shared_ptr< class StringPropertyDataNameEditable > StringPropertyDataNameEditablePtr
boost::shared_ptr< class ActiveImageProxy > ActiveImageProxyPtr
static StringPropertyGlyphLUTPtr New(PatientModelServicePtr patientModelService)
boost::shared_ptr< class ActiveData > ActiveDataPtr
Definition: cxColorWidget.h:21
virtual bool getAllowOnlyValuesInRange() const
static StringPropertyGlyphColorArrayPtr New(PatientModelServicePtr patientModelService)
static StringPropertyDataUidEditablePtr New()
Interface to the tool offset of the active tool.
Abstract interface for interaction with internal string-valued data.
boost::shared_ptr< class StringPropertySetParentFrame > StringPropertySetParentFramePtr
boost::shared_ptr< class StringPropertyGlyphOrientationArray > StringPropertyGlyphOrientationArrayPtr
boost::shared_ptr< class Data > DataPtr
virtual QString getDisplayName() const
name of data entity. Used for display to user.
virtual QString getDisplayName() const
name of data entity. Used for display to user.
static StringPropertyImageTypePtr New(PatientModelServicePtr patientModelService)
Adapter that selects the parent frame of the given Data.
Adapter that selects the image type of the given Data.
static boost::shared_ptr< DoublePropertyToolOffset > create(ToolPtr tool)
DataInterface implementation for the LUT 2D level value.
static StringPropertyDataNameEditablePtr New()
Adapter that selects the modality of the given Data.
Adapter for displaying and changing name of a Data.
virtual void connectValueSignals(bool on)
virtual QString getHelp() const
return a descriptive help string for the data, used for example as a tool tip.
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< class StringPropertyGlyphLUT > StringPropertyGlyphLUTPtr
static StringPropertyGlyphOrientationArrayPtr New(PatientModelServicePtr patientModelService)
virtual QString getHelp() const
return a descriptive help string for the data, used for example as a tool tip.
Adapter that selects the glyph color LUT.
boost::shared_ptr< class ActiveToolProxy > ActiveToolProxyPtr
Definition: cxStatusBar.h:32
Adapter for displaying and changing name of a Data.
static StringPropertySetParentFramePtr New(PatientModelServicePtr patientModelService)
boost::shared_ptr< class StringPropertyDataModality > StringPropertyDataModalityPtr
Interface to the tool offset of a tool.
Adapter that force sets the parent frame of the given Data, i.e. overwriting history. Nice for initial definition.
Adapter that selects the glyph color array.
PatientModelServicePtr mPatientModelService
PatientModelServicePtr mPatientModelService
virtual QString getDisplayName() const
name of data entity. Used for display to user.
PatientModelServicePtr mPatientModelService
PatientModelServicePtr mPatientModelService
static boost::shared_ptr< DoublePropertyActiveToolOffset > create(ActiveToolProxyPtr activeTool)
virtual void connectValueSignals(bool on)
PatientModelServicePtr mPatientModelService
boost::shared_ptr< class Mesh > MeshPtr
ActiveImageProxyPtr mActiveImageProxy
virtual bool getAllowOnlyValuesInRange() const
PatientModelServicePtr mPatientModelService
Namespace for all CustusX production code.
virtual QString getDisplayName() const
name of data entity. Used for display to user.
boost::shared_ptr< class Tool > ToolPtr