CustusX  2023.01.05-dev+develop.0da12
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 "cxDefinitionStrings.h"
16 
17 namespace cx
18 {
19 
21 {
22 }
23 
25 {
26  QStringList retval;
27  retval << "";
28  retval << qstring_cast(csREF);
29  retval << qstring_cast(csDATA);
30  retval << qstring_cast(csPATIENTREF);
31  retval << qstring_cast(csTOOL);
32  retval << qstring_cast(csSENSOR);
33  return retval;
34 }
35 
37 {
38  if (internal.isEmpty())
39  return "<no coordinate system>";
40 
41  //as requested by Frank
42  if(internal == "reference")
43  return "data reference";
44  if(internal == "data")
45  return "data (image/mesh)";
46  if(internal == "patient reference")
47  return "patient/tool reference";
48  if(internal == "tool")
49  return "tool";
50  if(internal == "sensor")
51  return "tools sensor";
52 
53  return internal;
54 }
55 
56 //---------------------------------------------------------
57 //---------------------------------------------------------
58 //---------------------------------------------------------
59 
61 {
62  mTrackingService = trackingService;
63  mCoordinateSystem = csCOUNT;
64  connect(trackingService.get(), &TrackingService::stateChanged, this, &StringPropertySelectCoordinateSystem::setDefaultSlot);
65 }
66 
68 {
69  return "Select coordinate system";
70 }
71 
73 {
74  mCoordinateSystem = string2enum<COORDINATE_SYSTEM>(value);
75  emit changed();
76  return true;
77 }
78 
80 {
81  return qstring_cast(mCoordinateSystem);
82 }
83 
85 {
86  return "Select a coordinate system";
87 }
88 
89 void StringPropertySelectCoordinateSystem::setDefaultSlot()
90 {
92 }
93 
94 } // 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:90
csREF
the data reference space (r) using LPS (left-posterior-superior) coordinates.
Definition: cxDefinitions.h:90
virtual bool setValue(const QString &value)
set the data value.
csDATA
a datas space (d)
Definition: cxDefinitions.h:90
csPATIENTREF
the patient/tool reference space (pr)
Definition: cxDefinitions.h:90
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:90
virtual bool setValue(const QString &value)=0
set the data value.
Namespace for all CustusX production code.