NorMIT-nav  18.04-rc6
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 
186 
187 typedef boost::shared_ptr<class StringPropertyDataNameEditable> StringPropertyDataNameEditablePtr;
188 
193 {
194  Q_OBJECT
195 public:
196  static StringPropertyDataNameEditablePtr New() { return StringPropertyDataNameEditablePtr(new StringPropertyDataNameEditable()); }
198  virtual void setData(DataPtr data);
200 
201 public: // basic methods
202  virtual QString getDisplayName() const;
203  virtual bool setValue(const QString& value);
204  virtual QString getValue() const;
205 
206  virtual bool isReadOnly() const { return false; }
207  virtual bool getAllowOnlyValuesInRange() const { return false; }
208 
209 
210 private:
211  DataPtr mData;
212 };
213 
214 typedef boost::shared_ptr<class StringPropertyDataUidEditable> StringPropertyDataUidEditablePtr;
215 
220 {
221  Q_OBJECT
222 public:
223  static StringPropertyDataUidEditablePtr New() { return StringPropertyDataUidEditablePtr(new StringPropertyDataUidEditable()); }
225  virtual void setData(DataPtr data);
227 
228 public: // basic methods
229  virtual QString getDisplayName() const;
230  virtual bool setValue(const QString& value);
231  virtual QString getValue() const;
232 
233  virtual bool isReadOnly() const { return true; }
234  virtual bool getAllowOnlyValuesInRange() const { return false; }
235 
236 private:
237  DataPtr mData;
238 };
239 typedef boost::shared_ptr<class StringPropertyDataModality> StringPropertyDataModalityPtr;
240 
245 {
246  Q_OBJECT
247 public:
248  static StringPropertyDataModalityPtr New(PatientModelServicePtr patientModelService) { return StringPropertyDataModalityPtr(new StringPropertyDataModality(patientModelService)); }
250  virtual ~StringPropertyDataModality();
251  void setData(ImagePtr data);
252 
253 public: // basic methods
254  virtual QString getDisplayName() const;
255  virtual bool setValue(const QString& value);
256  virtual QString getValue() const;
257 
258 public: // optional methods
259  virtual QString getHelp() const;
260  virtual QStringList getValueRange() const;
261 
262 protected:
265 };
266 
267 typedef boost::shared_ptr<class StringPropertyImageType> StringPropertyImageTypePtr;
268 
272 class cxGui_EXPORT StringPropertyImageType : public StringPropertyBase
273 {
274  Q_OBJECT
275 public:
276  static StringPropertyImageTypePtr New(PatientModelServicePtr patientModelService) { return StringPropertyImageTypePtr(new StringPropertyImageType(patientModelService)); }
277  StringPropertyImageType(PatientModelServicePtr patientModelService);
278  void setData(ImagePtr data);
279  virtual ~StringPropertyImageType();
280 
281 public: // basic methods
282  virtual QString getDisplayName() const;
283  virtual bool setValue(const QString& value);
284  virtual QString getValue() const;
285 
286 public: // optional methods
287  virtual QString getHelp() const;
288  virtual QStringList getValueRange() const;
289 
290 protected:
293 };
294 
295 
296 typedef boost::shared_ptr<class StringPropertyGlyphOrientationArray> StringPropertyGlyphOrientationArrayPtr;
297 
302 {
303  Q_OBJECT
304 public:
305  static StringPropertyGlyphOrientationArrayPtr New(PatientModelServicePtr patientModelService) { return StringPropertyGlyphOrientationArrayPtr(new StringPropertyGlyphOrientationArray(patientModelService)); }
308  void setData(MeshPtr data);
309 
310 public: // basic methods
311  virtual QString getDisplayName() const;
312  virtual bool setValue(const QString& value);
313  virtual QString getValue() const;
314 
315 public: // optional methods
316  virtual QString getHelp() const;
317  virtual QStringList getValueRange() const;
318 
319 protected:
322 };
323 
324 
325 typedef boost::shared_ptr<class StringPropertyGlyphColorArray> StringPropertyGlyphColorArrayPtr;
326 
331 {
332  Q_OBJECT
333 public:
334  static StringPropertyGlyphColorArrayPtr New(PatientModelServicePtr patientModelService) { return StringPropertyGlyphColorArrayPtr(new StringPropertyGlyphColorArray(patientModelService)); }
337  void setData(MeshPtr data);
338 
339 public: // basic methods
340  virtual QString getDisplayName() const;
341  virtual bool setValue(const QString& value);
342  virtual QString getValue() const;
343 
344 public: // optional methods
345  virtual QString getHelp() const;
346  virtual QStringList getValueRange() const;
347 
348 protected:
351 };
352 
353 
354 
355 typedef boost::shared_ptr<class StringPropertyGlyphLUT> StringPropertyGlyphLUTPtr;
356 
360 class cxGui_EXPORT StringPropertyGlyphLUT : public StringPropertyBase
361 {
362  Q_OBJECT
363 public:
364  static StringPropertyGlyphLUTPtr New(PatientModelServicePtr patientModelService) { return StringPropertyGlyphLUTPtr(new StringPropertyGlyphLUT(patientModelService)); }
365  StringPropertyGlyphLUT(PatientModelServicePtr patientModelService);
366  virtual ~StringPropertyGlyphLUT();
367  void setData(MeshPtr data);
368 
369 public: // basic methods
370  virtual QString getDisplayName() const;
371  virtual bool setValue(const QString& value);
372  virtual QString getValue() const;
373 
374 public: // optional methods
375  virtual QString getHelp() const;
376  virtual QStringList getValueRange() const;
377 
378 protected:
381 };
382 
383 
384 } // namespace cx
385 
386 
391 #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