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

replace 'Profile2DItemCatalog' by 'Profile2DCatalog'

parent a9a9da6d
No related branches found
No related tags found
1 merge request!2684Catalog / PolyItem cleanup
......@@ -207,14 +207,11 @@ void ParameterTreeBuilder::addInterference(ParameterLabelItem* layoutLabel,
auto* pdf1 = itf->probabilityDistributionSelection1().certainItem();
auto* pdf2 = itf->probabilityDistributionSelection2().certainItem();
const bool samePdfTypes =
Profile2DItemCatalog::type(pdf1) == Profile2DItemCatalog::type(pdf2);
auto* pdf1Label =
addLabel<Profile2DItemCatalog>(label, samePdfTypes ? "PDF1" : "PDF", pdf1);
const bool samePdfTypes = Profile2DCatalog::type(pdf1) == Profile2DCatalog::type(pdf2);
auto* pdf1Label = addLabel<Profile2DCatalog>(label, samePdfTypes ? "PDF1" : "PDF", pdf1);
for (auto* d : pdf1->profileProperties())
addParameterItem(pdf1Label, *d);
auto* pdf2Label =
addLabel<Profile2DItemCatalog>(label, samePdfTypes ? "PDF2" : "PDF", pdf2);
auto* pdf2Label = addLabel<Profile2DCatalog>(label, samePdfTypes ? "PDF2" : "PDF", pdf2);
for (auto* d : pdf2->profileProperties())
addParameterItem(pdf2Label, *d);
} else if (auto* itf = dynamic_cast<Interference1DLatticeItem*>(interference)) {
......@@ -231,7 +228,7 @@ void ParameterTreeBuilder::addInterference(ParameterLabelItem* layoutLabel,
addLattice(label, itf);
auto* df = itf->decayFunctionSelection().certainItem();
auto* dfLabel = addLabel<Profile2DItemCatalog>(label, "Decay function", df);
auto* dfLabel = addLabel<Profile2DCatalog>(label, "Decay function", df);
for (auto* d : df->profileProperties())
addParameterItem(dfLabel, *d);
} else if (auto* itf = dynamic_cast<InterferenceFinite2DLatticeItem*>(interference)) {
......
......@@ -157,7 +157,7 @@ Interference2DLatticeItem::Interference2DLatticeItem()
{
m_decay_function.initWithArgs("Decay Function",
"Two-dimensional decay function (finite size effects)",
Profile2DItemCatalog::Type::Cauchy);
Profile2DCatalog::Type::Cauchy);
}
std::unique_ptr<IInterference> Interference2DLatticeItem::createInterference() const
......@@ -207,9 +207,9 @@ Interference2DParacrystalItem::Interference2DParacrystalItem()
"Size of the coherent domain along the second basis vector", 20000.0,
"size2");
m_pdf1.initWithArgs("PDF 1", "Probability distribution in first lattice direction",
Profile2DItemCatalog::Type::Cauchy);
Profile2DCatalog::Type::Cauchy);
m_pdf2.initWithArgs("PDF 2", "Probability distribution in second lattice direction",
Profile2DItemCatalog::Type::Cauchy);
Profile2DCatalog::Type::Cauchy);
}
std::unique_ptr<IInterference> Interference2DParacrystalItem::createInterference() const
......
......@@ -102,11 +102,11 @@ public:
void writeTo(QXmlStreamWriter* w) const override;
void readFrom(QXmlStreamReader* r) override;
PolyItem<Profile2DItemCatalog>& decayFunctionSelection() { return m_decay_function; }
PolyItem<Profile2DCatalog>& decayFunctionSelection() { return m_decay_function; }
void setDecayFunctionType(Profile2DItem* p) { m_decay_function.setCertainItem(p); }
protected:
PolyItem<Profile2DItemCatalog> m_decay_function;
PolyItem<Profile2DCatalog> m_decay_function;
};
// ------------------------------------------------------------------------------------------------
......@@ -131,18 +131,18 @@ public:
const DoubleProperty& domainSize2() const { return m_domain_size2; }
void setDomainSize2(double size) { m_domain_size2.setDVal(size); }
PolyItem<Profile2DItemCatalog>& probabilityDistributionSelection1() { return m_pdf1; }
PolyItem<Profile2DCatalog>& probabilityDistributionSelection1() { return m_pdf1; }
void setPDF1Type(Profile2DItem* p) { m_pdf1.setCertainItem(p); }
PolyItem<Profile2DItemCatalog>& probabilityDistributionSelection2() { return m_pdf2; }
PolyItem<Profile2DCatalog>& probabilityDistributionSelection2() { return m_pdf2; }
void setPDF2Type(Profile2DItem* p) { m_pdf2.setCertainItem(p); }
private:
DoubleProperty m_damping_length;
DoubleProperty m_domain_size1;
DoubleProperty m_domain_size2;
PolyItem<Profile2DItemCatalog> m_pdf1;
PolyItem<Profile2DItemCatalog> m_pdf2;
PolyItem<Profile2DCatalog> m_pdf1;
PolyItem<Profile2DCatalog> m_pdf2;
};
// ------------------------------------------------------------------------------------------------
......
......@@ -3,7 +3,7 @@
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/Model/Sample/ProfileCatalogs.cpp
//! @brief Implements classes Profile1DCatalog, Profile2DItemCatalog.
//! @brief Implements classes Profile1DCatalog, Profile2DCatalog.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
......@@ -82,7 +82,7 @@ Profile1DCatalog::Type Profile1DCatalog::type(const BaseItem* item)
/* --------------------------------------------------------------------------------------------- */
Profile2DItemCatalog::BaseItem* Profile2DItemCatalog::create(Type type)
Profile2DCatalog::BaseItem* Profile2DCatalog::create(Type type)
{
switch (type) {
case Type::Cauchy:
......@@ -100,12 +100,12 @@ Profile2DItemCatalog::BaseItem* Profile2DItemCatalog::create(Type type)
}
}
QVector<Profile2DItemCatalog::Type> Profile2DItemCatalog::types()
QVector<Profile2DCatalog::Type> Profile2DCatalog::types()
{
return {Type::Cauchy, Type::Gauss, Type::Gate, Type::Cone, Type::Voigt};
}
UiInfo Profile2DItemCatalog::uiInfo(Type type)
UiInfo Profile2DCatalog::uiInfo(Type type)
{
switch (type) {
case Type::Cauchy:
......@@ -123,7 +123,7 @@ UiInfo Profile2DItemCatalog::uiInfo(Type type)
}
}
Profile2DItemCatalog::Type Profile2DItemCatalog::type(const BaseItem* item)
Profile2DCatalog::Type Profile2DCatalog::type(const BaseItem* item)
{
ASSERT(item);
......
......@@ -3,7 +3,7 @@
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/Model/Sample/ProfileCatalogs.h
//! @brief Defines classes Profile1DCatalog, Profile2DItemCatalog.
//! @brief Defines classes Profile1DCatalog, Profile2DCatalog.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
......@@ -49,7 +49,7 @@ public:
static Type type(const BaseItem* item);
};
class Profile2DItemCatalog {
class Profile2DCatalog {
public:
using BaseItem = Profile2DItem;
......
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