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

Description

Definition at line 40 of file RotationItems.h.

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

Public Member Functions

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

◆ XRotationItem()

XRotationItem::XRotationItem ( )

Definition at line 35 of file RotationItems.cpp.

36 {
37  m_angle.init("Angle", "Rotation angle around x-axis", 0.0, Unit::degree, "angle");
38 }
@ 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:52

References degree.

Member Function Documentation

◆ angle()

DoubleDescriptor XRotationItem::angle ( ) const

Definition at line 51 of file RotationItems.cpp.

52 {
53  return m_angle;
54 }

◆ createRotation()

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

Implements RotationItem.

Definition at line 46 of file RotationItems.cpp.

47 {
48  return std::make_unique<RotationX>(deg2rad(angle()));
49 }
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 XRotationItem::rotationValues ( ) const
inlineoverridevirtual

Implements RotationItem.

Definition at line 44 of file RotationItems.h.

44 { return {m_angle}; };

References m_angle.

◆ serialize()

void XRotationItem::serialize ( Streamer s)
overridevirtual

Implements RotationItem.

Definition at line 40 of file RotationItems.cpp.

41 {
42  s.assertVersion(0);
44 }
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 XRotationItem::m_angle
private

Definition at line 52 of file RotationItems.h.

Referenced by rotationValues().


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