Fraxinus  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 }
Utility class for describing a bounded numeric range.
Definition: cxDoubleRange.h:32
virtual double getValue() const
get the data value.
virtual double convertInternal2Display(double internal)
range of value
boost::shared_ptr< Vector3DPropertyBase > Vector3DPropertyBasePtr
Vector3DComponentProperty(Vector3DPropertyBasePtr base, int index, QString name, QString help)
void changed()
emit when the underlying data value is changed: The user interface will be updated.
virtual double convertDisplay2Internal(double display)
conversion from internal value to display value
virtual DoubleRange getValueRange() const
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
virtual bool setValue(double value)
set the data value.
virtual QString getHelp() const
return a descriptive help string for the data, used for example as a tool tip.
virtual int getValueDecimals() const
number of relevant decimals in value
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Namespace for all CustusX production code.