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

Description

Definition at line 70 of file RotationItems.h.

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

Public Member Functions

 ZRotationItem ()
 
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

◆ ZRotationItem()

ZRotationItem::ZRotationItem ( )

Definition at line 81 of file RotationItems.cpp.

82 {
83  m_angle.init("Angle", "Rotation angle around z-axis", 0.0, Unit::degree, "angle");
84 }
@ 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:82

References degree.

Member Function Documentation

◆ angle()

DoubleDescriptor ZRotationItem::angle ( ) const

Definition at line 97 of file RotationItems.cpp.

98 {
99  return m_angle;
100 }

◆ createRotation()

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

Implements RotationItem.

Definition at line 92 of file RotationItems.cpp.

93 {
94  return std::make_unique<RotationZ>(deg2rad(angle()));
95 }
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 ZRotationItem::rotationValues ( ) const
inlineoverridevirtual

Implements RotationItem.

Definition at line 74 of file RotationItems.h.

74 { return {m_angle}; };

References m_angle.

◆ serialize()

void ZRotationItem::serialize ( Streamer s)
overridevirtual

Implements RotationItem.

Definition at line 86 of file RotationItems.cpp.

87 {
88  s.assertVersion(0);
90 }
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 ZRotationItem::m_angle
private

Definition at line 82 of file RotationItems.h.

Referenced by rotationValues().


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