BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
VectorProperty Class Reference

Description

Holds a 3D vector of type R3 as well as additional info like label, tooltip.

Use this as a member in your class to hold a 3D vector if you want to have support for serialization, and if this vector is editable on the UI.

For a more complete documentation about property classes, please refer to DoubleProperty.

See also
VectorDescriptor
DoubleProperty

Definition at line 33 of file VectorProperty.h.

Collaboration diagram for VectorProperty:
[legend]

Public Member Functions

VectorDescriptor descriptor () const
 
R3 get () const
 
void init (const QString &label, const QString &tooltip, const variant< QString, Unit > &unit, const QString &persistentTag)
 
 operator R3 () const
 
 operator VectorDescriptor () const
 
QString persistentTag () const
 
R3 & r3 ()
 
void set (const R3 &d)
 
void setUid (const QString &uid)
 
QString uid () const
 

Private Attributes

VectorDescriptor m_descriptor
 
QString m_persistentTag
 
QString m_uid
 
R3 m_value
 

Member Function Documentation

◆ descriptor()

VectorDescriptor VectorProperty::descriptor ( ) const
inline

Definition at line 38 of file VectorProperty.h.

38 { return m_descriptor; }
VectorDescriptor m_descriptor

References m_descriptor.

◆ get()

R3 VectorProperty::get ( ) const
inline

Definition at line 42 of file VectorProperty.h.

42 { return m_value; }

References m_value.

Referenced by Serialize::rwProperty().

◆ init()

void VectorProperty::init ( const QString &  label,
const QString &  tooltip,
const variant< QString, Unit > &  unit,
const QString &  persistentTag 
)

Definition at line 20 of file VectorProperty.cpp.

22 {
24  m_uid = QUuid::createUuid().toString();
25 
26  m_descriptor.init(label, tooltip, &m_value, unit);
27  m_descriptor.uid = [this] { return m_uid; };
28 }
void init(const QString &_label, const QString &_tooltip, const R3 *vec, const variant< QString, Unit > &_unit)
function< QString()> uid
unique id describing this value. Used e.g. for undo/redo
QString m_persistentTag
QString persistentTag() const

References VectorDescriptor::init(), m_descriptor, m_persistentTag, m_uid, m_value, persistentTag(), and VectorDescriptor::uid.

Referenced by ItemWithParticles::ItemWithParticles(), MesoCrystalItem::MesoCrystalItem(), and MultiLayerItem::MultiLayerItem().

Here is the call graph for this function:

◆ operator R3()

VectorProperty::operator R3 ( ) const
inline

Definition at line 40 of file VectorProperty.h.

40 { return m_value; }

References m_value.

◆ operator VectorDescriptor()

VectorProperty::operator VectorDescriptor ( ) const
inline

Definition at line 39 of file VectorProperty.h.

39 { return m_descriptor; }

References m_descriptor.

◆ persistentTag()

QString VectorProperty::persistentTag ( ) const
inline

Definition at line 44 of file VectorProperty.h.

44 { return m_persistentTag; }

References m_persistentTag.

Referenced by init(), and Serialize::rwProperty().

◆ r3()

R3& VectorProperty::r3 ( )
inline

Definition at line 48 of file VectorProperty.h.

48 { return m_value; }

References m_value.

◆ set()

◆ setUid()

void VectorProperty::setUid ( const QString &  uid)
inline

Definition at line 46 of file VectorProperty.h.

46 { m_uid = uid; }
QString uid() const

References m_uid, and uid().

Referenced by Serialize::rwProperty().

Here is the call graph for this function:

◆ uid()

QString VectorProperty::uid ( ) const
inline

Definition at line 45 of file VectorProperty.h.

45 { return m_uid; }

References m_uid.

Referenced by Serialize::rwProperty(), and setUid().

Member Data Documentation

◆ m_descriptor

VectorDescriptor VectorProperty::m_descriptor
private

Definition at line 55 of file VectorProperty.h.

Referenced by descriptor(), init(), and operator VectorDescriptor().

◆ m_persistentTag

QString VectorProperty::m_persistentTag
private

Definition at line 52 of file VectorProperty.h.

Referenced by init(), and persistentTag().

◆ m_uid

QString VectorProperty::m_uid
private

Definition at line 53 of file VectorProperty.h.

Referenced by init(), setUid(), and uid().

◆ m_value

R3 VectorProperty::m_value
private

Definition at line 51 of file VectorProperty.h.

Referenced by get(), init(), operator R3(), r3(), and set().


The documentation for this class was generated from the following files: