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

Description

Definition at line 96 of file Lattice2DItems.h.

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

Public Member Functions

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

◆ HexagonalLattice2DItem()

HexagonalLattice2DItem::HexagonalLattice2DItem ( )

Definition at line 131 of file Lattice2DItems.cpp.

132 {
133  m_length.init("LatticeLength", "Length of first and second lattice vectors", 20.0,
134  Unit::nanometer, "len");
135 }
@ 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 > HexagonalLattice2DItem::createLattice ( ) const
overridevirtual

Implements Lattice2DItem.

Definition at line 137 of file Lattice2DItems.cpp.

138 {
139  return std::make_unique<HexagonalLattice2D>(m_length, Units::deg2rad(latticeRotationAngle()));
140 }
DoubleDescriptor latticeRotationAngle() const

References Lattice2DItem::latticeRotationAngle(), and m_length.

Here is the call graph for this function:

◆ geometryValues()

DoubleDescriptors HexagonalLattice2DItem::geometryValues ( bool  withRotationAngle) const
inlineoverridevirtual

Implements Lattice2DItem.

Definition at line 101 of file Lattice2DItems.h.

102  {
103  if (withRotationAngle)
105  return {m_length};
106  }
DoubleProperty m_latticeRotationAngle

References Lattice2DItem::m_latticeRotationAngle, and m_length.

◆ latticeLength()

DoubleDescriptor HexagonalLattice2DItem::latticeLength ( ) const

Definition at line 149 of file Lattice2DItems.cpp.

150 {
151  return m_length;
152 }

References m_length.

◆ latticeRotationAngle()

DoubleDescriptor Lattice2DItem::latticeRotationAngle ( ) const
inherited

◆ serialize()

void HexagonalLattice2DItem::serialize ( Streamer s)
overridevirtual

Implements Lattice2DItem.

Definition at line 142 of file Lattice2DItems.cpp.

143 {
144  s.assertVersion(0);
147 }
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 HexagonalLattice2DItem::setLatticeLength ( double  length)

Definition at line 154 of file Lattice2DItems.cpp.

155 {
156  m_length.set(length);
157 }
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 HexagonalLattice2DItem::m_length
private

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