BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Class for representing a double value, its attributes and its accessors.
Contained attributes are
This property class supports also the descriptor mechanism by directly returning a DoubleDescriptor. This descriptor contains all the relevant information taken from this class, and provides a getter and a setter to the contained value.
Definition at line 44 of file DoubleProperty.h.
Public Member Functions | |
unsigned | decimals () const |
Number of decimals to be shown in an edit field. More... | |
DoubleDescriptor | descriptor () const |
Return a descriptor (information provider) for this double property. More... | |
double | get () const |
The contained value. More... | |
void | init (const QString &label, const QString &tooltip, double value, const variant< QString, Unit > &unit, const QString &persistentTag) |
void | init (const QString &label, const QString &tooltip, double value, const variant< QString, Unit > &unit, int decimals, const RealLimits &limits, const QString &persistentTag) |
bool | isInitialized () const |
True if one of the init methods has been called (checks for a valid uid). More... | |
operator double () const | |
Cast to the contained double value. More... | |
operator DoubleDescriptor () const | |
Cast to a descriptor (information provider) More... | |
QString | persistentTag () const |
Persistent tag for serializing. More... | |
void | set (double d) |
Set the contained value. More... | |
void | setDecimals (unsigned decimals) |
Set number of decimals to be shown in an edit field. More... | |
void | setLimits (const RealLimits &limits) |
Set the limits. More... | |
void | setTooltip (const QString &tooltip) |
Set the tooltip. More... | |
void | setUid (const QString &uid) |
Set the unique id of this double property. More... | |
void | setUnit (const variant< QString, Unit > &unit) |
Set the unit. More... | |
QString | uid () const |
Unique id of this double property. More... | |
Private Attributes | |
unsigned | m_decimals = 3 |
Number of decimals to be shown in an edit field. More... | |
DoubleDescriptor | m_descriptor |
descriptor, holding more attributes like label, tooltip etc. More... | |
QString | m_persistentTag |
Persistent tag for serializing. More... | |
QString | m_uid |
Unique id of this double property. More... | |
double | m_value = 0.0 |
Current value. More... | |
|
inline |
Number of decimals to be shown in an edit field.
Definition at line 77 of file DoubleProperty.h.
References m_decimals.
Referenced by init(), Serialize::rwProperty(), and setDecimals().
|
inline |
Return a descriptor (information provider) for this double property.
Definition at line 53 of file DoubleProperty.h.
References m_descriptor.
|
inline |
The contained value.
Definition at line 65 of file DoubleProperty.h.
References m_value.
Referenced by Serialize::rwProperty().
void DoubleProperty::init | ( | const QString & | label, |
const QString & | tooltip, | ||
double | value, | ||
const variant< QString, Unit > & | unit, | ||
const QString & | persistentTag | ||
) |
Definition at line 20 of file DoubleProperty.cpp.
References persistentTag().
Referenced by BasicLattice2DItem::BasicLattice2DItem(), HexagonalLattice2DItem::HexagonalLattice2DItem(), Interference1DLatticeItem::Interference1DLatticeItem(), Interference2DParaCrystalItem::Interference2DParaCrystalItem(), InterferenceHardDiskItem::InterferenceHardDiskItem(), InterferenceItem::InterferenceItem(), InterferenceRadialParaCrystalItem::InterferenceRadialParaCrystalItem(), ItemWithParticles::ItemWithParticles(), Lattice2DItem::Lattice2DItem(), LayerBasicRoughnessItem::LayerBasicRoughnessItem(), LayerItem::LayerItem(), MultiLayerItem::MultiLayerItem(), ParticleLayoutItem::ParticleLayoutItem(), Profile1DItem::Profile1DItem(), Profile1DVoigtItem::Profile1DVoigtItem(), Profile2DItem::Profile2DItem(), Profile2DVoigtItem::Profile2DVoigtItem(), and SquareLattice2DItem::SquareLattice2DItem().
void DoubleProperty::init | ( | const QString & | label, |
const QString & | tooltip, | ||
double | value, | ||
const variant< QString, Unit > & | unit, | ||
int | decimals, | ||
const RealLimits & | limits, | ||
const QString & | persistentTag | ||
) |
Definition at line 26 of file DoubleProperty.cpp.
References DoubleDescriptor::decimals, decimals(), DoubleDescriptor::get, DoubleDescriptor::label, DoubleDescriptor::limits, m_decimals, m_descriptor, m_persistentTag, m_uid, m_value, DoubleDescriptor::path, persistentTag(), DoubleDescriptor::set, DoubleDescriptor::tooltip, and DoubleDescriptor::unit.
bool DoubleProperty::isInitialized | ( | ) | const |
True if one of the init methods has been called (checks for a valid uid).
Definition at line 60 of file DoubleProperty.cpp.
References m_uid.
|
inline |
Cast to the contained double value.
Definition at line 59 of file DoubleProperty.h.
References m_value.
|
inline |
Cast to a descriptor (information provider)
Definition at line 56 of file DoubleProperty.h.
References m_descriptor.
|
inline |
Persistent tag for serializing.
Definition at line 68 of file DoubleProperty.h.
References m_persistentTag.
Referenced by init(), and Serialize::rwProperty().
|
inline |
Set the contained value.
Definition at line 62 of file DoubleProperty.h.
References m_value.
Referenced by Serialize::rwProperty(), ItemWithParticles::setAbundance(), Interference2DParaCrystalItem::setDampingLength(), Interference2DParaCrystalItem::setDomainSize1(), Interference2DParaCrystalItem::setDomainSize2(), Profile2DVoigtItem::setEta(), Profile2DItem::setGamma(), BasicLattice2DItem::setLatticeAngle(), SquareLattice2DItem::setLatticeLength(), HexagonalLattice2DItem::setLatticeLength(), BasicLattice2DItem::setLatticeLength1(), BasicLattice2DItem::setLatticeLength2(), Lattice2DItem::setLatticeRotationAngle(), Profile2DItem::setOmegaX(), Profile2DItem::setOmegaY(), and ParticleLayoutItem::totalDensity().
|
inline |
Set number of decimals to be shown in an edit field.
Definition at line 80 of file DoubleProperty.h.
References decimals(), and m_decimals.
Referenced by Serialize::rwProperty().
void DoubleProperty::setLimits | ( | const RealLimits & | limits | ) |
Set the limits.
Definition at line 55 of file DoubleProperty.cpp.
References DoubleDescriptor::limits, and m_descriptor.
void DoubleProperty::setTooltip | ( | const QString & | tooltip | ) |
Set the tooltip.
Definition at line 45 of file DoubleProperty.cpp.
References m_descriptor, and DoubleDescriptor::tooltip.
|
inline |
Set the unique id of this double property.
Definition at line 74 of file DoubleProperty.h.
Referenced by Serialize::rwProperty().
void DoubleProperty::setUnit | ( | const variant< QString, Unit > & | unit | ) |
Set the unit.
Definition at line 50 of file DoubleProperty.cpp.
References m_descriptor, and DoubleDescriptor::unit.
|
inline |
Unique id of this double property.
Definition at line 71 of file DoubleProperty.h.
References m_uid.
Referenced by Serialize::rwProperty(), setUid(), and ParticleLayoutItem::totalDensity().
|
private |
Number of decimals to be shown in an edit field.
Definition at line 96 of file DoubleProperty.h.
Referenced by decimals(), init(), and setDecimals().
|
private |
descriptor, holding more attributes like label, tooltip etc.
Definition at line 99 of file DoubleProperty.h.
Referenced by descriptor(), init(), operator DoubleDescriptor(), setLimits(), setTooltip(), and setUnit().
|
private |
Persistent tag for serializing.
Definition at line 97 of file DoubleProperty.h.
Referenced by init(), and persistentTag().
|
private |
Unique id of this double property.
Definition at line 98 of file DoubleProperty.h.
Referenced by init(), isInitialized(), setUid(), and uid().
|
private |
Current value.
Definition at line 95 of file DoubleProperty.h.
Referenced by get(), init(), operator double(), and set().