NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxStringPropertySelectPointMetric.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 #include "cxPatientModelService.h"
14 #include "cxPointMetric.h"
15 #include "cxLogger.h"
16 
17 namespace cx {
18 
20  SelectDataStringPropertyBase(patientModelService, PointMetric::getTypeName())
21 {
22  mValueName = "Select point metric";
23  mHelp = "Select a point metric";
24 }
25 
27 {
28  if (value==mPointMetricUid)
29  return false;
30  mPointMetricUid = value;
31  emit changed();
32  emit dataChanged(mPointMetricUid);
33  return true;
34 }
35 
37 {
38  return mPointMetricUid;
39 }
40 
42 {
43  PointMetricPtr retval = mPatientModelService->getData<PointMetric>(mPointMetricUid);
44  return retval;
45 }
46 
47 } //namespace cx
cxLogger.h
cxStringPropertySelectPointMetric.h
cx::SelectDataStringPropertyBase::mValueName
QString mValueName
Definition: cxSelectDataStringPropertyBase.h:68
cx::SelectDataStringPropertyBase
Definition: cxSelectDataStringPropertyBase.h:32
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::SelectDataStringPropertyBase::mPatientModelService
PatientModelServicePtr mPatientModelService
Definition: cxSelectDataStringPropertyBase.h:71
cx::Property::changed
void changed()
emit when the underlying data value is changed: The user interface will be updated.
cx::SelectDataStringPropertyBase::dataChanged
void dataChanged(QString)
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cxPatientModelService.h
cxPointMetric.h
cx::SelectDataStringPropertyBase::mHelp
QString mHelp
Definition: cxSelectDataStringPropertyBase.h:69
cx::PointMetric
Data class that represents a single point.
Definition: cxPointMetric.h:42
cx::StringPropertySelectPointMetric::setValue
virtual bool setValue(const QString &value)
set the data value.
Definition: cxStringPropertySelectPointMetric.cpp:26
cx::StringPropertySelectPointMetric::getPointMetric
PointMetricPtr getPointMetric()
Definition: cxStringPropertySelectPointMetric.cpp:41
cx::PointMetricPtr
boost::shared_ptr< class PointMetric > PointMetricPtr
Definition: cxForwardDeclarations.h:84
cx::StringPropertySelectPointMetric::StringPropertySelectPointMetric
StringPropertySelectPointMetric(PatientModelServicePtr patientModelService)
Definition: cxStringPropertySelectPointMetric.cpp:19
cx::StringPropertySelectPointMetric::getValue
virtual QString getValue() const
get the data value.
Definition: cxStringPropertySelectPointMetric.cpp:36