Skip to content
Snippets Groups Projects
Commit a4e876f5 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

use delegate constructor

parent 867913c8
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,12 @@
//! @param length: Lattice length
//! @param xi: rotation of lattice with respect to x-axis
InterferenceFunction1DLattice::InterferenceFunction1DLattice(double length, double xi)
: m_lattice_params(length, xi), mp_pdf(nullptr), m_na(0)
: InterferenceFunction1DLattice(Lattice1DParameters(length, xi))
{}
InterferenceFunction1DLattice::InterferenceFunction1DLattice(
const Lattice1DParameters& lattice_params)
: m_lattice_params(lattice_params), mp_pdf(nullptr), m_na(0)
{
setName(BornAgain::InterferenceFunction1DLatticeType);
init_parameters();
......@@ -81,14 +86,6 @@ double InterferenceFunction1DLattice::evaluate(const kvector_t q) const
return result/a;
}
InterferenceFunction1DLattice::InterferenceFunction1DLattice(
const Lattice1DParameters& lattice_params)
: m_lattice_params(lattice_params), mp_pdf(nullptr), m_na(0)
{
setName(BornAgain::InterferenceFunction1DLatticeType);
init_parameters();
}
void InterferenceFunction1DLattice::init_parameters()
{
registerParameter(BornAgain::Length, &m_lattice_params.m_length).setUnit("nm").setNonnegative();
......
......@@ -45,7 +45,6 @@ public:
private:
InterferenceFunction1DLattice(const Lattice1DParameters& lattice_params);
//! Registers some class members for later access via parameter pool
void init_parameters();
Lattice1DParameters m_lattice_params;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment