From 9c49ff7be89a277da7904dab6e05d06b0735ce8d Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Thu, 4 Jul 2024 12:31:30 +0200 Subject: [PATCH] rename class and sources GUI/View/Sample/SelectionContainerForm -> GUI/View/Sample/PolyForm --- GUI/View/Sample/HeinzFormLayout.h | 12 ++++++------ GUI/View/Sample/LatticeTypeSelectionForm.h | 2 +- ...SelectionContainerForm.cpp => PolyForm.cpp} | 18 +++++++++--------- .../{SelectionContainerForm.h => PolyForm.h} | 17 ++++++++--------- GUI/View/Sample/SampleEditorController.h | 2 +- 5 files changed, 25 insertions(+), 26 deletions(-) rename GUI/View/Sample/{SelectionContainerForm.cpp => PolyForm.cpp} (65%) rename GUI/View/Sample/{SelectionContainerForm.h => PolyForm.h} (79%) diff --git a/GUI/View/Sample/HeinzFormLayout.h b/GUI/View/Sample/HeinzFormLayout.h index 0f6d4cab4c3..eca533e04ef 100644 --- a/GUI/View/Sample/HeinzFormLayout.h +++ b/GUI/View/Sample/HeinzFormLayout.h @@ -16,7 +16,7 @@ #define BORNAGAIN_GUI_VIEW_SAMPLE_HEINZFORMLAYOUT_H #include "GUI/Model/Descriptor/PolyItem.h" -#include "GUI/View/Sample/SelectionContainerForm.h" +#include "GUI/View/Sample/PolyForm.h" #include <QFormLayout> class SampleEditorController; @@ -49,16 +49,16 @@ public: //! Add a row with a selection. //! - //! The whole selection is realized by adding a SelectionContainerForm. This - //! SelectionContainerForm is limited to contain the selection combo box and a list of double + //! The whole selection is realized by adding a PolyForm. This + //! PolyForm is limited to contain the selection combo box and a list of double //! values represented by DoubleProperties. To add more complex selections (e.g. with - //! sub-selections or different value types), this method and the SelectionContainerForm is not + //! sub-selections or different value types), this method and the PolyForm is not //! sufficient. It has to be done "manually". - //! For more details, see SelectionContainerForm. + //! For more details, see PolyForm. //! Returns the newly added row. template <typename T> void addSelection(PolyItem<T>& d) { - addBoldRow(d.label(), new SelectionContainerForm(QFormLayout::parentWidget(), d, m_ec)); + addBoldRow(d.label(), new PolyForm(QFormLayout::parentWidget(), d, m_ec)); } //! Adds a row with a bold printed label and a DoubleSpinBox. diff --git a/GUI/View/Sample/LatticeTypeSelectionForm.h b/GUI/View/Sample/LatticeTypeSelectionForm.h index 3d3fc3cb149..9201b3aad9b 100644 --- a/GUI/View/Sample/LatticeTypeSelectionForm.h +++ b/GUI/View/Sample/LatticeTypeSelectionForm.h @@ -16,7 +16,7 @@ #define BORNAGAIN_GUI_VIEW_SAMPLE_LATTICETYPESELECTIONFORM_H #include "GUI/Model/Sample/InterferenceItems.h" -#include "GUI/View/Sample/SelectionContainerForm.h" +#include "GUI/View/Sample/PolyForm.h" #include <QCheckBox> class Interference2DAbstractLatticeItem; diff --git a/GUI/View/Sample/SelectionContainerForm.cpp b/GUI/View/Sample/PolyForm.cpp similarity index 65% rename from GUI/View/Sample/SelectionContainerForm.cpp rename to GUI/View/Sample/PolyForm.cpp index 8b56117de38..15e6d96a69a 100644 --- a/GUI/View/Sample/SelectionContainerForm.cpp +++ b/GUI/View/Sample/PolyForm.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file GUI/View/Sample/SelectionContainerForm.cpp -//! @brief Implements class SelectionContainerForm, except for templated functions. +//! @file GUI/View/Sample/PolyForm.cpp +//! @brief Implements class PolyForm, except for templated functions. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,48 +12,48 @@ // // ************************************************************************************************ -#include "GUI/View/Sample/SelectionContainerForm.h" +#include "GUI/View/Sample/PolyForm.h" #include "GUI/Model/Sample/FormFactorItems.h" #include "GUI/Model/Sample/ProfileItems.h" #include "GUI/Model/Sample/RotationItems.h" #include "GUI/Model/Sample/RoughnessItems.h" #include "GUI/View/Base/LayoutUtil.h" -void SelectionContainerForm::createContent() +void PolyForm::createContent() { if (currentValues != nullptr) GUI::Util::Layer::addMultiPropertyToGrid(m_grid_layout, 1, currentValues(), m_ec, true); } -DoubleProperties SelectionContainerForm::doublePropertiesOfItem(RotationItem* item) +DoubleProperties PolyForm::doublePropertiesOfItem(RotationItem* item) { if (!item) return {}; return item->rotationProperties(); } -DoubleProperties SelectionContainerForm::doublePropertiesOfItem(Profile2DItem* item) +DoubleProperties PolyForm::doublePropertiesOfItem(Profile2DItem* item) { if (!item) return {}; return item->profileProperties(); } -DoubleProperties SelectionContainerForm::doublePropertiesOfItem(Profile1DItem* item) +DoubleProperties PolyForm::doublePropertiesOfItem(Profile1DItem* item) { if (!item) return {}; return item->profileProperties(); } -DoubleProperties SelectionContainerForm::doublePropertiesOfItem(FormFactorItem* item) +DoubleProperties PolyForm::doublePropertiesOfItem(FormFactorItem* item) { if (!item) return {}; return item->geometryProperties(); } -DoubleProperties SelectionContainerForm::doublePropertiesOfItem(RoughnessItem* item) +DoubleProperties PolyForm::doublePropertiesOfItem(RoughnessItem* item) { if (!item) return {}; diff --git a/GUI/View/Sample/SelectionContainerForm.h b/GUI/View/Sample/PolyForm.h similarity index 79% rename from GUI/View/Sample/SelectionContainerForm.h rename to GUI/View/Sample/PolyForm.h index 3a02aac48a5..cbb13ecd115 100644 --- a/GUI/View/Sample/SelectionContainerForm.h +++ b/GUI/View/Sample/PolyForm.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file GUI/View/Sample/SelectionContainerForm.h -//! @brief Defines class SelectionContainerForm, and implements templated functions. +//! @file GUI/View/Sample/PolyForm.h +//! @brief Defines class PolyForm, and implements templated functions. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,15 +12,15 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_GUI_VIEW_SAMPLE_SELECTIONCONTAINERFORM_H -#define BORNAGAIN_GUI_VIEW_SAMPLE_SELECTIONCONTAINERFORM_H +#ifndef BORNAGAIN_GUI_VIEW_SAMPLE_POLYFORM_H +#define BORNAGAIN_GUI_VIEW_SAMPLE_POLYFORM_H #include "GUI/View/Sample/ISelectionForm.h" #include "GUI/View/Sample/LayerEditorUtil.h" //! A widget to contain a selection, defined by a PolyItem. //! -//! This SelectionContainerForm is limited to contain the selection combo box and a list of double +//! This PolyForm is limited to contain the selection combo box and a list of double //! values represented by DoubleProperties. The list of DoubleProperties is queried by calling //! GUI::Util::Layer::doublePropertiesOfItem(). To have the correct DoubleProperties on this form, //! you may have to overload this method according to your class and your needs. The overload will @@ -39,10 +39,9 @@ //! //! If a more complex selection shall be realized (e.g. with //! sub-selections or different value types), this class is not sufficient. -class SelectionContainerForm : public ISelectionForm { +class PolyForm : public ISelectionForm { public: - template <typename T> - SelectionContainerForm(QWidget* parent, PolyItem<T>& d, SampleEditorController* ec) + template <typename T> PolyForm(QWidget* parent, PolyItem<T>& d, SampleEditorController* ec) : ISelectionForm(parent, ec) { currentValues = [&d] { return doublePropertiesOfItem(d.certainItem()); }; @@ -61,4 +60,4 @@ private: std::function<DoubleProperties()> currentValues = nullptr; }; -#endif // BORNAGAIN_GUI_VIEW_SAMPLE_SELECTIONCONTAINERFORM_H +#endif // BORNAGAIN_GUI_VIEW_SAMPLE_POLYFORM_H diff --git a/GUI/View/Sample/SampleEditorController.h b/GUI/View/Sample/SampleEditorController.h index 9329323c1d1..841588bbd97 100644 --- a/GUI/View/Sample/SampleEditorController.h +++ b/GUI/View/Sample/SampleEditorController.h @@ -36,7 +36,7 @@ class MesocrystalForm; class ParticleLayoutItem; class SampleForm; class SampleItem; -class SelectionContainerForm; +class PolyForm; //! Class to modify a sample from the layer oriented sample editor. //! -- GitLab