BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
BasicLattice2DItem Class Reference

Description

Definition at line 46 of file Lattice2DItems.h.

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

Public Member Functions

 BasicLattice2DItem ()
 
std::unique_ptr< Lattice2D > createLattice () const override
 
DoubleDescriptors geometryValues (bool withRotationAngle) const override
 
DoubleDescriptor latticeAngle () const
 
DoubleDescriptor latticeLength1 () const
 
DoubleDescriptor latticeLength2 () const
 
DoubleDescriptor latticeRotationAngle () const
 
void serialize (Streamer &s) override
 
void setLatticeAngle (double angle)
 
void setLatticeLength1 (double length1)
 
void setLatticeLength2 (double length2)
 
void setLatticeRotationAngle (double angle)
 
double unitCellArea () const
 

Protected Attributes

DoubleProperty m_latticeRotationAngle
 

Private Attributes

DoubleProperty m_angle
 
DoubleProperty m_length1
 
DoubleProperty m_length2
 

Constructor & Destructor Documentation

◆ BasicLattice2DItem()

BasicLattice2DItem::BasicLattice2DItem ( )

Definition at line 45 of file Lattice2DItems.cpp.

46 {
47  m_length1.init("LatticeLength1", "Length of first lattice vector", 20.0, Unit::nanometer,
48  "len1");
49  m_length2.init("LatticeLength2", "Length of second lattice vector", 20.0, Unit::nanometer,
50  "len2");
51  m_angle.init("Angle", "Angle between lattice vectors", 90.0, Unit::degree, "angle");
52 }
@ nanometer
@ degree
DoubleProperty m_angle
DoubleProperty m_length1
DoubleProperty m_length2
void init(const QString &label, const QString &tooltip, double value, const variant< QString, Unit > &unit, const QString &persistentTag)

References degree, DoubleProperty::init(), m_angle, m_length1, m_length2, and nanometer.

Here is the call graph for this function:

Member Function Documentation

◆ createLattice()

std::unique_ptr< Lattice2D > BasicLattice2DItem::createLattice ( ) const
overridevirtual

Implements Lattice2DItem.

Definition at line 54 of file Lattice2DItems.cpp.

55 {
56  return std::make_unique<BasicLattice2D>(m_length1, m_length2, Units::deg2rad(m_angle),
57  Units::deg2rad(latticeRotationAngle()));
58 }
DoubleDescriptor latticeRotationAngle() const

References Lattice2DItem::latticeRotationAngle(), m_angle, m_length1, and m_length2.

Here is the call graph for this function:

◆ geometryValues()

DoubleDescriptors BasicLattice2DItem::geometryValues ( bool  withRotationAngle) const
inlineoverridevirtual

Implements Lattice2DItem.

Definition at line 51 of file Lattice2DItems.h.

52  {
53  if (withRotationAngle)
55  return {m_length1, m_length2, m_angle};
56  }
DoubleProperty m_latticeRotationAngle

References m_angle, Lattice2DItem::m_latticeRotationAngle, m_length1, and m_length2.

◆ latticeAngle()

DoubleDescriptor BasicLattice2DItem::latticeAngle ( ) const

Definition at line 89 of file Lattice2DItems.cpp.

90 {
91  return m_angle;
92 }

References m_angle.

◆ latticeLength1()

DoubleDescriptor BasicLattice2DItem::latticeLength1 ( ) const

Definition at line 69 of file Lattice2DItems.cpp.

70 {
71  return m_length1;
72 }

References m_length1.

◆ latticeLength2()

DoubleDescriptor BasicLattice2DItem::latticeLength2 ( ) const

Definition at line 79 of file Lattice2DItems.cpp.

80 {
81  return m_length2;
82 }

References m_length2.

◆ latticeRotationAngle()

DoubleDescriptor Lattice2DItem::latticeRotationAngle ( ) const
inherited

◆ serialize()

void BasicLattice2DItem::serialize ( Streamer s)
overridevirtual

Implements Lattice2DItem.

Definition at line 60 of file Lattice2DItems.cpp.

61 {
62  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(), m_angle, Lattice2DItem::m_latticeRotationAngle, m_length1, m_length2, and Serialize::rwProperty().

Here is the call graph for this function:

◆ setLatticeAngle()

void BasicLattice2DItem::setLatticeAngle ( double  angle)

Definition at line 94 of file Lattice2DItems.cpp.

95 {
96  m_angle.set(angle);
97 }
void set(double d)
Set the contained value.

References m_angle, and DoubleProperty::set().

Here is the call graph for this function:

◆ setLatticeLength1()

void BasicLattice2DItem::setLatticeLength1 ( double  length1)

Definition at line 74 of file Lattice2DItems.cpp.

75 {
76  m_length1.set(length1);
77 }

References m_length1, and DoubleProperty::set().

Here is the call graph for this function:

◆ setLatticeLength2()

void BasicLattice2DItem::setLatticeLength2 ( double  length2)

Definition at line 84 of file Lattice2DItems.cpp.

85 {
86  m_length2.set(length2);
87 }

References m_length2, and DoubleProperty::set().

Here is the call graph for this function:

◆ setLatticeRotationAngle()

void Lattice2DItem::setLatticeRotationAngle ( double  angle)
inherited

Definition at line 38 of file Lattice2DItems.cpp.

39 {
41 }

References Lattice2DItem::m_latticeRotationAngle, and DoubleProperty::set().

Here is the call graph for this function:

◆ unitCellArea()

double Lattice2DItem::unitCellArea ( ) const
inherited

Definition at line 28 of file Lattice2DItems.cpp.

29 {
30  return createLattice()->unitCellArea();
31 }
virtual std::unique_ptr< Lattice2D > createLattice() const =0

References Lattice2DItem::createLattice().

Referenced by ParticleLayoutItem::totalDensityValue().

Here is the call graph for this function:

Member Data Documentation

◆ m_angle

DoubleProperty BasicLattice2DItem::m_angle
private

◆ m_latticeRotationAngle

◆ m_length1

DoubleProperty BasicLattice2DItem::m_length1
private

◆ m_length2

DoubleProperty BasicLattice2DItem::m_length2
private

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