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

Description

Definition at line 85 of file RotationItems.h.

Inheritance diagram for EulerRotationItem:
[legend]
Collaboration diagram for EulerRotationItem:
[legend]

Public Member Functions

 EulerRotationItem ()
 
DoubleDescriptor alpha () const
 
DoubleDescriptor beta () const
 
DoubleDescriptor gamma () const
 
RotMatrix rotation () const
 
DoubleDescriptors rotationValues () const override
 
void serialize (Streamer &s) override
 

Protected Member Functions

unique_ptr< IRotation > createRotation () const override
 

Private Attributes

DoubleProperty m_alpha
 
DoubleProperty m_beta
 
DoubleProperty m_gamma
 

Constructor & Destructor Documentation

◆ EulerRotationItem()

EulerRotationItem::EulerRotationItem ( )

Definition at line 104 of file RotationItems.cpp.

105 {
106  m_alpha.init("Alpha", "First Euler angle in z-x'-z' sequence", 0.0, Unit::degree, "alpha");
107  m_beta.init("Beta", "Second Euler angle in z-x'-z' sequence", 0.0, Unit::degree, "beta");
108  m_gamma.init("Gamma", "Third Euler angle in z-x'-z' sequence", 0.0, Unit::degree, "gamma");
109 }
@ degree
void init(const QString &label, const QString &tooltip, double value, const variant< QString, Unit > &unit, const QString &persistentTag)
DoubleProperty m_alpha
Definition: RotationItems.h:99
DoubleProperty m_gamma
DoubleProperty m_beta

References degree, and m_beta.

Member Function Documentation

◆ alpha()

DoubleDescriptor EulerRotationItem::alpha ( ) const

Definition at line 124 of file RotationItems.cpp.

125 {
126  return m_alpha;
127 }

◆ beta()

DoubleDescriptor EulerRotationItem::beta ( ) const

Definition at line 129 of file RotationItems.cpp.

130 {
131  return m_beta;
132 }

References m_beta.

◆ createRotation()

unique_ptr< IRotation > EulerRotationItem::createRotation ( ) const
overrideprotectedvirtual

Implements RotationItem.

Definition at line 119 of file RotationItems.cpp.

120 {
121  return std::make_unique<RotationEuler>(deg2rad(alpha()), deg2rad(beta()), deg2rad(gamma()));
122 }
DoubleDescriptor alpha() const
DoubleDescriptor gamma() const
DoubleDescriptor beta() const

◆ gamma()

DoubleDescriptor EulerRotationItem::gamma ( ) const

Definition at line 134 of file RotationItems.cpp.

135 {
136  return m_gamma;
137 }

◆ rotation()

RotMatrix RotationItem::rotation ( ) const
inherited

Definition at line 27 of file RotationItems.cpp.

28 {
29  auto p = createRotation();
30  return (p != nullptr) ? p->rotMatrix() : RotMatrix();
31 }
virtual unique_ptr< IRotation > createRotation() const =0

Referenced by ItemWithParticles::createRotation().

◆ rotationValues()

DoubleDescriptors EulerRotationItem::rotationValues ( ) const
inlineoverridevirtual

Implements RotationItem.

Definition at line 89 of file RotationItems.h.

89 { return {m_alpha, m_beta, m_gamma}; };

References m_alpha, m_beta, and m_gamma.

◆ serialize()

void EulerRotationItem::serialize ( Streamer s)
overridevirtual

Implements RotationItem.

Definition at line 111 of file RotationItems.cpp.

112 {
113  s.assertVersion(0);
117 }
void assertVersion(unsigned expectedVersion) const
As reader, throws DeserializationException unless the expected version is read. As writer,...
Definition: Streamer.cpp:26
void rwProperty(Streamer &s, DoubleProperty &d)

References Streamer::assertVersion(), m_beta, and Serialize::rwProperty().

Here is the call graph for this function:

Member Data Documentation

◆ m_alpha

DoubleProperty EulerRotationItem::m_alpha
private

Definition at line 99 of file RotationItems.h.

Referenced by rotationValues().

◆ m_beta

DoubleProperty EulerRotationItem::m_beta
private

Definition at line 100 of file RotationItems.h.

Referenced by rotationValues().

◆ m_gamma

DoubleProperty EulerRotationItem::m_gamma
private

Definition at line 101 of file RotationItems.h.

Referenced by rotationValues().


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