From 9c312c6c49a35c33ea9791587e46483ab75a1fed Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Tue, 23 Jul 2024 15:46:49 +0200 Subject: [PATCH] replace 'initWithArgs' by 'simpleInit' --- GUI/Model/Beam/SourceItems.cpp | 2 +- GUI/Model/Descriptor/PolyItem.h | 8 ++++---- GUI/Model/Detector/DetectorItem.cpp | 4 ++-- GUI/Model/Sample/InterferenceItems.cpp | 26 ++++++++++++------------- GUI/Model/Sample/ItemWithParticles.cpp | 2 +- GUI/Model/Sample/LayerItem.cpp | 4 ++-- GUI/Model/Sample/MesocrystalItem.cpp | 4 ++-- GUI/Model/Sample/ParticleItem.cpp | 2 +- GUI/Model/Sample/ParticleLayoutItem.cpp | 2 +- GUI/Model/Sim/InstrumentItems.cpp | 2 +- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/GUI/Model/Beam/SourceItems.cpp b/GUI/Model/Beam/SourceItems.cpp index 3289a12a789..c2f6b02a865 100644 --- a/GUI/Model/Beam/SourceItems.cpp +++ b/GUI/Model/Beam/SourceItems.cpp @@ -54,7 +54,7 @@ SourceItem::SourceItem() RealLimits::limited(0.0, 1e32), "intensity"); m_azimuthal_angle_item = std::make_unique<BeamAzimuthalAngleItem>(); - m_footprint.initWithArgs("Type", "Footprint type", FootprintCatalog::Type::Gaussian); + m_footprint.simpleInit("Type", "Footprint type", FootprintCatalog::Type::Gaussian); } void SourceItem::writeTo(QXmlStreamWriter* w) const diff --git a/GUI/Model/Descriptor/PolyItem.h b/GUI/Model/Descriptor/PolyItem.h index 8723419b244..99ec86bda09 100644 --- a/GUI/Model/Descriptor/PolyItem.h +++ b/GUI/Model/Descriptor/PolyItem.h @@ -23,8 +23,8 @@ template <typename Catalog> class PolyItem { public: using BaseItem = typename Catalog::BaseItem; - void initWithArgs(const QString& label, const QString& tooltip, - typename Catalog::Type currentType); + void simpleInit(const QString& label, const QString& tooltip, + typename Catalog::Type currentType); void initWithInitializer( const QString& label, const QString& tooltip, const QVector<typename Catalog::Type>& types, @@ -82,8 +82,8 @@ private: //! //! The current selection will be initialized with the first type in the catalog types. The optional //! arguments are the arguments which may be necessary for the creation method in the catalog. -template <typename C> void PolyItem<C>::initWithArgs(const QString& label, const QString& tooltip, - typename C::Type currentType) +template <typename C> void PolyItem<C>::simpleInit(const QString& label, const QString& tooltip, + typename C::Type currentType) { initFieldsAndSetter(label, tooltip); int index = C::types().indexOf(currentType); diff --git a/GUI/Model/Detector/DetectorItem.cpp b/GUI/Model/Detector/DetectorItem.cpp index 0f8d9d5eb70..74dbdaa5524 100644 --- a/GUI/Model/Detector/DetectorItem.cpp +++ b/GUI/Model/Detector/DetectorItem.cpp @@ -43,8 +43,8 @@ DetectorItem::DetectorItem() , m_masks(std::make_unique<MasksSet>()) , m_prjns(std::make_unique<MasksSet>()) { - m_resolution_function.initWithArgs("Resolution function", "Detector resolution function", - ResolutionFunctionCatalog::Type::None); + m_resolution_function.simpleInit("Resolution function", "Detector resolution function", + ResolutionFunctionCatalog::Type::None); } DetectorItem::~DetectorItem() = default; diff --git a/GUI/Model/Sample/InterferenceItems.cpp b/GUI/Model/Sample/InterferenceItems.cpp index c232eb75b76..a1a40850010 100644 --- a/GUI/Model/Sample/InterferenceItems.cpp +++ b/GUI/Model/Sample/InterferenceItems.cpp @@ -74,9 +74,9 @@ Interference1DLatticeItem::Interference1DLatticeItem() "Xi (deg)", "Rotation of lattice with respect to x-axis of reference frame (beam direction)", 0.0, "xi"); - m_decay_function.initWithArgs("Decay Function", - "One-dimensional decay function (finite size effects)", - Profile1DCatalog::Type::Cauchy); + m_decay_function.simpleInit("Decay Function", + "One-dimensional decay function (finite size effects)", + Profile1DCatalog::Type::Cauchy); } std::unique_ptr<IInterference> Interference1DLatticeItem::createInterference() const @@ -146,7 +146,7 @@ void Interference2DAbstractLatticeItem::readFrom(QXmlStreamReader* r) Interference2DAbstractLatticeItem::Interference2DAbstractLatticeItem(bool xiIntegration) : m_xi_integration(xiIntegration) { - m_lattice_type.initWithArgs("Lattice type", "", Lattice2DCatalog::Type::Basic); + m_lattice_type.simpleInit("Lattice type", "", Lattice2DCatalog::Type::Basic); m_lattice_type.setCertainItem(new HexagonalLattice2DItem()); } @@ -155,9 +155,9 @@ Interference2DAbstractLatticeItem::Interference2DAbstractLatticeItem(bool xiInte Interference2DLatticeItem::Interference2DLatticeItem() : Interference2DAbstractLatticeItem(false) { - m_decay_function.initWithArgs("Decay Function", - "Two-dimensional decay function (finite size effects)", - Profile2DCatalog::Type::Cauchy); + m_decay_function.simpleInit("Decay Function", + "Two-dimensional decay function (finite size effects)", + Profile2DCatalog::Type::Cauchy); } std::unique_ptr<IInterference> Interference2DLatticeItem::createInterference() const @@ -206,10 +206,10 @@ Interference2DParacrystalItem::Interference2DParacrystalItem() m_domain_size2.init("Domain size 2 (nm)", "Size of the coherent domain along the second basis vector", 20000.0, "size2"); - m_pdf1.initWithArgs("PDF 1", "Probability distribution in first lattice direction", - Profile2DCatalog::Type::Cauchy); - m_pdf2.initWithArgs("PDF 2", "Probability distribution in second lattice direction", - Profile2DCatalog::Type::Cauchy); + m_pdf1.simpleInit("PDF 1", "Probability distribution in first lattice direction", + Profile2DCatalog::Type::Cauchy); + m_pdf2.simpleInit("PDF 2", "Probability distribution in second lattice direction", + Profile2DCatalog::Type::Cauchy); } std::unique_ptr<IInterference> Interference2DParacrystalItem::createInterference() const @@ -364,8 +364,8 @@ InterferenceRadialParacrystalItem::InterferenceRadialParacrystalItem() m_kappa.init("SizeSpaceCoupling", "Size spacing coupling parameter of the Size Spacing Correlation Approximation", 0.0, "kappa"); - m_pdf.initWithArgs("PDF", "One-dimensional probability distribution", - Profile1DCatalog::Type::Cauchy); + m_pdf.simpleInit("PDF", "One-dimensional probability distribution", + Profile1DCatalog::Type::Cauchy); } std::unique_ptr<IInterference> InterferenceRadialParacrystalItem::createInterference() const diff --git a/GUI/Model/Sample/ItemWithParticles.cpp b/GUI/Model/Sample/ItemWithParticles.cpp index f415e3cebdf..ffd142daeb7 100644 --- a/GUI/Model/Sample/ItemWithParticles.cpp +++ b/GUI/Model/Sample/ItemWithParticles.cpp @@ -32,7 +32,7 @@ ItemWithParticles::ItemWithParticles(const QString& abundanceTooltip, m_abundance.init("Abundance", abundanceTooltip, 1.0, 3, RealLimits::limited(0.0, 1.0), "abundance"); m_position.init("Position offset (nm)", positionTooltip, "pos"); - m_rotation.initWithArgs("Rotation", "", RotationCatalog::Type::None); + m_rotation.simpleInit("Rotation", "", RotationCatalog::Type::None); } std::unique_ptr<IRotation> ItemWithParticles::createRotation() const diff --git a/GUI/Model/Sample/LayerItem.cpp b/GUI/Model/Sample/LayerItem.cpp index 4a9f44638f6..540a95e53dc 100644 --- a/GUI/Model/Sample/LayerItem.cpp +++ b/GUI/Model/Sample/LayerItem.cpp @@ -74,8 +74,8 @@ LayerItem::LayerItem(const MaterialsSet* materials) m_thickness.init("Thickness (nm)", "Thickness of the layer", 0.0, 3, RealLimits::lowerLimited(0.0), "thickness"); - m_roughness.initWithArgs("Top roughness", "Roughness of top interface", - RoughnessCatalog::Type::Basic); + m_roughness.simpleInit("Top roughness", "Roughness of top interface", + RoughnessCatalog::Type::Basic); } LayerItem::~LayerItem() = default; diff --git a/GUI/Model/Sample/MesocrystalItem.cpp b/GUI/Model/Sample/MesocrystalItem.cpp index a897638c279..c66c06db78b 100644 --- a/GUI/Model/Sample/MesocrystalItem.cpp +++ b/GUI/Model/Sample/MesocrystalItem.cpp @@ -58,8 +58,8 @@ MesocrystalItem::MesocrystalItem(const MaterialsSet* materials) m_vectorC.init("Third lattice vector (nm)", "Coordinates of the third lattice vector", "vectorC"); - m_outer_shape.initWithArgs("Outer Shape", "", FormfactorCatalog::Type::Box); - m_basis_particle.initWithArgs("Basis", "", ParticleCatalog::Type::Particle); + m_outer_shape.simpleInit("Outer Shape", "", FormfactorCatalog::Type::Box); + m_basis_particle.simpleInit("Basis", "", ParticleCatalog::Type::Particle); } void MesocrystalItem::writeTo(QXmlStreamWriter* w) const diff --git a/GUI/Model/Sample/ParticleItem.cpp b/GUI/Model/Sample/ParticleItem.cpp index e39ea60f8c9..37d78e20469 100644 --- a/GUI/Model/Sample/ParticleItem.cpp +++ b/GUI/Model/Sample/ParticleItem.cpp @@ -40,7 +40,7 @@ ParticleItem::ParticleItem(const MaterialsSet* materials) : ItemWithMaterial(materials) , ItemWithParticles(abundance_tooltip, position_tooltip) { - m_form_factor.initWithArgs("Form Factor", "", FormfactorCatalog::Type::Sphere); + m_form_factor.simpleInit("Form Factor", "", FormfactorCatalog::Type::Sphere); m_form_factor.setCertainItem(new CylinderItem); } diff --git a/GUI/Model/Sample/ParticleLayoutItem.cpp b/GUI/Model/Sample/ParticleLayoutItem.cpp index e7ca89367bb..3eca171689f 100644 --- a/GUI/Model/Sample/ParticleLayoutItem.cpp +++ b/GUI/Model/Sample/ParticleLayoutItem.cpp @@ -41,7 +41,7 @@ ParticleLayoutItem::ParticleLayoutItem(const MaterialsSet* materials) "Should be defined for disordered and 1d-ordered particle collections.", 0.0005, 6, 0.0001 /* step */, RealLimits::nonnegative(), "density"); - m_interference.initWithArgs("Interference function", "", InterferenceCatalog::Type::None); + m_interference.simpleInit("Interference function", "", InterferenceCatalog::Type::None); } double ParticleLayoutItem::totalDensityValue() const diff --git a/GUI/Model/Sim/InstrumentItems.cpp b/GUI/Model/Sim/InstrumentItems.cpp index 8c75e55ee13..592d51ceb52 100644 --- a/GUI/Model/Sim/InstrumentItems.cpp +++ b/GUI/Model/Sim/InstrumentItems.cpp @@ -100,7 +100,7 @@ InstrumentItem::InstrumentItem() m_analyzer_bloch_vector.init("Analyzer Bloch vector", "Polarization analyzer direction times efficiency", "analyzerBlochVector"); - m_background.initWithArgs("Background", "", BackgroundCatalog::Type::Constant); + m_background.simpleInit("Background", "", BackgroundCatalog::Type::Constant); } InstrumentItem::~InstrumentItem() = default; -- GitLab