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

Description

Definition at line 75 of file Lattice2DItems.h.

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

Public Member Functions

 SquareLattice2DItem ()
 
std::unique_ptr< Lattice2D > createLattice () const override
 
DoubleDescriptors geometryValues (bool withRotationAngle) const override
 
DoubleDescriptor latticeLength () const
 
DoubleDescriptor latticeRotationAngle () const
 
void serialize (Streamer &s) override
 
void setLatticeLength (double length)
 
void setLatticeRotationAngle (double angle)
 
double unitCellArea () const
 

Protected Attributes

DoubleProperty m_latticeRotationAngle
 

Private Attributes

DoubleProperty m_length
 

Constructor & Destructor Documentation

◆ SquareLattice2DItem()

SquareLattice2DItem::SquareLattice2DItem ( )

Definition at line 101 of file Lattice2DItems.cpp.

102 {
103  m_length.init("LatticeLength", "Length of first and second lattice vectors", 20.0,
104  Unit::nanometer, "len");
105 }
@ nanometer
void init(const QString &label, const QString &tooltip, double value, const variant< QString, Unit > &unit, const QString &persistentTag)
DoubleProperty m_length

References DoubleProperty::init(), m_length, and nanometer.

Here is the call graph for this function:

Member Function Documentation

◆ createLattice()

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

Implements Lattice2DItem.

Definition at line 107 of file Lattice2DItems.cpp.

108 {
109  return std::make_unique<SquareLattice2D>(m_length, Units::deg2rad(latticeRotationAngle()));
110 }
DoubleDescriptor latticeRotationAngle() const

References Lattice2DItem::latticeRotationAngle(), and m_length.

Here is the call graph for this function:

◆ geometryValues()

DoubleDescriptors SquareLattice2DItem::geometryValues ( bool  withRotationAngle) const
inlineoverridevirtual

Implements Lattice2DItem.

Definition at line 80 of file Lattice2DItems.h.

81  {
82  if (withRotationAngle)
84  return {m_length};
85  }
DoubleProperty m_latticeRotationAngle

References Lattice2DItem::m_latticeRotationAngle, and m_length.

◆ latticeLength()

DoubleDescriptor SquareLattice2DItem::latticeLength ( ) const

Definition at line 119 of file Lattice2DItems.cpp.

120 {
121  return m_length;
122 }

References m_length.

◆ latticeRotationAngle()

DoubleDescriptor Lattice2DItem::latticeRotationAngle ( ) const
inherited

◆ serialize()

void SquareLattice2DItem::serialize ( Streamer s)
overridevirtual

Implements Lattice2DItem.

Definition at line 112 of file Lattice2DItems.cpp.

113 {
114  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(), Lattice2DItem::m_latticeRotationAngle, m_length, and Serialize::rwProperty().

Here is the call graph for this function:

◆ setLatticeLength()

void SquareLattice2DItem::setLatticeLength ( double  length)

Definition at line 124 of file Lattice2DItems.cpp.

125 {
126  m_length.set(length);
127 }
void set(double d)
Set the contained value.

References m_length, 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_latticeRotationAngle

◆ m_length

DoubleProperty SquareLattice2DItem::m_length
private

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