NorMIT-nav  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
csSENSOR
csSENSOR
a tools sensor space (s)
Definition: cxDefinitions.h:94
qstring_cast
QString qstring_cast(const T &val)
Definition: cxTypeConversions.h:46
cx::StringPropertySelectCoordinateSystemBase::getValueRange
virtual QStringList getValueRange() const
Definition: cxStringPropertySelectCoordinateSystem.cpp:24
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::Property::changed
void changed()
emit when the underlying data value is changed: The user interface will be updated.
cx::StringPropertySelectCoordinateSystem::setValue
virtual bool setValue(const QString &value)
set the data value.
Definition: cxStringPropertySelectCoordinateSystem.cpp:72
csDATA
csDATA
a datas space (d)
Definition: cxDefinitions.h:91
cx::StringPropertySelectCoordinateSystemBase::convertInternal2Display
virtual QString convertInternal2Display(QString internal)
Definition: cxStringPropertySelectCoordinateSystem.cpp:36
cx::StringPropertySelectCoordinateSystem::getHelp
virtual QString getHelp() const
Definition: cxStringPropertySelectCoordinateSystem.cpp:84
csTOOL
csTOOL
a tools rspace (t)
Definition: cxDefinitions.h:93
csREF
csREF
the data reference space (r) using LPS (left-posterior-superior) coordinates.
Definition: cxDefinitions.h:90
cx::StringPropertySelectCoordinateSystem::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxStringPropertySelectCoordinateSystem.cpp:67
cx::TrackingServicePtr
boost::shared_ptr< class TrackingService > TrackingServicePtr
Definition: cxToolFilterWidget.h:27
cxStringPropertySelectCoordinateSystem.h
cx::TrackingService::stateChanged
void stateChanged()
cxDefinitionStrings.h
csPATIENTREF
csPATIENTREF
the patient/tool reference space (pr)
Definition: cxDefinitions.h:92
cx::StringPropertySelectCoordinateSystem::getValue
virtual QString getValue() const
get the data value.
Definition: cxStringPropertySelectCoordinateSystem.cpp:79
cxTrackingService.h
cx::StringPropertySelectCoordinateSystemBase::StringPropertySelectCoordinateSystemBase
StringPropertySelectCoordinateSystemBase()
Definition: cxStringPropertySelectCoordinateSystem.cpp:20
cx::StringPropertySelectCoordinateSystem::StringPropertySelectCoordinateSystem
StringPropertySelectCoordinateSystem(TrackingServicePtr trackingService)
Definition: cxStringPropertySelectCoordinateSystem.cpp:60