diff --git a/App/AppOptions.cpp b/App/AppOptions.cpp index 805b2c829579bc241aa2e36eb7716d73f2727050..7f30532cf943296222dd66ec14098d3ad2ac24e5 100644 --- a/App/AppOptions.cpp +++ b/App/AppOptions.cpp @@ -69,13 +69,6 @@ ApplicationOptions::ApplicationOptions(int argc, char** argv) processOptions(); } -//! access variables - -const bpo::variable_value& ApplicationOptions::operator[](const std::string& s) const -{ - return m_variables_map[s]; -} - bool ApplicationOptions::find(std::string name) const { return m_variables_map.count(name); @@ -110,16 +103,6 @@ void ApplicationOptions::parseCommandLine(int argc, char** argv) } } -boost::program_options::variables_map& ApplicationOptions::getVariables() -{ - return m_variables_map; -} - -boost::program_options::options_description& ApplicationOptions::getOptions() -{ - return m_options; -} - void ApplicationOptions::processOptions() { if (m_variables_map.count("help")) { diff --git a/App/AppOptions.h b/App/AppOptions.h index b38deb595c1b154cda6b287578be12363878e635..453b2238e7eda9075504fe16647c3db6c8b465d5 100644 --- a/App/AppOptions.h +++ b/App/AppOptions.h @@ -30,9 +30,6 @@ class ApplicationOptions { public: ApplicationOptions(int argc = 0, char** argv = 0); - //! access to variable with given name defined in variables container - const bpo::variable_value& operator[](const std::string& s) const; - QSize mainWindowSize() const; QString projectFile() const; @@ -44,12 +41,6 @@ private: //! Parses command line arguments void parseCommandLine(int argc, char** argv); - //! Returns reference to the variables container - bpo::variables_map& getVariables(); - - //! Returns reference to the options description - bpo::options_description& getOptions(); - void processOptions(); //! options description, to be filled with add() from different program modules diff --git a/Base/Axis/MakeScale.cpp b/Base/Axis/MakeScale.cpp index b541a3104a2a1c208758ae6f377bda7d73309213..c584426e8d62560f0ced4664b086f605c6958c7f 100644 --- a/Base/Axis/MakeScale.cpp +++ b/Base/Axis/MakeScale.cpp @@ -69,17 +69,6 @@ Scale* newEquiDivision(std::string name, size_t N, double start, double end) return new Scale(EquiDivision(name, N, start, end)); } -std::shared_ptr<Scale> sharedEquiDivision(std::string name, size_t N, double start, double end) -{ - return std::shared_ptr<Scale>(newEquiDivision(name, N, start, end)); -} - -std::unique_ptr<Scale> uniqueEquiDivision(std::string name, size_t N, double start, double end) -{ - return std::unique_ptr<Scale>(newEquiDivision(name, N, start, end)); -} - - Scale EquiScan(std::string name, size_t N, double start, double end) { if (N == 0) @@ -105,13 +94,3 @@ Scale* newEquiScan(std::string name, size_t N, double start, double end) { return new Scale(EquiScan(name, N, start, end)); } - -std::shared_ptr<Scale> sharedEquiScan(std::string name, size_t N, double start, double end) -{ - return std::shared_ptr<Scale>(newEquiDivision(name, N, start, end)); -} - -std::unique_ptr<Scale> uniqueEquiScan(std::string name, size_t N, double start, double end) -{ - return std::unique_ptr<Scale>(newEquiDivision(name, N, start, end)); -} diff --git a/Base/Axis/MakeScale.h b/Base/Axis/MakeScale.h index ac2071fbc04e04cf38b894d7eac2025863fd3d95..946cd819bce62714351109d12df7c91a3bdd5b13 100644 --- a/Base/Axis/MakeScale.h +++ b/Base/Axis/MakeScale.h @@ -15,7 +15,6 @@ #ifndef BORNAGAIN_BASE_AXIS_MAKESCALE_H #define BORNAGAIN_BASE_AXIS_MAKESCALE_H -#include <memory> #include <string> #include <vector> @@ -35,16 +34,12 @@ Scale* newListScan(std::string name, std::vector<double> points); Scale EquiDivision(std::string name, size_t N, double start, double end); #ifndef SWIG Scale* newEquiDivision(std::string name, size_t N, double start, double end); -std::shared_ptr<Scale> sharedEquiDivision(std::string name, size_t N, double start, double end); -std::unique_ptr<Scale> uniqueEquiDivision(std::string name, size_t N, double start, double end); #endif // SWIG //! Returns axis with equidistant points (zero bin width). Scale EquiScan(std::string name, size_t N, double start, double end); #ifndef SWIG Scale* newEquiScan(std::string name, size_t N, double start, double end); -std::shared_ptr<Scale> sharedEquiScan(std::string name, size_t N, double start, double end); -std::unique_ptr<Scale> uniqueEquiScan(std::string name, size_t N, double start, double end); #endif // SWIG #endif // BORNAGAIN_BASE_AXIS_MAKESCALE_H diff --git a/Base/Axis/Pixel.cpp b/Base/Axis/Pixel.cpp index e1b89c05bf1e396b05676615e897dc6df2c319ce..2af259c7441b87df8dd3a7415631a23d2095f0d7 100644 --- a/Base/Axis/Pixel.cpp +++ b/Base/Axis/Pixel.cpp @@ -26,11 +26,6 @@ Pixel::Pixel(const Bin1D& phi_bin, const Bin1D& alpha_bin) m_solid_angle = solid_angle_value <= 0.0 ? 1.0 : solid_angle_value; } -Pixel* Pixel::clone() const -{ - return new Pixel(*this); -} - Pixel* Pixel::createZeroSizePixel(double x, double y) const { const double phi = m_phi + x * m_dphi; diff --git a/Base/Axis/Pixel.h b/Base/Axis/Pixel.h index 7b1db209b97d9751ebc5823eef829a8aa2043011..9cd535d62f37195826265b4113c407fa4a7da53f 100644 --- a/Base/Axis/Pixel.h +++ b/Base/Axis/Pixel.h @@ -28,7 +28,6 @@ class Pixel { public: Pixel(const Bin1D& phi_bin, const Bin1D& alpha_bin); - Pixel* clone() const; Pixel* createZeroSizePixel(double x, double y) const; R3 getK(double x, double y, double wavelength) const; double integrationFactor(double x, double y) const; diff --git a/Device/Beam/Beam.cpp b/Device/Beam/Beam.cpp index 7a350a4c10041cd5137aae0c859f20dae3f32209..1205747f77cc6f686201e93588d7f228a52cceec 100644 --- a/Device/Beam/Beam.cpp +++ b/Device/Beam/Beam.cpp @@ -52,12 +52,6 @@ std::vector<const INode*> Beam::nodeChildren() const return {}; } -//! Returns wave vector of beam after specular reflection by the horizontal sample. -R3 Beam::k_reflected() const -{ - return vecOfKAlphaPhi(m_wavenumber, m_alpha, -m_phi); -} - SpinMatrix Beam::polMatrix() const { return SpinMatrix::FromBlochVector(m_polarization); diff --git a/Device/Beam/Beam.h b/Device/Beam/Beam.h index e29e3cacf5f985c297a72442cb33abe8bc88cd28..9bea431c84a80f48055a7c333c1e159bb57df293 100644 --- a/Device/Beam/Beam.h +++ b/Device/Beam/Beam.h @@ -71,7 +71,6 @@ public: { return m_k; } - R3 k_reflected() const; //! Returns polarization density as Bloch vector R3 polVector() const diff --git a/Device/Data/Datafield.cpp b/Device/Data/Datafield.cpp index ba60a09e4fdbc0ac0d253705adc70e48cab0c30b..772a1b562707b0342d94b205fc6c8a4cf5fd4e69 100644 --- a/Device/Data/Datafield.cpp +++ b/Device/Data/Datafield.cpp @@ -145,8 +145,6 @@ Datafield::Datafield(const Datafield& other) Datafield::~Datafield() = default; -Datafield& Datafield::operator=(Datafield&& other) noexcept = default; - Datafield* Datafield::clone() const { return new Datafield(title(), frame().clone(), m_values, m_errSigmas); diff --git a/Device/Data/Datafield.h b/Device/Data/Datafield.h index 417cbda42dfd9497968ad913587cc691587c198f..a6f4de732c6eedc96946c1acea208999833f23d2 100644 --- a/Device/Data/Datafield.h +++ b/Device/Data/Datafield.h @@ -57,8 +57,6 @@ public: Datafield(Datafield&&) noexcept; virtual ~Datafield(); - Datafield& operator=(Datafield&& other) noexcept; - Datafield* clone() const; void setTitle(const std::string& title); diff --git a/Device/Detector/OffspecDetector.cpp b/Device/Detector/OffspecDetector.cpp index 6b047ec910af9e78c52252bc5e3dc3d8fccd704a..af926b55807f91440c9985ae742e3ad556999359 100644 --- a/Device/Detector/OffspecDetector.cpp +++ b/Device/Detector/OffspecDetector.cpp @@ -21,8 +21,8 @@ OffspecDetector::OffspecDetector(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) - : m_axes{sharedEquiDivision("phi_f (rad)", n_phi, phi_min, phi_max), - sharedEquiDivision("alpha_f (rad)", n_alpha, alpha_min, alpha_max)} + : m_axes{std::make_shared<Scale>(EquiDivision("phi_f (rad)", n_phi, phi_min, phi_max)), + std::make_shared<Scale>(EquiDivision("alpha_f (rad)", n_alpha, alpha_min, alpha_max))} { } diff --git a/Fit/Param/RealLimits.cpp b/Fit/Param/RealLimits.cpp index 4fda95d45a8ee21ccba47c8374964838258b16dc..62548675597e6ed9faa1d1f0513689c937aa688e 100644 --- a/Fit/Param/RealLimits.cpp +++ b/Fit/Param/RealLimits.cpp @@ -167,16 +167,6 @@ std::string RealLimits::toString() const return result.str(); } -void RealLimits::check(const std::string& name, const double value) const -{ - if (!isInRange(value)) { - std::ostringstream message; - message << "Parameter " << name << ": value " << value << " is out of bounds [" << *this - << "]\n"; - throw std::runtime_error(message.str()); - } -} - bool RealLimits::operator==(const RealLimits& other) const { return (m_has_lower_limit == other.m_has_lower_limit) diff --git a/Fit/Param/RealLimits.h b/Fit/Param/RealLimits.h index e02ebafcb50b91549cab531bfc038ab708413123..33b6914147eaff0052a04e21ec32a541199f5cd7 100644 --- a/Fit/Param/RealLimits.h +++ b/Fit/Param/RealLimits.h @@ -84,9 +84,6 @@ public: std::string toString() const; - //! Throws if value is outside limits. Parameter 'name' is for exception message. - void check(const std::string& name, double value) const; - //! Prints class friend std::ostream& operator<<(std::ostream& ostr, const RealLimits& m) { diff --git a/Fit/Tools/MinimizerUtil.cpp b/Fit/Tools/MinimizerUtil.cpp index 9c6849cc4949b6ed9973d9a525840ccf4d52ef60..4731057269b01ac2751b3e9545f1db2365be4930 100644 --- a/Fit/Tools/MinimizerUtil.cpp +++ b/Fit/Tools/MinimizerUtil.cpp @@ -80,14 +80,6 @@ std::string mumufit::utils::gslErrorDescription(int errorCode) return "Unknown error"; } -bool mumufit::utils::numbersDiffer(double a, double b, double tol) -{ - constexpr double eps = std::numeric_limits<double>::epsilon(); - if (tol < 1) - throw std::runtime_error("mumufit::utils::numbersDiffer -> Error.Not intended for tol<1"); - return std::abs(a - b) > eps * std::max(tol * eps, std::abs(b)); -} - //! Returns horizontal line of 80 characters length with section name in it. std::string mumufit::utils::sectionString(const std::string& sectionName, size_t report_width) diff --git a/Fit/Tools/MinimizerUtil.h b/Fit/Tools/MinimizerUtil.h index b707feed9371bb608f616bca819cf6736a6319f8..aa180a4263a1f772d6a9b77340b0b403062b58ea 100644 --- a/Fit/Tools/MinimizerUtil.h +++ b/Fit/Tools/MinimizerUtil.h @@ -32,8 +32,6 @@ std::map<int, std::string> gslErrorDescriptionMap(); std::string gslErrorDescription(int errorCode); -bool numbersDiffer(double a, double b, double tol); - std::string sectionString(const std::string& sectionName = "", size_t report_width = 80); } // namespace mumufit::utils diff --git a/GUI/Model/Detector/DetectorItem.cpp b/GUI/Model/Detector/DetectorItem.cpp index dda42cfbe71baba72a24e992a20ea75b6a181512..219c6716ef4041c94da648554cc0d4865d92c82a 100644 --- a/GUI/Model/Detector/DetectorItem.cpp +++ b/GUI/Model/Detector/DetectorItem.cpp @@ -36,10 +36,6 @@ const QString ResolutionFunction("ResolutionFunction"); } // namespace Tag -const int default_n = 100; -const double default_phi_minmax = 2; -const double default_alpha_max = 3; - } // namespace DetectorItem::DetectorItem() diff --git a/GUI/Model/Detector/OffspecDetectorItem.cpp b/GUI/Model/Detector/OffspecDetectorItem.cpp index 2e6a4662d2b8996c27560681f5049b1174cbcdbc..5ec7a3bcc80761e2b114bfd69f8d8104789f3c2e 100644 --- a/GUI/Model/Detector/OffspecDetectorItem.cpp +++ b/GUI/Model/Detector/OffspecDetectorItem.cpp @@ -110,8 +110,3 @@ void OffspecDetectorItem::setYSize(size_t ny) { m_alphaAxis.setNbins(ny); } - -double OffspecDetectorItem::axesToCoreUnitsFactor() const -{ - return Units::deg; -} diff --git a/GUI/Model/Detector/OffspecDetectorItem.h b/GUI/Model/Detector/OffspecDetectorItem.h index 43a44c37773a6243cb7e26735da82ab220dd23eb..fb88f54f8dbb20b2b12139bd5536b76fd5d32000 100644 --- a/GUI/Model/Detector/OffspecDetectorItem.h +++ b/GUI/Model/Detector/OffspecDetectorItem.h @@ -31,8 +31,6 @@ public: void setXSize(size_t nx); void setYSize(size_t ny); - double axesToCoreUnitsFactor() const; - AxisProperty& phiAxis() { return m_phiAxis; } const AxisProperty& phiAxis() const { return m_phiAxis; } diff --git a/GUI/Model/Device/InstrumentNotifier.cpp b/GUI/Model/Device/InstrumentNotifier.cpp index e65fd24c0513c4fe5c941cadf7d7cad5fc56a64b..95051b9bb88a8ef352916e2631bf15e323184a05 100644 --- a/GUI/Model/Device/InstrumentNotifier.cpp +++ b/GUI/Model/Device/InstrumentNotifier.cpp @@ -30,11 +30,6 @@ void InstrumentNotifier::setInstrumentName(const QString& name) m_ec->setInstrumentName(m_instrumentItem, name); } -void InstrumentNotifier::notifyInstrumentChanged() -{ - m_ec->instrumentChanged(m_instrumentItem); -} - void InstrumentNotifier::notifyWavelengthDistributionChanged() { // Update values in pointwise axis. This is necessary after a change of the mean wavelength. diff --git a/GUI/Model/Device/InstrumentNotifier.h b/GUI/Model/Device/InstrumentNotifier.h index 2b6463eeb55dff09b1f4388e8114b1ebc9f6dc1e..913f355c818e35693bc2fc14bc76d334bf59bc0b 100644 --- a/GUI/Model/Device/InstrumentNotifier.h +++ b/GUI/Model/Device/InstrumentNotifier.h @@ -40,12 +40,6 @@ public: //! The signal is emitted by the parent MultiInstrumentNotifier. void setInstrumentName(const QString& name); - //! Call this if any instrument value has been changed outside this controller. - //! - //! emits MultiInstrumentNotifier::instrumentChanged - //! For example if a double has been changed, but setDouble() has not been called - void notifyInstrumentChanged(); - //! Update dependent data and emit a changed signal void notifyWavelengthDistributionChanged(); diff --git a/GUI/Model/Job/JobItem.cpp b/GUI/Model/Job/JobItem.cpp index ae0352b78fbc5ec9a0dc4fa140ff1dba155f1b4a..7b0ca05d57f94dc3970e2a69921d11615c0584ad 100644 --- a/GUI/Model/Job/JobItem.cpp +++ b/GUI/Model/Job/JobItem.cpp @@ -97,11 +97,6 @@ void JobItem::setStatus(JobStatus status) emit jobStatusChanged(status); } -bool JobItem::isIdle() const -{ - return status() == JobStatus::Idle; -} - bool JobItem::isRunning() const { return status() == JobStatus::Running; @@ -185,11 +180,6 @@ void JobItem::setProgress(int progress) emit jobProgressChanged(progress); } -bool JobItem::runImmediately() const -{ - return simulationOptionsItem().runImmediately(); -} - bool JobItem::runInBackground() const { return !simulationOptionsItem().runImmediately(); diff --git a/GUI/Model/Job/JobItem.h b/GUI/Model/Job/JobItem.h index 4d41cf37ca561a1689ad6662e4b34aed651bf5f1..e8c694ac3fe93de97bfa409f87eb4cd695fffb7f 100644 --- a/GUI/Model/Job/JobItem.h +++ b/GUI/Model/Job/JobItem.h @@ -51,7 +51,6 @@ public: JobStatus status() const; void setStatus(JobStatus status); - bool isIdle() const; bool isRunning() const; bool isCompleted() const; bool isCanceled() const; @@ -74,7 +73,6 @@ public: int progress() const; void setProgress(int progress); - bool runImmediately() const; bool runInBackground() const; QString presentationType() const { return m_presentationType; } diff --git a/GUI/Model/Mask/MaskContainerItem.cpp b/GUI/Model/Mask/MaskContainerItem.cpp index 1739b028af628c02536d89f537304bbcfe85956b..a674ec35dbe9df8b9f695a2641b72ee4ff10d9e1 100644 --- a/GUI/Model/Mask/MaskContainerItem.cpp +++ b/GUI/Model/Mask/MaskContainerItem.cpp @@ -55,11 +55,6 @@ void MaskContainerItem::removeMaskAt(int row) m_maskItems.delete_at(row); } -void MaskContainerItem::removeMask(MaskItem* maskItem) -{ - m_maskItems.delete_element(maskItem); -} - RegionOfInterestItem* MaskContainerItem::regionOfInterestItem() const { for (const auto& maskSel : m_maskItems) diff --git a/GUI/Model/Mask/MaskContainerItem.h b/GUI/Model/Mask/MaskContainerItem.h index 58be54a55d21e79acd6dd43de549b92311ca4fad..131cc0198e849f18366ed9dff8ac63e5d793aec5 100644 --- a/GUI/Model/Mask/MaskContainerItem.h +++ b/GUI/Model/Mask/MaskContainerItem.h @@ -42,9 +42,6 @@ public: //! Move mask to a given row virtual void moveMask(int from_row, int to_row); - //! Remove a given mask - virtual void removeMask(MaskItem* maskItem); - virtual void removeMaskAt(int row); //! Can be nullptr. diff --git a/GUI/Model/Mask/MaskContainerModel.cpp b/GUI/Model/Mask/MaskContainerModel.cpp index 62dbbd05a8eb564f458b15853aee76a832436d82..db4628b5fbc6b9f3164834497c9ebf6732e995c2 100644 --- a/GUI/Model/Mask/MaskContainerModel.cpp +++ b/GUI/Model/Mask/MaskContainerModel.cpp @@ -60,15 +60,6 @@ void MaskContainerModel::insertMask(int row, MaskItem* item) QAbstractListModel::endInsertRows(); } -void MaskContainerModel::maskToModel(MaskItem* item) -{ - qsizetype row = m_maskContItem->size() - 1; - QAbstractListModel::beginInsertRows(m_maskContItem->rootIndex, row, row); - m_maskContItem->addMaskItem(item); - QAbstractListModel::endInsertRows(); -} - - //! Move mask to a given row void MaskContainerModel::moveMask(int from_row, int to_row) { @@ -91,15 +82,6 @@ void MaskContainerModel::removeMask(MaskItem* item) removeMaskAt(row); } -RegionOfInterestItem* MaskContainerModel::regionOfInterestItem() const -{ - for (MaskItem* maskItem : m_maskContItem->maskItems()) - if (auto* reg = dynamic_cast<RegionOfInterestItem*>(maskItem)) - return reg; - - return nullptr; -} - QModelIndex MaskContainerModel::indexOfItem(const MaskRoot* item) const { if (const auto* ii = dynamic_cast<const MaskItem*>(item)) { diff --git a/GUI/Model/Mask/MaskContainerModel.h b/GUI/Model/Mask/MaskContainerModel.h index e6f1f7c6bd4a2e618167484886534558cef111dc..a7f12aaf1175885dce25da93a624e3978a79e0e2 100644 --- a/GUI/Model/Mask/MaskContainerModel.h +++ b/GUI/Model/Mask/MaskContainerModel.h @@ -44,8 +44,6 @@ public: void insertMask(int row, MaskItem* item); - void maskToModel(MaskItem* item); - void removeMask(MaskItem* item); //! Removes all masks @@ -57,8 +55,6 @@ public: QModelIndex indexOfItem(const MaskRoot* item) const; // TODO: change this to MaskItem* MaskItem* itemForIndex(const QModelIndex& index) const; - RegionOfInterestItem* regionOfInterestItem() const; - QItemSelectionModel* maskSelectionModel() { return m_selectionModel.get(); } MaskContainerItem* maskContItem() { return m_maskContItem; } diff --git a/GUI/Model/Sample/CoreAndShellItem.cpp b/GUI/Model/Sample/CoreAndShellItem.cpp index 43f05542382974a95203819187219bf11a3ebda1..4f50a590e37945dcd2bd98d7a596959994cf8cd7 100644 --- a/GUI/Model/Sample/CoreAndShellItem.cpp +++ b/GUI/Model/Sample/CoreAndShellItem.cpp @@ -16,7 +16,6 @@ #include "Base/Util/Assert.h" #include "GUI/Model/Sample/MaterialModel.h" #include "GUI/Model/Sample/ParticleItem.h" -#include "GUI/Model/Type/VariantUtil.h" #include "Sample/Particle/CoreAndShell.h" #include "Sample/Particle/Particle.h" #include "Sample/Scattering/Rotations.h" diff --git a/GUI/Model/Type/VariantUtil.cpp b/GUI/Model/Type/VariantUtil.cpp deleted file mode 100644 index 20cf0570dfe8616eeef8feae1192658054046e76..0000000000000000000000000000000000000000 --- a/GUI/Model/Type/VariantUtil.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file GUI/Model/Type/VariantUtil.cpp -//! @brief Implements namespace SessionItemUtils. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ - -#include "GUI/Model/Type/VariantUtil.h" - -int GUI::Util::Variant::VariantType(const QVariant& variant) -{ - int result = static_cast<int>(variant.type()); - if (result == QVariant::UserType) - result = variant.userType(); - return result; -} - -bool GUI::Util::Variant::CompatibleVariantTypes(const QVariant& oldValue, const QVariant& newValue) -{ - // if olfValue is undefined then it is compatible with any value, otherwise newValue - // should have same variant type as oldValue - - if (oldValue.isValid()) - return GUI::Util::Variant::VariantType(oldValue) - == GUI::Util::Variant::VariantType(newValue); - return true; -} - -// For custom variants (based on e.g. ComboProperty) will always return false, i.e. -// we will rely here on our custom editors. -// This is done to not to register custom comparators in main.cpp. -bool GUI::Util::Variant::IsTheSame(const QVariant& var1, const QVariant& var2) -{ - // variants of different type are always reported as not the same - if (VariantType(var1) != VariantType(var2)) - return false; - - // custom type variants are always reported as not the same - if (var1.type() == QVariant::UserType) - return false; - - // standard variants (based on double, int, etc) are compared by value they are holding - return var1 == var2; -} diff --git a/GUI/Model/Type/VariantUtil.h b/GUI/Model/Type/VariantUtil.h deleted file mode 100644 index ca5b34da7703255c8e11b216f7392c72a8ac6a7d..0000000000000000000000000000000000000000 --- a/GUI/Model/Type/VariantUtil.h +++ /dev/null @@ -1,38 +0,0 @@ -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file GUI/Model/Type/VariantUtil.h -//! @brief Defines namespace GUI::Util::Variant. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ - -#ifndef BORNAGAIN_GUI_MODEL_TYPE_VARIANTUTIL_H -#define BORNAGAIN_GUI_MODEL_TYPE_VARIANTUTIL_H - -#include <QString> -#include <QVariant> -#include <heinz/Vectors3D.h> - -namespace GUI::Util::Variant { - -//! Returns type of variant (additionally checks for user type). -int VariantType(const QVariant& variant); - -//! Returns true if variants has compatible types. -bool CompatibleVariantTypes(const QVariant& oldValue, const QVariant& newValue); - -//! Returns true if given variants have same type and value. -//! For custom variants (e.g. ComboProperty) will always return false (see -//! explanations in cpp file). - -bool IsTheSame(const QVariant& var1, const QVariant& var2); - -} // namespace GUI::Util::Variant - -#endif // BORNAGAIN_GUI_MODEL_TYPE_VARIANTUTIL_H diff --git a/GUI/Support/Data/ComboProperty.cpp b/GUI/Support/Data/ComboProperty.cpp index 2056ce3ddd5b14754e0e2b9ff60d91c36c540ad5..45fcf3e24e3df460e9d6d80044b4fe46b8ef9d86 100644 --- a/GUI/Support/Data/ComboProperty.cpp +++ b/GUI/Support/Data/ComboProperty.cpp @@ -155,16 +155,6 @@ void ComboProperty::setStringOfValues(const QString& values) setCurrentIndex(m_values.contains(current) ? m_values.indexOf(current) : 0); } -QString ComboProperty::stringOfTooltips() const -{ - return m_tooltips.join(value_separator); -} - -void ComboProperty::setStringOfTooltips(const QString& tooltips) -{ - m_tooltips = tooltips.split(value_separator); -} - //! Constructs variant enclosing given ComboProperty. QVariant ComboProperty::variant() const diff --git a/GUI/Support/Data/ComboProperty.h b/GUI/Support/Data/ComboProperty.h index 84d26c0677387a97472524c0ee2515c967604be3..b0ec8ddbd187dee5867a0478bddb14642d0a9ce1 100644 --- a/GUI/Support/Data/ComboProperty.h +++ b/GUI/Support/Data/ComboProperty.h @@ -54,9 +54,6 @@ public: QString stringOfValues() const; void setStringOfValues(const QString& values); - QString stringOfTooltips() const; - void setStringOfTooltips(const QString& tooltips); - QVariant variant() const; QVector<int> selectedIndices() const; diff --git a/GUI/Support/Util/Path.cpp b/GUI/Support/Util/Path.cpp index 7a759cd4abd62021890c6ed449598f4e7177ba8e..87804c44f0ab0fc90f1880bbf12bed9ff7b41732 100644 --- a/GUI/Support/Util/Path.cpp +++ b/GUI/Support/Util/Path.cpp @@ -141,18 +141,3 @@ QString GUI::Path::appDataFolder() { return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); } - -QString GUI::Path::getPathFromIndex(const QModelIndex& index) -{ - if (!index.isValid()) - return ""; - - QStringList namePath; - QModelIndex cur = index; - while (cur.isValid()) { - namePath << cur.data().toString(); - cur = cur.parent(); - } - std::reverse(namePath.begin(), namePath.end()); - return namePath.join("/"); -} diff --git a/GUI/Support/Util/Path.h b/GUI/Support/Util/Path.h index 50684bf928513747b9feddaa213b4add3fb8f63c..0e79b20a2d81367d19d4380917c8c7b9a92a200d 100644 --- a/GUI/Support/Util/Path.h +++ b/GUI/Support/Util/Path.h @@ -42,8 +42,6 @@ bool isVersionMatchMinimal(const QString& version, const QString& minimal_versio //! Used e.g. for storing the instrument library. QString appDataFolder(); -QString getPathFromIndex(const QModelIndex& index); - } // namespace GUI::Path #endif // BORNAGAIN_GUI_SUPPORT_UTIL_PATH_H diff --git a/GUI/View/Device/AxisPropertyForm.cpp b/GUI/View/Device/AxisPropertyForm.cpp index 464951aedf8c3a9bf141c857d5cd60c3cf367c82..4b58b08e5986ccedaad31d22b819e93e0650ba84 100644 --- a/GUI/View/Device/AxisPropertyForm.cpp +++ b/GUI/View/Device/AxisPropertyForm.cpp @@ -63,11 +63,3 @@ AxisPropertyForm::AxisPropertyForm(QWidget* parent, const QString& groupTitle, } }); } - -void AxisPropertyForm::updateData() -{ - QSignalBlocker b(m_nbinsSpinBox); - m_nbinsSpinBox->setValue(m_axisProperty->nbins()); - m_minSpinBox->updateValue(); - m_maxSpinBox->updateValue(); -} diff --git a/GUI/View/Device/AxisPropertyForm.h b/GUI/View/Device/AxisPropertyForm.h index 393cf074345f875a6a7443827fd63e912ca3995c..73b9ea34e372f0e5875543d2cf053dcafab7ac98 100644 --- a/GUI/View/Device/AxisPropertyForm.h +++ b/GUI/View/Device/AxisPropertyForm.h @@ -32,9 +32,6 @@ public: AxisPropertyForm(QWidget* parent, const QString& groupTitle, AxisProperty* axisProperty, QString nbinsTooltip = ""); - //! Reload UI from data - void updateData(); - signals: void dataChanged(); diff --git a/GUI/View/Fit/FitActivityPanel.cpp b/GUI/View/Fit/FitActivityPanel.cpp index e55504b07a58cc1375414729bf7d765fe31f9b94..9e2dc5a3584db5b801c81b5f9fd78910e064585f 100644 --- a/GUI/View/Fit/FitActivityPanel.cpp +++ b/GUI/View/Fit/FitActivityPanel.cpp @@ -102,11 +102,6 @@ bool FitActivityPanel::isValidJobItem(JobItem* item) return item ? item->isValidForFitting() : false; } -FitSessionWidget* FitActivityPanel::currentFitSuiteWidget() -{ - return m_fitSessionWidget; -} - void FitActivityPanel::adjustWidthToRealTimeWidget(int w) { if (w != width()) { diff --git a/GUI/View/Fit/FitActivityPanel.h b/GUI/View/Fit/FitActivityPanel.h index ba977e004b97af43c98ea9ff91cb1b9eb7da6ff6..0c2e575dd28304a493c5d1e62e1666ae8158dbb8 100644 --- a/GUI/View/Fit/FitActivityPanel.h +++ b/GUI/View/Fit/FitActivityPanel.h @@ -47,7 +47,6 @@ signals: private: bool isValidJobItem(JobItem* item); - FitSessionWidget* currentFitSuiteWidget(); void adjustWidthToRealTimeWidget(int w); void applySettings(); diff --git a/GUI/View/Info/CautionSign.cpp b/GUI/View/Info/CautionSign.cpp index 6b459ba18895ec6e2c3edc22e318db76779f5574..323e26d6afda4985402040840d088a8679fddcbd 100644 --- a/GUI/View/Info/CautionSign.cpp +++ b/GUI/View/Info/CautionSign.cpp @@ -29,7 +29,6 @@ const int ypos_offset = 40; CautionSign::CautionSign(QWidget* parent) : QObject(parent) - , m_caution_header("Houston, we have a problem.") , m_cautionWidget(nullptr) , m_area(nullptr) , m_clear_just_had_happened(false) @@ -49,11 +48,6 @@ void CautionSign::clear() QTimer::singleShot(10, this, [this]() { m_clear_just_had_happened = false; }); } -void CautionSign::setCautionHeader(const QString& cautionHeader) -{ - m_caution_header = cautionHeader; -} - //! Shows caution sign on the screen. If clear of previous caution sign had happened just //! few msec ago, make a small delay, to stress its reapearance. @@ -83,11 +77,6 @@ void CautionSign::setArea(QWidget* area) m_area->installEventFilter(this); } -bool CautionSign::isShown() const -{ - return m_cautionWidget != nullptr; -} - bool CautionSign::eventFilter(QObject* obj, QEvent* event) { if (event->type() == QEvent::Resize) diff --git a/GUI/View/Info/CautionSign.h b/GUI/View/Info/CautionSign.h index 2fd3cd76a9a4e4baec3ec0bd110dc57c733a8af4..0442314053247855dda4691288024a223fe2f54c 100644 --- a/GUI/View/Info/CautionSign.h +++ b/GUI/View/Info/CautionSign.h @@ -29,14 +29,10 @@ public: void clear(); - void setCautionHeader(const QString& cautionHeader); - void setCautionMessage(const QString& cautionMessage); void setArea(QWidget* area); - bool isShown() const; - protected: bool eventFilter(QObject* obj, QEvent* event) override; @@ -44,7 +40,6 @@ private: void updateLabelGeometry(); QPoint positionForCautionSign() const; - QString m_caution_header; QString m_caution_message; CautionSignWidget* m_cautionWidget; QWidget* m_area; diff --git a/GUI/View/Info/MessageBox.cpp b/GUI/View/Info/MessageBox.cpp index bf84ea394ae7f087df1f1598087ff767a7270479..e1d3c98aa0010804f8fd8306fc8d19433b114142 100644 --- a/GUI/View/Info/MessageBox.cpp +++ b/GUI/View/Info/MessageBox.cpp @@ -65,21 +65,3 @@ bool GUI::Message::question(QWidget* parent, const QString& title, const QString messageBox->exec(); return messageBox->clickedButton() == yesButton; } - -bool GUI::Message::okToDelete(QWidget* parent, const QString& title, const QString& text, - const QString& detailedText) -{ - QScopedPointer<QMessageBox> messageBox(new QMessageBox(parent)); - if (parent) - messageBox->setWindowModality(Qt::WindowModal); - messageBox->setIcon(QMessageBox::Question); - messageBox->setWindowTitle(QString("%1 - %2").arg(QApplication::applicationName()).arg(title)); - messageBox->setText(text); - if (!detailedText.isEmpty()) - messageBox->setInformativeText(detailedText); - QAbstractButton* deleteButton = messageBox->addButton("&Delete", QMessageBox::AcceptRole); - messageBox->addButton("Do &Not Delete", QMessageBox::RejectRole); - messageBox->setDefaultButton(qobject_cast<QPushButton*>(deleteButton)); - messageBox->exec(); - return messageBox->clickedButton() == deleteButton; -} diff --git a/GUI/View/Info/MessageBox.h b/GUI/View/Info/MessageBox.h index 3254dae35a193d0c4533d946273ec3dafd27e4ad..75d71496bba2c8c0748a7619492a1383386b685c 100644 --- a/GUI/View/Info/MessageBox.h +++ b/GUI/View/Info/MessageBox.h @@ -29,9 +29,6 @@ bool question(QWidget* parent, const QString& title, const QString& text, const QString& detailedText = "", const QString& yesText = "&Yes", const QString& noText = "&No"); -bool okToDelete(QWidget* parent, const QString& title, const QString& text, - const QString& detailedText = ""); - } // namespace GUI::Message #endif // BORNAGAIN_GUI_VIEW_INFO_MESSAGEBOX_H diff --git a/GUI/View/Instrument/InstrumentLibraryEditor.cpp b/GUI/View/Instrument/InstrumentLibraryEditor.cpp index 3900c4ad5b6eac392a6c3ec3cd396941fd1b746b..4ab3a1cbeb42e06d70be77f24a6a292cb8fe307f 100644 --- a/GUI/View/Instrument/InstrumentLibraryEditor.cpp +++ b/GUI/View/Instrument/InstrumentLibraryEditor.cpp @@ -97,7 +97,7 @@ InstrumentLibraryEditor::InstrumentLibraryEditor(QWidget* parent, applySplitterPos(); // unfix m_treeView width only on manual resize - connect(splitter, &QSplitter::splitterMoved, [this, splitter] { + connect(splitter, &QSplitter::splitterMoved, [this] { m_treeView->setMinimumWidth(0); m_treeView->setMaximumWidth(QWIDGETSIZE_MAX); }); diff --git a/GUI/View/MaterialEditor/MaterialEditorDialog.cpp b/GUI/View/MaterialEditor/MaterialEditorDialog.cpp index c76c6d3eae798a610e8da39927756750f85e663a..8f683c32ef10bba00c493abf873bb72d9312b967 100644 --- a/GUI/View/MaterialEditor/MaterialEditorDialog.cpp +++ b/GUI/View/MaterialEditor/MaterialEditorDialog.cpp @@ -275,12 +275,6 @@ QString MaterialEditorDialog::chooseMaterial(QWidget* parent, SampleItem* sample return QString(); } -void MaterialEditorDialog::editMaterials(QWidget* parent, SampleItem* sample) -{ - MaterialEditorDialog dialog(sample, parent); - dialog.exec(); -} - void MaterialEditorDialog::addRefractiveMaterial() { setCurrentMaterial(m_model->addRefractiveMaterialItem("unnamed", 0.0, 0.0)); diff --git a/GUI/View/MaterialEditor/MaterialEditorDialog.h b/GUI/View/MaterialEditor/MaterialEditorDialog.h index 5e52d81ffe8b03dbb920097ca3a57f638ee6a5e9..a7126599684961c66e788a5649a62959e522d733 100644 --- a/GUI/View/MaterialEditor/MaterialEditorDialog.h +++ b/GUI/View/MaterialEditor/MaterialEditorDialog.h @@ -45,9 +45,6 @@ public: static QString chooseMaterial(QWidget* parent, SampleItem* sample, const QString& identifierOfPreviousMaterial); - //! Use this to edit the list of existing materials. - static void editMaterials(QWidget* parent, SampleItem* sample); - private: MaterialEditorDialog(SampleItem* sample, QWidget* parent = nullptr); ~MaterialEditorDialog() override; diff --git a/GUI/View/Numeric/ComboUtil.cpp b/GUI/View/Numeric/ComboUtil.cpp index be1109f98e8be405e0180e8795e715ef4f4c652a..4898a34781e7fa5c983df64b2dd9e6e0d0ddebe2 100644 --- a/GUI/View/Numeric/ComboUtil.cpp +++ b/GUI/View/Numeric/ComboUtil.cpp @@ -48,26 +48,3 @@ QComboBox* GUI::Util::createComboBox(function<ComboProperty()> comboFunction, return combo; } - -QComboBox* GUI::Util::createStringComboBox(const QStringList& list, function<QString()> current, - function<void(const QString&)> slot, bool inScrollArea, - QList<function<void()>>* updaters) -{ - QComboBox* combo = new QComboBox; - combo->addItems(list); - combo->setMaxCount(list.size()); - combo->setCurrentText(current()); - - if (inScrollArea) - WheelEventEater::install(combo); - - QObject::connect(combo, &QComboBox::currentTextChanged, [=] { slot(combo->currentText()); }); - - if (updaters) - (*updaters) << [=]() { - QSignalBlocker b(combo); - combo->setCurrentText(current()); - }; - - return combo; -} diff --git a/GUI/View/Numeric/ComboUtil.h b/GUI/View/Numeric/ComboUtil.h index beb9d414beb7914e78d419c52eac133a18bdd8e2..b7bbe81f14cd02a6de1e6203491725f17b3806dd 100644 --- a/GUI/View/Numeric/ComboUtil.h +++ b/GUI/View/Numeric/ComboUtil.h @@ -36,10 +36,6 @@ QComboBox* createComboBox(std::function<ComboProperty()> comboFunction, std::function<void(const QString&)> slot, bool inScrollArea, QList<std::function<void()>>* updaters = nullptr, QString tooltip = ""); -QComboBox* createStringComboBox(const QStringList& list, std::function<QString()> current, - std::function<void(const QString&)> slot, bool inScrollArea, - QList<std::function<void()>>* updaters = nullptr); - //! Create a combo box with the information found in a selection property. //! //! The combo will be filled with the available options and will get the found tooltip. diff --git a/GUI/View/Numeric/FixupDoubleValidator.cpp b/GUI/View/Numeric/FixupDoubleValidator.cpp index 88171f04eaf1da1626c1b17d9c7b2f423a36f7b1..eb0441b5b2b3763166037c971df74c42ec61e6dc 100644 --- a/GUI/View/Numeric/FixupDoubleValidator.cpp +++ b/GUI/View/Numeric/FixupDoubleValidator.cpp @@ -19,11 +19,6 @@ FixupDoubleValidator::FixupDoubleValidator(QObject* parent) { } -FixupDoubleValidator::FixupDoubleValidator(double bottom, double top, int decimals, QObject* parent) - : QDoubleValidator(bottom, top, decimals, parent) -{ -} - void FixupDoubleValidator::fixup(QString& /*input*/) const { emit fixupSignal(); diff --git a/GUI/View/Numeric/FixupDoubleValidator.h b/GUI/View/Numeric/FixupDoubleValidator.h index 688d7f1f290f02033775b38dc1359619feee7585..464a119248f837b4ff1ffe80b993097bfeaef832 100644 --- a/GUI/View/Numeric/FixupDoubleValidator.h +++ b/GUI/View/Numeric/FixupDoubleValidator.h @@ -25,7 +25,6 @@ class FixupDoubleValidator : public QDoubleValidator { Q_OBJECT public: explicit FixupDoubleValidator(QObject* parent = nullptr); - FixupDoubleValidator(double bottom, double top, int decimals, QObject* parent = nullptr); virtual void fixup(QString& input) const override; diff --git a/GUI/View/Numeric/ScientificSpinBox.cpp b/GUI/View/Numeric/ScientificSpinBox.cpp index f4caac704230f64ca1e933e8e4ca9dfe46d75567..a294e0ba20c169232d5f3bc97ebc9deab212af78 100644 --- a/GUI/View/Numeric/ScientificSpinBox.cpp +++ b/GUI/View/Numeric/ScientificSpinBox.cpp @@ -78,11 +78,6 @@ void ScientificSpinBox::setSingleStep(double step) m_step = step; } -double ScientificSpinBox::minimum() const -{ - return m_min; -} - void ScientificSpinBox::setMinimum(double min) { m_min = min; @@ -90,11 +85,6 @@ void ScientificSpinBox::setMinimum(double min) setValue(m_min); } -double ScientificSpinBox::maximum() const -{ - return m_max; -} - void ScientificSpinBox::setMaximum(double max) { m_max = max; @@ -110,11 +100,6 @@ void ScientificSpinBox::setDecimals(int val) setValue(m_value); } -int ScientificSpinBox::decimals() const -{ - return m_decimals; -} - void ScientificSpinBox::stepBy(int steps) { double new_val = round(m_value + m_step * steps, m_decimals); diff --git a/GUI/View/Numeric/ScientificSpinBox.h b/GUI/View/Numeric/ScientificSpinBox.h index 4bbbf89dff7f005d9c7646f2afdd9f254fbb90f4..1388447edf56d9dadef183ac43d3a13bca45b7b3 100644 --- a/GUI/View/Numeric/ScientificSpinBox.h +++ b/GUI/View/Numeric/ScientificSpinBox.h @@ -30,14 +30,10 @@ public: double singleStep() const; void setSingleStep(double step); - double minimum() const; void setMinimum(double min); - - double maximum() const; void setMaximum(double max); void setDecimals(int); - int decimals() const; void stepBy(int steps) override; QValidator::State validate(QString&, int&) const override { return QValidator::Acceptable; } diff --git a/GUI/View/Plotter/StatusLabel.cpp b/GUI/View/Plotter/StatusLabel.cpp index 41e2b72f692f36c013917cac95710b911d680f83..b5f6335214e94d6370c6ac30d2c3e74f4697c25a 100644 --- a/GUI/View/Plotter/StatusLabel.cpp +++ b/GUI/View/Plotter/StatusLabel.cpp @@ -46,24 +46,6 @@ void StatusLabel::setText(const QString& text) update(); } -void StatusLabel::setFont(const QFont& font) -{ - m_font = font; - update(); -} - -void StatusLabel::setPointSize(int pointSize) -{ - m_font.setPointSize(pointSize); - update(); -} - -void StatusLabel::setAlignment(Qt::Alignment alignment) -{ - m_alignment = alignment; - update(); -} - void StatusLabel::paintEvent(QPaintEvent* event) { QWidget::paintEvent(event); diff --git a/GUI/View/Plotter/StatusLabel.h b/GUI/View/Plotter/StatusLabel.h index 584cd0133c0528f67e8a66c124e43747397cf2e5..1d7e8f9dbfd97105f2d8bad8e38fd0174a40b163 100644 --- a/GUI/View/Plotter/StatusLabel.h +++ b/GUI/View/Plotter/StatusLabel.h @@ -30,9 +30,6 @@ public: explicit StatusLabel(QWidget* parent = nullptr); void setText(const QString& text); - void setFont(const QFont& font); - void setPointSize(int pointSize); - void setAlignment(Qt::Alignment); protected: void paintEvent(QPaintEvent* event) override; diff --git a/GUI/View/Sample/CompoundForm.cpp b/GUI/View/Sample/CompoundForm.cpp index 1c63bc049c17a45915a87eccf75ff6425f98f269..8bec549fdcfb618d980c4827a59807c575729d9c 100644 --- a/GUI/View/Sample/CompoundForm.cpp +++ b/GUI/View/Sample/CompoundForm.cpp @@ -71,15 +71,6 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compoundItem, SampleEd CompoundForm::~CompoundForm() = default; -void CompoundForm::enableStructureEditing(bool b) -{ - m_removeAction->setVisible(b); - m_duplicateAction->setVisible(b); - - for (auto* w : m_structureEditingWidgets) - w->setVisible(b); -} - CompoundItem* CompoundForm::compositionItem() const { return m_compositionItem; diff --git a/GUI/View/Sample/CompoundForm.h b/GUI/View/Sample/CompoundForm.h index 82ad1fc2facbc06f6de963b460fcc001d54ab7ef..bba78a3c8339c5b88ba02c2fce69ae6ebff16d54 100644 --- a/GUI/View/Sample/CompoundForm.h +++ b/GUI/View/Sample/CompoundForm.h @@ -30,7 +30,6 @@ public: bool allowRemove = true); ~CompoundForm(); - void enableStructureEditing(bool b); CompoundItem* compositionItem() const; void onParticleAdded(ItemWithParticles* item); void onAboutToRemoveParticle(ItemWithParticles* item); diff --git a/GUI/View/Sample/MesocrystalForm.cpp b/GUI/View/Sample/MesocrystalForm.cpp index 1693d5057b6dff8439fa90e0dd222f19399e24f8..8d010166850249db6ed57b1066c997439e3e3432 100644 --- a/GUI/View/Sample/MesocrystalForm.cpp +++ b/GUI/View/Sample/MesocrystalForm.cpp @@ -121,12 +121,6 @@ void MesocrystalForm::createBasisWidgets() false, m_ec, false)); } -void MesocrystalForm::enableStructureEditing(bool b) -{ - m_removeAction->setVisible(b); - m_duplicateAction->setVisible(b); -} - MesocrystalItem* MesocrystalForm::mesocrystalItem() const { return m_item; diff --git a/GUI/View/Sample/MesocrystalForm.h b/GUI/View/Sample/MesocrystalForm.h index b5d1933727a86662143ecf1baa6d51c8eebbc71f..729fef78e894a0452d9b52c553f05ed205434ee1 100644 --- a/GUI/View/Sample/MesocrystalForm.h +++ b/GUI/View/Sample/MesocrystalForm.h @@ -30,7 +30,6 @@ public: MesocrystalForm(QWidget* parent, MesocrystalItem* mesocrystalItem, SampleEditorController* ec, bool allowRemove = true); - void enableStructureEditing(bool b); MesocrystalItem* mesocrystalItem() const; void createBasisWidgets(); diff --git a/GUI/View/Sample/SampleEditorController.cpp b/GUI/View/Sample/SampleEditorController.cpp index 0ec7f2ba22f61b439fc5e7a1a1b0636ecde3c71a..fb7742d1a986ac87c5fd99a3ced00c048a958efa 100644 --- a/GUI/View/Sample/SampleEditorController.cpp +++ b/GUI/View/Sample/SampleEditorController.cpp @@ -48,11 +48,6 @@ void SampleEditorController::setSampleForm(SampleForm* view) m_sampleForm = view; } -SampleForm* SampleEditorController::sampleForm() const -{ - return m_sampleForm; -} - SampleItem* SampleEditorController::sampleItem() const { return m_sampleItem; diff --git a/GUI/View/Sample/SampleEditorController.h b/GUI/View/Sample/SampleEditorController.h index fce172f04dd7b5057e5967a485f0260d709e2719..50831f7fa7f04d91b2b067658e682b9d8356db2f 100644 --- a/GUI/View/Sample/SampleEditorController.h +++ b/GUI/View/Sample/SampleEditorController.h @@ -58,9 +58,6 @@ public: //! in the layer editor. Also nullptr is allowed. void setSampleForm(SampleForm* view); - //! The current form. - SampleForm* sampleForm() const; - //! The item on which this controller operates. SampleItem* sampleItem() const; diff --git a/GUI/View/Sample/SampleListModel.cpp b/GUI/View/Sample/SampleListModel.cpp index faf31faa5550ec2957d65002e7cc95de0824f47c..8f3f3356e8626fe40552cee27e62a97cdc0a8383 100644 --- a/GUI/View/Sample/SampleListModel.cpp +++ b/GUI/View/Sample/SampleListModel.cpp @@ -19,7 +19,6 @@ #include "GUI/Model/Sample/SampleItem.h" #include "GUI/Model/Sample/SampleModel.h" #include "GUI/Support/Util/String.h" -#include "GUI/View/Info/DetailedMessageBox.h" #include "GUI/View/Manager/PyImportAssistant.h" #include "Sample/Multilayer/MultiLayer.h" #include <QIcon> diff --git a/GUI/View/Sample/SampleView.cpp b/GUI/View/Sample/SampleView.cpp index 5b2bade5283a483ff098d85508b48616baa7fbf1..3d0c356da28c1b1b91e57ea29d82bfa983d629ec 100644 --- a/GUI/View/Sample/SampleView.cpp +++ b/GUI/View/Sample/SampleView.cpp @@ -81,11 +81,11 @@ SampleView::SampleView(QWidget* parent, ProjectDocument* document) applySplitterPos(); // unfix RealspacePanel size only on manual resize - connect(hSplitter, &QSplitter::splitterMoved, [this, hSplitter] { + connect(hSplitter, &QSplitter::splitterMoved, [this] { m_realspacePanel->setMinimumWidth(1); // somehow with min width >0 it behaves better m_realspacePanel->setMaximumWidth(QWIDGETSIZE_MAX); }); - connect(vSplitter, &QSplitter::splitterMoved, [this, hSplitter] { + connect(vSplitter, &QSplitter::splitterMoved, [this] { m_realspacePanel->setMinimumHeight(0); m_realspacePanel->setMaximumHeight(QWIDGETSIZE_MAX); }); diff --git a/GUI/View/Tool/ItemDelegateForHTML.cpp b/GUI/View/Tool/ItemDelegateForHTML.cpp index 11d96ed799f5f8df4a2ca2887c3d958a32d3742b..32e65749969961cbcf7414da8cae172cc76e7581 100644 --- a/GUI/View/Tool/ItemDelegateForHTML.cpp +++ b/GUI/View/Tool/ItemDelegateForHTML.cpp @@ -101,19 +101,3 @@ QSize ItemDelegateForHTML::sizeHint(const QStyleOptionViewItem& option, return s; } - -QString ItemDelegateForHTML::anchorAtGlobalPos(QAbstractItemView* view, const QModelIndex& index, - const QPoint& globalPos) const -{ - QString text = index.model()->data(index, Qt::DisplayRole).toString(); - - QTextDocument doc; - doc.setHtml(text); - - QRect r = view->visualRect(index); - QPoint P = view->viewport()->mapFromGlobal(globalPos); - QPoint P2 = P - r.topLeft(); - - QAbstractTextDocumentLayout::PaintContext ctx; - return doc.documentLayout()->anchorAt(P2); -} diff --git a/GUI/View/Tool/ItemDelegateForHTML.h b/GUI/View/Tool/ItemDelegateForHTML.h index ebbbbe095c50320db510cb42b15af2a95cdedbf3..3e6fdbec1988901360c54c229e720e3d24c42cb2 100644 --- a/GUI/View/Tool/ItemDelegateForHTML.h +++ b/GUI/View/Tool/ItemDelegateForHTML.h @@ -23,9 +23,6 @@ class ItemDelegateForHTML : public QStyledItemDelegate { public: ItemDelegateForHTML(QObject* parent); - QString anchorAtGlobalPos(QAbstractItemView* view, const QModelIndex& index, - const QPoint& globalPos) const; - protected: void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; diff --git a/GUI/View/Tool/LayoutUtil.cpp b/GUI/View/Tool/LayoutUtil.cpp index 33446fe1e9a0d24557f56c4754ac9a42aeb147d8..98112a3b5d1c7d8d2409ae70923e9b875efe80d2 100644 --- a/GUI/View/Tool/LayoutUtil.cpp +++ b/GUI/View/Tool/LayoutUtil.cpp @@ -115,10 +115,3 @@ void GUI::Util::Layout::clearGridLayout(QGridLayout* layout, bool deleteWidgets) for (int i_row = 0; i_row < layout->rowCount(); ++i_row) GUI::Util::Layout::removeRow(layout, i_row, deleteWidgets); } - -QWidget* GUI::Util::Layout::placeHolder() -{ - auto* result = new QWidget; - result->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - return result; -} diff --git a/GUI/View/Tool/LayoutUtil.h b/GUI/View/Tool/LayoutUtil.h index 2cc935f0aded2b7e3600734a0e2b70f9aa0d295d..7d070b682557667dfef5fe869976a1b15612c4bc 100644 --- a/GUI/View/Tool/LayoutUtil.h +++ b/GUI/View/Tool/LayoutUtil.h @@ -27,6 +27,8 @@ namespace GUI::Util::Layout { //! Removes content from box layout. void clearLayout(QLayout* layout, bool deleteWidgets = true); +//... Currently unused: + //! Removes row from grid layout (important: doesn't change row count). void removeRow(QGridLayout* layout, int row, bool deleteWidgets = true); @@ -36,9 +38,6 @@ void removeColumn(QGridLayout* layout, int column, bool deleteWidgets = true); //! Clear layout completely. void clearGridLayout(QGridLayout* layout, bool deleteWidgets = true); -//! Returns empty widget to occupy place in layout. -QWidget* placeHolder(); - } // namespace GUI::Util::Layout #endif // BORNAGAIN_GUI_VIEW_TOOL_LAYOUTUTIL_H diff --git a/GUI/View/Tuning/JobRealTimeWidget.cpp b/GUI/View/Tuning/JobRealTimeWidget.cpp index 32560fd83101ec99d61b852784bc03683ea11350..542911374a7de7a40e4e187a96e64b5edb981c37 100644 --- a/GUI/View/Tuning/JobRealTimeWidget.cpp +++ b/GUI/View/Tuning/JobRealTimeWidget.cpp @@ -21,13 +21,6 @@ #include <QSettings> #include <QVBoxLayout> -namespace { - -const bool reuse_widget = true; - -} - - JobRealTimeWidget::JobRealTimeWidget(JobModel* jobModel, QWidget* parent) : QWidget(parent) , m_stackedWidget(new ParameterTuningStackPresenter()) diff --git a/GUI/View/Widget/ApplicationSettings.cpp b/GUI/View/Widget/ApplicationSettings.cpp index 2c6040722b95bd3b6c5beb537ead3492b46accac..23b172093576d726ce96140486e8df2e627419db 100644 --- a/GUI/View/Widget/ApplicationSettings.cpp +++ b/GUI/View/Widget/ApplicationSettings.cpp @@ -17,7 +17,6 @@ #include <QApplication> #include <QFile> #include <QSettings> -#include <QStandardPaths> #include <QStyle> namespace { @@ -27,7 +26,6 @@ const QString S_STYLE = "UiStyle"; const QString S_SIZE = "Size"; const QString S_POS = "Pos"; const QString S_SINGLE_SAMPLE_MODE = "SingleSampleMode"; -const QString S_DEFAULT_UNIT_IS_ANGSTROM = "DefaultUnitIsAngstrom"; } // namespace @@ -68,16 +66,6 @@ void ApplicationSettings::setStyleToUse(Style style) QSettings().setValue(S_STYLE, static_cast<int>(style)); } -bool ApplicationSettings::defaultUnitIsAngstrom() const -{ - return QSettings().value(S_DEFAULT_UNIT_IS_ANGSTROM, false).toBool(); -} - -void ApplicationSettings::setDefaultUnitIsAngstrom(bool b) const -{ - QSettings().setValue(S_DEFAULT_UNIT_IS_ANGSTROM, b); -} - void ApplicationSettings::saveWindowSizeAndPos(const QWidget* w) { ASSERT(!w->objectName().isEmpty()); diff --git a/GUI/View/Widget/ApplicationSettings.h b/GUI/View/Widget/ApplicationSettings.h index 244984e78bf8e183c7bcbecb57bbb547e54a5fbd..923af34de341d0390569373ddd9f1229f3a1aab5 100644 --- a/GUI/View/Widget/ApplicationSettings.h +++ b/GUI/View/Widget/ApplicationSettings.h @@ -15,9 +15,6 @@ #ifndef BORNAGAIN_GUI_VIEW_WIDGET_APPLICATIONSETTINGS_H #define BORNAGAIN_GUI_VIEW_WIDGET_APPLICATIONSETTINGS_H -#include <QColor> -#include <QPalette> -#include <QVariant> #include <QWidget> //! Application wide settings. @@ -36,9 +33,6 @@ public: Style styleToUse() const; void setStyleToUse(Style style); - bool defaultUnitIsAngstrom() const; - void setDefaultUnitIsAngstrom(bool b) const; - void saveWindowSizeAndPos(const QWidget* w); void loadWindowSizeAndPos(QWidget* w); diff --git a/Param/Distrib/Distributions.cpp b/Param/Distrib/Distributions.cpp index 8a362250d95eb2452703f9a2f5076918b5c104c9..5588f4904f33f1ee67785963b5060eec7be030ae 100644 --- a/Param/Distrib/Distributions.cpp +++ b/Param/Distrib/Distributions.cpp @@ -83,24 +83,6 @@ std::vector<ParameterSample> IDistribution1D::samplesInRange(double xmin, double return result; } -std::vector<ParameterSample> -IDistribution1D::generateSamplesFromValues(const std::vector<double>& sample_values) const -{ - std::vector<ParameterSample> result; - double norm_factor = 0.0; - for (double value : sample_values) { - double pdf = probabilityDensity(value); - result.push_back({value, pdf}); - norm_factor += pdf; - } - if (norm_factor <= 0.0) - throw std::runtime_error("IDistribution1D::generateSamples: " - "total probability must be bigger than zero"); - for (ParameterSample& sample : result) - sample.weight /= norm_factor; - return result; -} - std::vector<std::pair<double, double>> IDistribution1D::plotGraph() const { size_t N = 400; diff --git a/Param/Distrib/Distributions.h b/Param/Distrib/Distributions.h index 7da8008f2a7c5ed087e1a702ea8fcc0f9e3cf9fa..228e46292301f4cda7237fbb4e2923fc0f3d0cb6 100644 --- a/Param/Distrib/Distributions.h +++ b/Param/Distrib/Distributions.h @@ -71,10 +71,6 @@ private: //! Returns a range that is suitable for plotting the pdf. virtual std::pair<double, double> plotRange() const; - //! Returns weighted samples from given interpolation points and probabilityDensity(). - std::vector<ParameterSample> - generateSamplesFromValues(const std::vector<double>& sample_values) const; - double m_relative_sampling_width; #endif // SWIG }; diff --git a/Param/Distrib/ParameterDistribution.cpp b/Param/Distrib/ParameterDistribution.cpp index bbc09f7937eecb52e7ed3260305ecdc6eaaf6475..945ad9cb977d3b7c69fbde548e7727cb2356989c 100644 --- a/Param/Distrib/ParameterDistribution.cpp +++ b/Param/Distrib/ParameterDistribution.cpp @@ -32,15 +32,6 @@ ParameterDistribution::ParameterDistribution(const ParameterDistribution& other) ParameterDistribution::~ParameterDistribution() = default; -ParameterDistribution& ParameterDistribution::operator=(const ParameterDistribution& other) -{ - if (this != &other) { - this->m_whichParameter = other.m_whichParameter; - m_distribution.reset(other.m_distribution->clone()); - } - return *this; -} - std::string ParameterDistribution::whichParameterAsPyEnum() const { switch (whichParameter()) { diff --git a/Param/Distrib/ParameterDistribution.h b/Param/Distrib/ParameterDistribution.h index 5adf83f9e27e67207781125d284217480d611da3..66e3eb4552add23a1342e7fe3721ebe32edfc842 100644 --- a/Param/Distrib/ParameterDistribution.h +++ b/Param/Distrib/ParameterDistribution.h @@ -35,7 +35,6 @@ public: ParameterDistribution(WhichParameter whichParameter, const IDistribution1D& distribution); ParameterDistribution(const ParameterDistribution& other); - ParameterDistribution& operator=(const ParameterDistribution& other); virtual ~ParameterDistribution(); diff --git a/Resample/Particle/ReParticle.cpp b/Resample/Particle/ReParticle.cpp index 968df1f3b577e23933f81b22ebcb55787706dd3d..3f698b31e179b9e998f36c9d4e273ae10db47013 100644 --- a/Resample/Particle/ReParticle.cpp +++ b/Resample/Particle/ReParticle.cpp @@ -69,16 +69,6 @@ double ReParticle::radialExtension() const return m_ff->radialExtension(); } -const IFormFactor* ReParticle::iformfactor() const -{ - return m_ff.get(); -} - -complex_t ReParticle::formfactor(C3 q) const -{ - return m_ff->formfactor(q); -} - complex_t ReParticle::theFF(const WavevectorInfo& wavevectors) const { WavevectorInfo wavevectors2 = diff --git a/Resample/Particle/ReParticle.h b/Resample/Particle/ReParticle.h index 6e529e3b5f72ee93ca2dce5ec548202e27317af8..de97a3ccd364854336def80744cf19dfee0d6b40 100644 --- a/Resample/Particle/ReParticle.h +++ b/Resample/Particle/ReParticle.h @@ -50,10 +50,6 @@ public: Span zSpan() const override; - const IFormFactor* iformfactor() const; - - virtual complex_t formfactor(C3 q) const; - private: const std::unique_ptr<const IFormFactor> m_ff; std::unique_ptr<const Material> m_material; diff --git a/Sample/HardParticle/IFormFactorPrism.cpp b/Sample/HardParticle/IFormFactorPrism.cpp index 4170fe7a1c180b3b1582a586f4d3503fd86ec20d..e28b59c3ad23277bf8802b8f17cd9bf5f40bb648 100644 --- a/Sample/HardParticle/IFormFactorPrism.cpp +++ b/Sample/HardParticle/IFormFactorPrism.cpp @@ -23,9 +23,3 @@ IFormFactorPrism::IFormFactorPrism(const std::vector<double>& PValues) } IFormFactorPrism::~IFormFactorPrism() = default; - -void IFormFactorPrism::setPrism(bool symmetry_Ci, const std::vector<R3>& base_vertices) const -{ - pimpl = - std::make_unique<ff::Prism>(symmetry_Ci, height(), base_vertices, R3(0, 0, height() / 2)); -} diff --git a/Sample/HardParticle/IFormFactorPrism.h b/Sample/HardParticle/IFormFactorPrism.h index d2ad5b3d7e8f8cced8521601d6d60c6fc8604aeb..8f0f09fef4a704386fd99dac4b3be5c049dd7b36 100644 --- a/Sample/HardParticle/IFormFactorPrism.h +++ b/Sample/HardParticle/IFormFactorPrism.h @@ -26,9 +26,6 @@ public: virtual double height() const = 0; -protected: - void setPrism(bool symmetry_Ci, const std::vector<R3>& base_vertices) const; - // Each child must have a parameter m_height. We would like to move it here, // but this seems incompatible with the current initialization of m_P and // with the order of child constructor arguments, especially Box(l, w, h). diff --git a/Sim/Scan/PhysicalScan.cpp b/Sim/Scan/PhysicalScan.cpp index f330e9e974b260791759ba3ba4abb93d0007261c..c1990712dc31006eabc457cbca736af76df2e22b 100644 --- a/Sim/Scan/PhysicalScan.cpp +++ b/Sim/Scan/PhysicalScan.cpp @@ -75,14 +75,6 @@ void PhysicalScan::setWavelengthDistribution(const IDistribution1D& distr) m_lambda_distrib.reset(distr.clone()); } -double PhysicalScan::inclination() const -{ - if (!isCommonWavelength()) - throw std::runtime_error("Inclination angle changes during scan. " - "Use 'angleAt(i)' instead."); - return m_beams.front()->alpha_i(); -} - double PhysicalScan::inclinationAt(size_t i) const { return m_beams[i]->alpha_i(); @@ -119,12 +111,3 @@ bool PhysicalScan::isCommonWavelength() const return false; return true; } - -bool PhysicalScan::isCommonInclination() const -{ - const auto ref = m_beams.front()->alpha_i(); - for (const auto& b : m_beams) - if (!Numeric::almostEqual(b->alpha_i(), ref, 1)) - return false; - return true; -} diff --git a/Sim/Scan/PhysicalScan.h b/Sim/Scan/PhysicalScan.h index 8222b8add2f58c01dc0f6954c523bd4d2d92bcd6..bf883262ef32701cc6a3c86448a573113ea31b75 100644 --- a/Sim/Scan/PhysicalScan.h +++ b/Sim/Scan/PhysicalScan.h @@ -45,7 +45,6 @@ public: double wavelength() const; double wavelengthAt(size_t i) const; - double inclination() const; double inclinationAt(size_t i) const; // needed for export @@ -67,7 +66,6 @@ protected: private: bool isCommonWavelength() const; - bool isCommonInclination() const; #endif // SWIG }; diff --git a/Tests/Functional/Mumufit/PlanCases.cpp b/Tests/Functional/Mumufit/PlanCases.cpp index b4c9431fefcd6d6f3f5eaaf601a59d6b41600023..743f7f0ab5903fd092379d95c08e0b90b050e906 100644 --- a/Tests/Functional/Mumufit/PlanCases.cpp +++ b/Tests/Functional/Mumufit/PlanCases.cpp @@ -85,11 +85,3 @@ DecayingSinPlanV2::DecayingSinPlanV2() addParameter(Parameter("decay", 0.05, AttLimits::fixed()), 0.05); finalizeParameters(); } - -TestMinimizerPlan::TestMinimizerPlan() - : ScalarTestPlan("TestMinimizerPlan", TestFunctions::RosenBrock, 0.0) -{ - // starting values of fit parameters are already correct - addParameter(Parameter("par0", 1.0, AttLimits::limited(-5.0, 5.0), 0.01), 1.0); - addParameter(Parameter("par1", 1.0, AttLimits::limited(-5.0, 5.0), 0.01), 1.0); -} diff --git a/Tests/Functional/Mumufit/PlanCases.h b/Tests/Functional/Mumufit/PlanCases.h index 20aa21a01818356234465a0aee3392492b4bfa66..76b7168f0a2026993b91b245383539b851ef89dc 100644 --- a/Tests/Functional/Mumufit/PlanCases.h +++ b/Tests/Functional/Mumufit/PlanCases.h @@ -63,11 +63,4 @@ public: DecayingSinPlanV2(); }; -//! Special plan to test TestMinimizer. - -class TestMinimizerPlan : public ScalarTestPlan { -public: - TestMinimizerPlan(); -}; - #endif // BORNAGAIN_TESTS_FUNCTIONAL_MUMUFIT_PLANCASES_H diff --git a/auto/Wrap/libBornAgainFit.py b/auto/Wrap/libBornAgainFit.py index 0a6d5ebba1744e60873ca4e2a07f7d784e63e509..5f715e3e8aa7a7eae0d5c0eee2c7330a07a239d8 100644 --- a/auto/Wrap/libBornAgainFit.py +++ b/auto/Wrap/libBornAgainFit.py @@ -1760,10 +1760,6 @@ class RealLimits(object): r"""toString(RealLimits self) -> std::string""" return _libBornAgainFit.RealLimits_toString(self) - def check(self, name, value): - r"""check(RealLimits self, std::string const & name, double value)""" - return _libBornAgainFit.RealLimits_check(self, name, value) - def __eq__(self, other): r"""__eq__(RealLimits self, RealLimits other) -> bool""" return _libBornAgainFit.RealLimits___eq__(self, other) diff --git a/auto/Wrap/libBornAgainFit_wrap.cpp b/auto/Wrap/libBornAgainFit_wrap.cpp index a35897bbf2216091f00434a780a8543736a112d2..5d222c343507c64eb7bb047be0ca1395dc0dcd31 100644 --- a/auto/Wrap/libBornAgainFit_wrap.cpp +++ b/auto/Wrap/libBornAgainFit_wrap.cpp @@ -24878,60 +24878,6 @@ fail: } -SWIGINTERN PyObject *_wrap_RealLimits_check(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - RealLimits *arg1 = (RealLimits *) 0 ; - std::string *arg2 = 0 ; - double arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - double val3 ; - int ecode3 = 0 ; - PyObject *swig_obj[3] ; - - if (!SWIG_Python_UnpackTuple(args, "RealLimits_check", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RealLimits, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RealLimits_check" "', argument " "1"" of type '" "RealLimits const *""'"); - } - arg1 = reinterpret_cast< RealLimits * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RealLimits_check" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RealLimits_check" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RealLimits_check" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - { - try { - ((RealLimits const *)arg1)->check((std::string const &)*arg2,arg3); - } catch (const std::exception& ex) { - // message shown in the Python interpreter - const std::string msg { - "BornAgain C++ Exception: " + std::string(ex.what()) - }; - SWIG_exception(SWIG_RuntimeError, msg.c_str()); - } - } - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - SWIGINTERN PyObject *_wrap_RealLimits___eq__(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RealLimits *arg1 = (RealLimits *) 0 ; @@ -30042,7 +29988,6 @@ static PyMethodDef SwigMethods[] = { { "RealLimits_limited", _wrap_RealLimits_limited, METH_VARARGS, "RealLimits_limited(double left_bound_value, double right_bound_value) -> RealLimits"}, { "RealLimits_limitless", _wrap_RealLimits_limitless, METH_NOARGS, "RealLimits_limitless() -> RealLimits"}, { "RealLimits_toString", _wrap_RealLimits_toString, METH_O, "RealLimits_toString(RealLimits self) -> std::string"}, - { "RealLimits_check", _wrap_RealLimits_check, METH_VARARGS, "RealLimits_check(RealLimits self, std::string const & name, double value)"}, { "RealLimits___eq__", _wrap_RealLimits___eq__, METH_VARARGS, "RealLimits___eq__(RealLimits self, RealLimits other) -> bool"}, { "RealLimits___ne__", _wrap_RealLimits___ne__, METH_VARARGS, "RealLimits___ne__(RealLimits self, RealLimits other) -> bool"}, { "RealLimits_isLimitless", _wrap_RealLimits_isLimitless, METH_O, "RealLimits_isLimitless(RealLimits self) -> bool"},