Fraxinus  17.12-rc3
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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 #ifndef CXDATAINTERFACE_H_
33 #define CXDATAINTERFACE_H_
34 
35 #include "cxGuiExport.h"
36 #include "cxDoublePropertyBase.h"
37 #include "cxStringPropertyBase.h"
38 #include "cxForwardDeclarations.h"
40 
41 
48 namespace cx
49 {
50 typedef boost::shared_ptr<class ActiveImageProxy> ActiveImageProxyPtr;
51 typedef boost::shared_ptr<class ActiveToolProxy> ActiveToolProxyPtr;
52 
57 {
58  Q_OBJECT
59 public:
60  static boost::shared_ptr<DoublePropertyActiveToolOffset> create(ActiveToolProxyPtr activeTool)
61  {
62  return boost::shared_ptr<DoublePropertyActiveToolOffset>(new DoublePropertyActiveToolOffset(activeTool));
63  }
64 
65  DoublePropertyActiveToolOffset(ActiveToolProxyPtr activeTool);
67  virtual QString getDisplayName() const { return "Offset"; }
68  virtual QString getHelp() const
69  {
70  return "Tool tip virtual offset, in mm.";
71  }
72  virtual double getValue() const;
73  virtual bool setValue(double val);
74  virtual void connectValueSignals(bool on) {}
75  DoubleRange getValueRange() const;
76 
77 protected:
78  ActiveToolProxyPtr mActiveTool;
79 };
80 
84 class cxGui_EXPORT DoublePropertyToolOffset : public DoublePropertyBase
85 {
86  Q_OBJECT
87 public:
88  static boost::shared_ptr<DoublePropertyToolOffset> create(ToolPtr tool)
89  {
90  return boost::shared_ptr<DoublePropertyToolOffset>(new DoublePropertyToolOffset(tool));
91  }
92 
95  virtual QString getDisplayName() const { return "Offset"; }
96  virtual QString getHelp() const
97  {
98  return "Tool tip virtual offset, in mm.";
99  }
100  virtual double getValue() const;
101  virtual bool setValue(double val);
102  virtual void connectValueSignals(bool on) {}
103  DoubleRange getValueRange() const;
104 
105  void setTool(ToolPtr tool);
106 
107 protected:
109 };
110 
115 {
116  Q_OBJECT
117 public:
120  virtual double getValue() const;
121  virtual bool setValue(double val);
122  virtual void connectValueSignals(bool on) {}
123 private slots:
124  void activeImageChanged();
125 protected:
126  virtual double getValueInternal() const = 0;
127  virtual void setValueInternal(double val) = 0;
128 
130  ActiveImageProxyPtr mActiveImageProxy;
132 };
133 
138 {
139 public:
141  virtual QString getDisplayName() const { return "Window"; }
142  virtual double getValueInternal() const;
143  virtual void setValueInternal(double val);
144  virtual DoubleRange getValueRange() const;
145 };
146 
151 {
152  Q_OBJECT
153 public:
155  virtual QString getDisplayName() const { return "Level"; }
156  virtual double getValueInternal() const;
157  virtual void setValueInternal(double val);
158  virtual DoubleRange getValueRange() const;
159 };
160 
161 typedef boost::shared_ptr<class StringPropertyParentFrame> StringPropertyParentFramePtr;
162 
167 {
168  Q_OBJECT
169 public:
170  static StringPropertyParentFramePtr New(PatientModelServicePtr patientModelService) { return StringPropertyParentFramePtr(new StringPropertyParentFrame(patientModelService)); }
172  void setData(DataPtr data);
173  virtual ~StringPropertyParentFrame();
174 
175 public: // basic methods
176  virtual QString getDisplayName() const;
177  virtual bool setValue(const QString& value);
178  virtual QString getValue() const;
179 
180 public: // optional methods
181  virtual QString getHelp() const;
182  virtual QStringList getValueRange() const;
183  virtual QString convertInternal2Display(QString internal);
184 
185 protected:
188 };
189 
190 typedef boost::shared_ptr<class StringPropertySetParentFrame> StringPropertySetParentFramePtr;
191 
197 {
198  Q_OBJECT
199 public:
200  static StringPropertySetParentFramePtr New(PatientModelServicePtr patientModelService) { return StringPropertySetParentFramePtr(new StringPropertySetParentFrame(patientModelService)); }
203 public: // basic methods
204  virtual bool setValue(const QString& value);
205 };
206 
207 
208 typedef boost::shared_ptr<class StringPropertyDataNameEditable> StringPropertyDataNameEditablePtr;
209 
214 {
215  Q_OBJECT
216 public:
217  static StringPropertyDataNameEditablePtr New() { return StringPropertyDataNameEditablePtr(new StringPropertyDataNameEditable()); }
219  virtual void setData(DataPtr data);
221 
222 public: // basic methods
223  virtual QString getDisplayName() const;
224  virtual bool setValue(const QString& value);
225  virtual QString getValue() const;
226 
227  virtual bool isReadOnly() const { return false; }
228  virtual bool getAllowOnlyValuesInRange() const { return false; }
229 
230 
231 private:
232  DataPtr mData;
233 };
234 
235 typedef boost::shared_ptr<class StringPropertyDataUidEditable> StringPropertyDataUidEditablePtr;
236 
241 {
242  Q_OBJECT
243 public:
244  static StringPropertyDataUidEditablePtr New() { return StringPropertyDataUidEditablePtr(new StringPropertyDataUidEditable()); }
246  virtual void setData(DataPtr data);
248 
249 public: // basic methods
250  virtual QString getDisplayName() const;
251  virtual bool setValue(const QString& value);
252  virtual QString getValue() const;
253 
254  virtual bool isReadOnly() const { return true; }
255  virtual bool getAllowOnlyValuesInRange() const { return false; }
256 
257 private:
258  DataPtr mData;
259 };
260 typedef boost::shared_ptr<class StringPropertyDataModality> StringPropertyDataModalityPtr;
261 
266 {
267  Q_OBJECT
268 public:
269  static StringPropertyDataModalityPtr New(PatientModelServicePtr patientModelService) { return StringPropertyDataModalityPtr(new StringPropertyDataModality(patientModelService)); }
271  virtual ~StringPropertyDataModality();
272  void setData(ImagePtr data);
273 
274 public: // basic methods
275  virtual QString getDisplayName() const;
276  virtual bool setValue(const QString& value);
277  virtual QString getValue() const;
278 
279 public: // optional methods
280  virtual QString getHelp() const;
281  virtual QStringList getValueRange() const;
282 
283 protected:
286 };
287 
288 typedef boost::shared_ptr<class StringPropertyImageType> StringPropertyImageTypePtr;
289 
293 class cxGui_EXPORT StringPropertyImageType : public StringPropertyBase
294 {
295  Q_OBJECT
296 public:
297  static StringPropertyImageTypePtr New(PatientModelServicePtr patientModelService) { return StringPropertyImageTypePtr(new StringPropertyImageType(patientModelService)); }
298  StringPropertyImageType(PatientModelServicePtr patientModelService);
299  void setData(ImagePtr data);
300  virtual ~StringPropertyImageType();
301 
302 public: // basic methods
303  virtual QString getDisplayName() const;
304  virtual bool setValue(const QString& value);
305  virtual QString getValue() const;
306 
307 public: // optional methods
308  virtual QString getHelp() const;
309  virtual QStringList getValueRange() const;
310 
311 protected:
314 };
315 
316 
317 typedef boost::shared_ptr<class StringPropertyGlyphOrientationArray> StringPropertyGlyphOrientationArrayPtr;
318 
323 {
324  Q_OBJECT
325 public:
326  static StringPropertyGlyphOrientationArrayPtr New(PatientModelServicePtr patientModelService) { return StringPropertyGlyphOrientationArrayPtr(new StringPropertyGlyphOrientationArray(patientModelService)); }
329  void setData(MeshPtr data);
330 
331 public: // basic methods
332  virtual QString getDisplayName() const;
333  virtual bool setValue(const QString& value);
334  virtual QString getValue() const;
335 
336 public: // optional methods
337  virtual QString getHelp() const;
338  virtual QStringList getValueRange() const;
339 
340 protected:
343 };
344 
345 
346 typedef boost::shared_ptr<class StringPropertyGlyphColorArray> StringPropertyGlyphColorArrayPtr;
347 
352 {
353  Q_OBJECT
354 public:
355  static StringPropertyGlyphColorArrayPtr New(PatientModelServicePtr patientModelService) { return StringPropertyGlyphColorArrayPtr(new StringPropertyGlyphColorArray(patientModelService)); }
358  void setData(MeshPtr data);
359 
360 public: // basic methods
361  virtual QString getDisplayName() const;
362  virtual bool setValue(const QString& value);
363  virtual QString getValue() const;
364 
365 public: // optional methods
366  virtual QString getHelp() const;
367  virtual QStringList getValueRange() const;
368 
369 protected:
372 };
373 
374 
375 
376 typedef boost::shared_ptr<class StringPropertyGlyphLUT> StringPropertyGlyphLUTPtr;
377 
381 class cxGui_EXPORT StringPropertyGlyphLUT : public StringPropertyBase
382 {
383  Q_OBJECT
384 public:
385  static StringPropertyGlyphLUTPtr New(PatientModelServicePtr patientModelService) { return StringPropertyGlyphLUTPtr(new StringPropertyGlyphLUT(patientModelService)); }
386  StringPropertyGlyphLUT(PatientModelServicePtr patientModelService);
387  virtual ~StringPropertyGlyphLUT();
388  void setData(MeshPtr data);
389 
390 public: // basic methods
391  virtual QString getDisplayName() const;
392  virtual bool setValue(const QString& value);
393  virtual QString getValue() const;
394 
395 public: // optional methods
396  virtual QString getHelp() const;
397  virtual QStringList getValueRange() const;
398 
399 protected:
402 };
403 
404 
405 } // namespace cx
406 
407 
412 #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:53
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:48
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:42
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:53
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