Fraxinus  18.10
An IGT application
cxStringPropertySelectCoordinateSystem.cpp
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 
13 
14 #include "cxTrackingService.h"
15 #include "cxTypeConversions.h"
16 #include "cxDefinitionStrings.h"
17 
18 namespace cx
19 {
20 
22 {
23 }
24 
26 {
27  QStringList retval;
28  retval << "";
29  retval << qstring_cast(csREF);
30  retval << qstring_cast(csDATA);
31  retval << qstring_cast(csPATIENTREF);
32  retval << qstring_cast(csTOOL);
33  retval << qstring_cast(csSENSOR);
34  return retval;
35 }
36 
38 {
39  if (internal.isEmpty())
40  return "<no coordinate system>";
41 
42  //as requested by Frank
43  if(internal == "reference")
44  return "data reference";
45  if(internal == "data")
46  return "data (image/mesh)";
47  if(internal == "patient reference")
48  return "patient/tool reference";
49  if(internal == "tool")
50  return "tool";
51  if(internal == "sensor")
52  return "tools sensor";
53 
54  return internal;
55 }
56 
57 //---------------------------------------------------------
58 //---------------------------------------------------------
59 //---------------------------------------------------------
60 
62 {
63  mTrackingService = trackingService;
64  mCoordinateSystem = csCOUNT;
65  connect(trackingService.get(), &TrackingService::stateChanged, this, &StringPropertySelectCoordinateSystem::setDefaultSlot);
66 }
67 
69 {
70  return "Select coordinate system";
71 }
72 
74 {
75  mCoordinateSystem = string2enum<COORDINATE_SYSTEM>(value);
76  emit changed();
77  return true;
78 }
79 
81 {
82  return qstring_cast(mCoordinateSystem);
83 }
84 
86 {
87  return "Select a coordinate system";
88 }
89 
90 void StringPropertySelectCoordinateSystem::setDefaultSlot()
91 {
93 }
94 
95 } // namespace cx
StringPropertySelectCoordinateSystem(TrackingServicePtr trackingService)
QString qstring_cast(const T &val)
virtual QString getHelp() const
return a descriptive help string for the data, used for example as a tool tip.
boost::shared_ptr< class TrackingService > TrackingServicePtr
csSENSOR
a tools sensor space (s)
Definition: cxDefinitions.h:88
csREF
the data reference space (r) using LPS (left-posterior-superior) coordinates.
Definition: cxDefinitions.h:88
virtual bool setValue(const QString &value)
set the data value.
csDATA
a datas space (d)
Definition: cxDefinitions.h:88
csPATIENTREF
the patient/tool reference space (pr)
Definition: cxDefinitions.h:88
virtual QString convertInternal2Display(QString internal)
range of value. Use if data is constrained to a set.
void changed()
emit when the underlying data value is changed: The user interface will be updated.
virtual QString getValue() const
get the data value.
virtual QString getDisplayName() const
name of data entity. Used for display to user.
csTOOL
a tools rspace (t)
Definition: cxDefinitions.h:88
virtual bool setValue(const QString &value)=0
set the data value.
Namespace for all CustusX production code.