NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxVector3DComponentProperty.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 namespace cx
15 {
16 
18  mBase(base), mIndex(index), mName(name), mHelp(help)
19 {
20  connect(mBase.get(), SIGNAL(changed()), this, SIGNAL(changed()));
21 }
22 
24 {
25  return mName.isEmpty() ? mBase->getDisplayName() : mName;
26 }
27 
29 {
30  Vector3D vec = mBase->getValue();
31  vec[mIndex] = value;
32 // std::cout << "set val for comp " << " " << value << " " << mIndex << std::endl;
33  return mBase->setValue(vec);
34 }
35 
37 {
38  return mBase->getValue()[mIndex];
39 }
40 
42 {
43  return mHelp.isEmpty() ? mBase->getHelp() : mHelp;
44 }
45 
47 {
48  return mBase->getValueRange();
49 }
50 
52 {
53  return mBase->convertInternal2Display(internal);
54 }
55 
57 {
58  return mBase->convertDisplay2Internal(display);
59 }
60 
62 {
63  return mBase->getValueDecimals();
64 }
65 
66 
67 
68 }
cx::Vector3DComponentProperty::convertDisplay2Internal
virtual double convertDisplay2Internal(double display)
Definition: cxVector3DComponentProperty.cpp:56
cx::Vector3DComponentProperty::setValue
virtual bool setValue(double value)
set the data value.
Definition: cxVector3DComponentProperty.cpp:28
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::Vector3DComponentProperty::mBase
Vector3DPropertyBasePtr mBase
Definition: cxVector3DComponentProperty.h:51
cx::Property::changed
void changed()
emit when the underlying data value is changed: The user interface will be updated.
cxVector3DComponentProperty.h
cx::Vector3DComponentProperty::convertInternal2Display
virtual double convertInternal2Display(double internal)
Definition: cxVector3DComponentProperty.cpp:51
cx::Vector3DComponentProperty::mHelp
QString mHelp
Definition: cxVector3DComponentProperty.h:54
cx::Vector3DComponentProperty::Vector3DComponentProperty
Vector3DComponentProperty(Vector3DPropertyBasePtr base, int index, QString name, QString help)
Definition: cxVector3DComponentProperty.cpp:17
cx::Vector3DComponentProperty::getHelp
virtual QString getHelp() const
Definition: cxVector3DComponentProperty.cpp:41
cx::Vector3DComponentProperty::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxVector3DComponentProperty.cpp:23
cx::Vector3DComponentProperty::getValue
virtual double getValue() const
get the data value.
Definition: cxVector3DComponentProperty.cpp:36
cx::Vector3DPropertyBasePtr
boost::shared_ptr< Vector3DPropertyBase > Vector3DPropertyBasePtr
Definition: cxVector3DPropertyBase.h:84
cx::Vector3DComponentProperty::mIndex
int mIndex
Definition: cxVector3DComponentProperty.h:52
cx::Vector3DComponentProperty::mName
QString mName
Definition: cxVector3DComponentProperty.h:53
cx::DoubleRange
Utility class for describing a bounded numeric range.
Definition: cxDoubleRange.h:32
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cx::Vector3DComponentProperty::getValueDecimals
virtual int getValueDecimals() const
Definition: cxVector3DComponentProperty.cpp:61
cx::Vector3DComponentProperty::getValueRange
virtual DoubleRange getValueRange() const
Definition: cxVector3DComponentProperty.cpp:46