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

Description

Definition at line 55 of file RotationItems.h.

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

Public Member Functions

 YRotationItem ()
 
DoubleDescriptor angle () 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_angle
 

Constructor & Destructor Documentation

◆ YRotationItem()

YRotationItem::YRotationItem ( )

Definition at line 58 of file RotationItems.cpp.

59 {
60  m_angle.init("Angle", "Rotation angle around y-axis", 0.0, Unit::degree, "angle");
61 }
@ degree
void init(const QString &label, const QString &tooltip, double value, const variant< QString, Unit > &unit, const QString &persistentTag)
DoubleProperty m_angle
Definition: RotationItems.h:67

References degree.

Member Function Documentation

◆ angle()

DoubleDescriptor YRotationItem::angle ( ) const

Definition at line 74 of file RotationItems.cpp.

75 {
76  return m_angle;
77 }

◆ createRotation()

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

Implements RotationItem.

Definition at line 69 of file RotationItems.cpp.

70 {
71  return std::make_unique<RotationY>(deg2rad(angle()));
72 }
DoubleDescriptor angle() const

◆ 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 YRotationItem::rotationValues ( ) const
inlineoverridevirtual

Implements RotationItem.

Definition at line 59 of file RotationItems.h.

59 { return {m_angle}; };

References m_angle.

◆ serialize()

void YRotationItem::serialize ( Streamer s)
overridevirtual

Implements RotationItem.

Definition at line 63 of file RotationItems.cpp.

64 {
65  s.assertVersion(0);
67 }
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(), and Serialize::rwProperty().

Here is the call graph for this function:

Member Data Documentation

◆ m_angle

DoubleProperty YRotationItem::m_angle
private

Definition at line 67 of file RotationItems.h.

Referenced by rotationValues().


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