CustusX  15.8
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
37 #include "cxDoublePropertyBase.h"
38 #include "cxStringPropertyBase.h"
39 #include "cxForwardDeclarations.h"
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()
61  {
62  return boost::shared_ptr<DoublePropertyActiveToolOffset>(new DoublePropertyActiveToolOffset());
63  }
64 
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:
79 };
80 
85 {
86  Q_OBJECT
87 public:
90  virtual double getValue() const;
91  virtual bool setValue(double val);
92  virtual void connectValueSignals(bool on) {}
93 private slots:
94  void activeImageChanged();
95 protected:
96  virtual double getValueInternal() const = 0;
97  virtual void setValueInternal(double val) = 0;
98 
102 };
103 
108 {
109 public:
111  virtual QString getDisplayName() const { return "Window"; }
112  virtual double getValueInternal() const;
113  virtual void setValueInternal(double val);
114  virtual DoubleRange getValueRange() const;
115 };
116 
121 {
122  Q_OBJECT
123 public:
125  virtual QString getDisplayName() const { return "Level"; }
126  virtual double getValueInternal() const;
127  virtual void setValueInternal(double val);
128  virtual DoubleRange getValueRange() const;
129 };
130 
135 {
136  Q_OBJECT
137 public:
140 
141 public: // optional methods
142  virtual QStringList getValueRange() const;
143  virtual QString convertInternal2Display(QString internal);
144 
145 protected:
147 };
148 typedef boost::shared_ptr<class StringPropertySelectRTSourceBase> StringPropertySelectRTSourceBasePtr;
149 
150 
151 typedef boost::shared_ptr<class StringPropertySelectRTSource> StringPropertySelectRTSourcePtr;
152 
159 {
160  Q_OBJECT
161 public:
165 
166 public: // basic methods
167  virtual QString getDisplayName() const;
168  virtual bool setValue(const QString& value);
169  virtual QString getValue() const;
170 
171 public: // optional methods
172  virtual QString getHelp() const;
173 
174 public: // interface extension
175  VideoSourcePtr getRTSource();
176  void setValueName(const QString name);
177 
178 private slots:
179  void setDefaultSlot();
180 
181 private:
182  VideoSourcePtr mRTSource;
183  QString mValueName;
184 };
185 
186 typedef boost::shared_ptr<class StringPropertyActiveVideoSource> StringPropertyActiveVideoSourcePtr;
191 {
192  Q_OBJECT
193 public:
197 
198 public: // basic methods
199  virtual QString getDisplayName() const;
200  virtual bool setValue(const QString& value);
201  virtual QString getValue() const;
202  virtual QStringList getValueRange() const;
203  virtual QString getHelp() const;
204 };
205 
206 
207 typedef boost::shared_ptr<class StringPropertyParentFrame> StringPropertyParentFramePtr;
208 
213 {
214  Q_OBJECT
215 public:
218  void setData(DataPtr data);
219  virtual ~StringPropertyParentFrame();
220 
221 public: // basic methods
222  virtual QString getDisplayName() const;
223  virtual bool setValue(const QString& value);
224  virtual QString getValue() const;
225 
226 public: // optional methods
227  virtual QString getHelp() const;
228  virtual QStringList getValueRange() const;
229  virtual QString convertInternal2Display(QString internal);
230 
231 protected:
234 };
235 
236 typedef boost::shared_ptr<class StringPropertySetParentFrame> StringPropertySetParentFramePtr;
237 
243 {
244  Q_OBJECT
245 public:
249 public: // basic methods
250  virtual bool setValue(const QString& value);
251 };
252 
253 
254 typedef boost::shared_ptr<class StringPropertyDataNameEditable> StringPropertyDataNameEditablePtr;
255 
260 {
261  Q_OBJECT
262 public:
265  virtual void setData(DataPtr data);
267 
268 public: // basic methods
269  virtual QString getDisplayName() const;
270  virtual bool setValue(const QString& value);
271  virtual QString getValue() const;
272 
273  virtual bool isReadOnly() const { return false; }
274  virtual bool getAllowOnlyValuesInRange() const { return false; }
275 
276 
277 private:
278  DataPtr mData;
279 };
280 
281 typedef boost::shared_ptr<class StringPropertyDataUidEditable> StringPropertyDataUidEditablePtr;
282 
287 {
288  Q_OBJECT
289 public:
292  virtual void setData(DataPtr data);
294 
295 public: // basic methods
296  virtual QString getDisplayName() const;
297  virtual bool setValue(const QString& value);
298  virtual QString getValue() const;
299 
300  virtual bool isReadOnly() const { return true; }
301  virtual bool getAllowOnlyValuesInRange() const { return false; }
302 
303 private:
304  DataPtr mData;
305 };
306 typedef boost::shared_ptr<class StringPropertyDataModality> StringPropertyDataModalityPtr;
307 
312 {
313  Q_OBJECT
314 public:
317  virtual ~StringPropertyDataModality();
318  void setData(ImagePtr data);
319 
320 public: // basic methods
321  virtual QString getDisplayName() const;
322  virtual bool setValue(const QString& value);
323  virtual QString getValue() const;
324 
325 public: // optional methods
326  virtual QString getHelp() const;
327  virtual QStringList getValueRange() const;
328 
329 protected:
332 };
333 
334 typedef boost::shared_ptr<class StringPropertyImageType> StringPropertyImageTypePtr;
335 
339 class cxGui_EXPORT StringPropertyImageType : public StringPropertyBase
340 {
341  Q_OBJECT
342 public:
343  static StringPropertyImageTypePtr New(PatientModelServicePtr patientModelService) { return StringPropertyImageTypePtr(new StringPropertyImageType(patientModelService)); }
344  StringPropertyImageType(PatientModelServicePtr patientModelService);
345  void setData(ImagePtr data);
346  virtual ~StringPropertyImageType();
347 
348 public: // basic methods
349  virtual QString getDisplayName() const;
350  virtual bool setValue(const QString& value);
351  virtual QString getValue() const;
352 
353 public: // optional methods
354  virtual QString getHelp() const;
355  virtual QStringList getValueRange() const;
356 
357 protected:
360 };
361 
362 } // namespace cx
363 
364 
369 #endif /* CXDATAINTERFACE_H_ */
static StringPropertyParentFramePtr New(PatientModelServicePtr patientModelService)
boost::shared_ptr< class StringPropertyActiveVideoSource > StringPropertyActiveVideoSourcePtr
boost::shared_ptr< class StringPropertyDataUidEditable > StringPropertyDataUidEditablePtr
DataInterface implementation for the LUT 2D window value.
Superclass for all doubles interacting with the active image.
boost::shared_ptr< class StringPropertyParentFrame > StringPropertyParentFramePtr
boost::shared_ptr< class StringPropertyImageType > StringPropertyImageTypePtr
static StringPropertyDataModalityPtr New(PatientModelServicePtr patientModelService)
Adapter that selects and stores an rtsource. The rtsource is stored internally in the adapter...
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
boost::shared_ptr< class StringPropertySelectRTSourceBase > StringPropertySelectRTSourceBasePtr
static StringPropertyActiveVideoSourcePtr New()
virtual bool getAllowOnlyValuesInRange() const
Adapter for controlling the active video source in cx::VideoServiceOld.
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 Data > DataPtr
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.
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)
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< class VideoSource > VideoSourcePtr
virtual QString getHelp() const
return a descriptive help string for the data, used for example as a tool tip.
PatientModelServicePtr mPatientModelService
boost::shared_ptr< class ActiveToolProxy > ActiveToolProxyPtr
Definition: cxStatusBar.h:54
static StringPropertySelectRTSourceBasePtr New(PatientModelServicePtr patientModelService)
PatientModelServicePtr mPatientModelService
Adapter for displaying and changing name of a Data.
static StringPropertySetParentFramePtr New(PatientModelServicePtr patientModelService)
boost::shared_ptr< class StringPropertyDataModality > StringPropertyDataModalityPtr
static boost::shared_ptr< DoublePropertyActiveToolOffset > create()
Base class for all Properties that selects a real time source.
Adapter that force sets the parent frame of the given Data, i.e. overwriting history. Nice for initial definition.
PatientModelServicePtr mPatientModelService
virtual QString getDisplayName() const
name of data entity. Used for display to user.
PatientModelServicePtr mPatientModelService
virtual void connectValueSignals(bool on)
boost::shared_ptr< class StringPropertySelectRTSource > StringPropertySelectRTSourcePtr
ActiveImageProxyPtr mActiveImageProxy
virtual bool getAllowOnlyValuesInRange() const
PatientModelServicePtr mPatientModelService
virtual QString getDisplayName() const
name of data entity. Used for display to user.