diff --git a/Base/Py/PyFmt.cpp b/Base/Py/PyFmt.cpp index 266f120c0c10d6f1eb5dab9b34507c785792c09d..6b0e32bd75f63dc5ed89a65c0347f91f1712c444 100644 --- a/Base/Py/PyFmt.cpp +++ b/Base/Py/PyFmt.cpp @@ -185,16 +185,6 @@ std::string Py::Fmt::printFunction(const std::string& name, double value1, const return printFunction(name, {{value1, unit1}, {value2, unit2}}); } -bool Py::Fmt::isSquare(double length1, double length2, double angle) -{ - return length1 == length2 && Numeric::almostEqual(angle, (pi / 2), 2); -} - -bool Py::Fmt::isHexagonal(double length1, double length2, double angle) -{ - return length1 == length2 && Numeric::almostEqual(angle, (2 * pi) / 3.0, 2); -} - std::string Py::Fmt::printKvector(const R3 value) { std::ostringstream result; diff --git a/Base/Py/PyFmt.h b/Base/Py/PyFmt.h index 7072572f5550f4aa431eb7c5af4a1fb9a0a97f78..3df52c7aeffe48a434bf929e225066c014db14a5 100644 --- a/Base/Py/PyFmt.h +++ b/Base/Py/PyFmt.h @@ -62,8 +62,6 @@ std::string printFunction(const std::string& name, double value, const std::stri std::string printFunction(const std::string& name, double value1, const std::string& unit1, double value2, const std::string& unit2); -bool isSquare(double length1, double length2, double angle); -bool isHexagonal(double length1, double length2, double angle); std::string printKvector(R3 value); //! Returns a string of blanks with given width. By default diff --git a/GUI/Model/Device/InstrumentNotifier.cpp b/GUI/Model/Device/InstrumentNotifier.cpp index 95051b9bb88a8ef352916e2631bf15e323184a05..3e093130f99bf526d5b386622c429cebdbfe98b0 100644 --- a/GUI/Model/Device/InstrumentNotifier.cpp +++ b/GUI/Model/Device/InstrumentNotifier.cpp @@ -25,11 +25,6 @@ InstrumentNotifier::InstrumentNotifier(MultiInstrumentNotifier* ec, InstrumentIt { } -void InstrumentNotifier::setInstrumentName(const QString& name) -{ - m_ec->setInstrumentName(m_instrumentItem, name); -} - 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 913f355c818e35693bc2fc14bc76d334bf59bc0b..096ddaa87929d3c73050063e4d4307a3de634bbd 100644 --- a/GUI/Model/Device/InstrumentNotifier.h +++ b/GUI/Model/Device/InstrumentNotifier.h @@ -35,11 +35,6 @@ class InstrumentNotifier : public QObject { public: InstrumentNotifier(MultiInstrumentNotifier* ec, InstrumentItem* instrument); - //! Set the instrument name and emit the respective signal. - //! - //! The signal is emitted by the parent MultiInstrumentNotifier. - void setInstrumentName(const QString& name); - //! Update dependent data and emit a changed signal void notifyWavelengthDistributionChanged(); diff --git a/GUI/View/Canvas/SpecularDataCanvas.cpp b/GUI/View/Canvas/SpecularDataCanvas.cpp index 5893228f0d407153a037e9260565756644913d97..c2fc0a94a8e79bab8e6d21213b4a491b9af945c7 100644 --- a/GUI/View/Canvas/SpecularDataCanvas.cpp +++ b/GUI/View/Canvas/SpecularDataCanvas.cpp @@ -73,11 +73,6 @@ QList<QAction*> SpecularDataCanvas::actionList() return QList<QAction*>() << m_reset_view_action << m_save_plot_action; } -QCustomPlot* SpecularDataCanvas::customPlot() -{ - return m_plot_canvas->customPlot(); -} - void SpecularDataCanvas::enableDeprecatedOnMousePress(bool b) { if (b) diff --git a/GUI/View/Canvas/SpecularDataCanvas.h b/GUI/View/Canvas/SpecularDataCanvas.h index ec790c832547f062ab8b0b0f263c546b09f1cb69..fcff4fddc639e00f567275b0efc9fe61c483e3d1 100644 --- a/GUI/View/Canvas/SpecularDataCanvas.h +++ b/GUI/View/Canvas/SpecularDataCanvas.h @@ -16,10 +16,8 @@ #define BORNAGAIN_GUI_VIEW_CANVAS_SPECULARDATACANVAS_H #include "GUI/View/Access/DataAccessWidget.h" -#include <QWidget> class Data1DItem; -class QCustomPlot; class SpecularPlotCanvas; class SpecularDataCanvas : public DataAccessWidget { @@ -33,7 +31,6 @@ public: QSize minimumSizeHint() const override; QList<QAction*> actionList() override; - QCustomPlot* customPlot(); //! Enable or disable the onMousePress() handler. //! For legacy reasons the onMousePress handler is enabled. diff --git a/GUI/View/Dock/DocksController.cpp b/GUI/View/Dock/DocksController.cpp index 8f771dee9b4824392890d8996ef360cec922b7e9..06a056bbd808992c1bc82b09fe756d78d46cd950 100644 --- a/GUI/View/Dock/DocksController.cpp +++ b/GUI/View/Dock/DocksController.cpp @@ -254,25 +254,6 @@ void DocksController::addDockActionsToMenu(QMenu* menu) } } -void DocksController::saveSettings(QSettings* settings) const -{ - QHash<QString, QVariant> hash = saveSettings(); - QHashIterator<QString, QVariant> it(hash); - while (it.hasNext()) { - it.next(); - settings->setValue(it.key(), it.value()); - } -} - -void DocksController::restoreSettings(const QSettings* settings) -{ - QHash<QString, QVariant> hash; - foreach (const QString& key, settings->childKeys()) { - hash.insert(key, settings->value(key)); - } - restoreSettings(hash); -} - QHash<QString, QVariant> DocksController::saveSettings() const { QHash<QString, QVariant> settings; diff --git a/GUI/View/Dock/DocksController.h b/GUI/View/Dock/DocksController.h index 12f639fb27c7652839b2ec6de60fd69804d92442..f9f6542d0b9999b06216cde57053b8db4cde1b6b 100644 --- a/GUI/View/Dock/DocksController.h +++ b/GUI/View/Dock/DocksController.h @@ -45,9 +45,7 @@ public: void addDockActionsToMenu(QMenu* menu); QHash<QString, QVariant> saveSettings() const; - void saveSettings(QSettings* settings) const; void restoreSettings(const QHash<QString, QVariant>& settings); - void restoreSettings(const QSettings* settings); public slots: void setDockHeightForWidget(int height); diff --git a/GUI/View/Info/DetailedMessageBox.cpp b/GUI/View/Info/DetailedMessageBox.cpp index 7123fe0070b9e80fef9d0e1fc02d09a6cfd5e404..854edbc3d3e68abf9742c300b1f4f4869fd7f8f1 100644 --- a/GUI/View/Info/DetailedMessageBox.cpp +++ b/GUI/View/Info/DetailedMessageBox.cpp @@ -60,19 +60,9 @@ DetailedMessageBox::DetailedMessageBox(QWidget* parent, const QString& title, co setSizeGripEnabled(true); } -void DetailedMessageBox::setText(const QString& text) -{ - m_topLabel->setText(text); -} - -void DetailedMessageBox::setDetailedText(const QString& text) -{ - m_textEdit->setText(text); -} - //! Returns layout with icon for left part of the widget. -QBoxLayout* DetailedMessageBox::createLogoLayout() +QBoxLayout* DetailedMessageBox::createLogoLayout() const { auto* result = new QVBoxLayout; result->setContentsMargins(5, 5, 5, 5); @@ -89,7 +79,7 @@ QBoxLayout* DetailedMessageBox::createLogoLayout() //! Creates right layout with text and QComboBox selection. -QBoxLayout* DetailedMessageBox::createInfoLayout() +QBoxLayout* DetailedMessageBox::createInfoLayout() const { m_topLabel->setWordWrap(true); @@ -101,7 +91,7 @@ QBoxLayout* DetailedMessageBox::createInfoLayout() //! Creates button layout with buttons. -QBoxLayout* DetailedMessageBox::createButtonLayout() +QBoxLayout* DetailedMessageBox::createButtonLayout() const { auto* result = new QHBoxLayout; diff --git a/GUI/View/Info/DetailedMessageBox.h b/GUI/View/Info/DetailedMessageBox.h index fefdf9719dadf6853efcbf742f3b92d7921c9f6c..611015e01962d80fecc769ce438d16209f56ebc9 100644 --- a/GUI/View/Info/DetailedMessageBox.h +++ b/GUI/View/Info/DetailedMessageBox.h @@ -30,13 +30,10 @@ public: DetailedMessageBox(QWidget* parent, const QString& title, const QString& text, const QString& details); - void setText(const QString& text); - void setDetailedText(const QString& text); - private: - QBoxLayout* createLogoLayout(); - QBoxLayout* createInfoLayout(); - QBoxLayout* createButtonLayout(); + QBoxLayout* createLogoLayout() const; + QBoxLayout* createInfoLayout() const; + QBoxLayout* createButtonLayout() const; QLabel* m_topLabel; QTextEdit* m_textEdit; diff --git a/GUI/View/Sample/LayerEditorUtil.cpp b/GUI/View/Sample/LayerEditorUtil.cpp index 3124c7891891d47abaa551057d8dab81c7f6db61..29a15a9fec316aa0b3fa11cba0ae14d994d817e5 100644 --- a/GUI/View/Sample/LayerEditorUtil.cpp +++ b/GUI/View/Sample/LayerEditorUtil.cpp @@ -27,24 +27,6 @@ #include "GUI/View/Sample/SampleEditorController.h" #include <QMenu> -using std::function; - -QString LayerEditorUtil::withUnit(QString text, const QString& unit) -{ - const bool hasColon = text.indexOf(":") > 0; - text = text.left(text.indexOf("[")); - text = text.trimmed(); - if (text.endsWith(":")) - text.chop(1); - - if (!unit.isEmpty()) - text += " (" + unit + ")"; - if (hasColon) - text += ":"; - - return text; -} - void LayerEditorUtil::addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol, const DoubleProperties& valueProperties, SampleEditorController* ec, bool vertically, @@ -58,10 +40,9 @@ void LayerEditorUtil::addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firs addSpacer); } -void LayerEditorUtil::addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol, - const DoubleProperties& valueProperties, - function<void(double, DoubleProperty&)> setNewValue, - bool vertically, bool addSpacer) +void LayerEditorUtil::addMultiPropertyToGrid( + QGridLayout* m_gridLayout, int firstCol, const DoubleProperties& valueProperties, + std::function<void(double, DoubleProperty&)> setNewValue, bool vertically, bool addSpacer) { int col = firstCol; for (auto* d : valueProperties) { diff --git a/GUI/View/Sample/LayerEditorUtil.h b/GUI/View/Sample/LayerEditorUtil.h index ae980a494ead28814d1883600a5faaeb9131e02a..98eb9327fd542fbe4bf060737294ce9cea5331c0 100644 --- a/GUI/View/Sample/LayerEditorUtil.h +++ b/GUI/View/Sample/LayerEditorUtil.h @@ -36,8 +36,6 @@ class VectorProperty; //! Utility functions to support layer oriented sample editor namespace LayerEditorUtil { -QString withUnit(QString text, const QString& unit); - //! Create DoubleSpinBoxes for the DoubleProperties and connect them to //! SampleEditorController::setDouble() void addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol, diff --git a/GUI/View/Tool/LayoutUtil.cpp b/GUI/View/Tool/LayoutUtil.cpp index 98112a3b5d1c7d8d2409ae70923e9b875efe80d2..641091f9349aea45b1301084e8cb56aa00ae60fe 100644 --- a/GUI/View/Tool/LayoutUtil.cpp +++ b/GUI/View/Tool/LayoutUtil.cpp @@ -109,9 +109,3 @@ void GUI::Util::Layout::removeColumn(QGridLayout* layout, int column, bool delet layout->setColumnMinimumWidth(column, 0); layout->setColumnStretch(column, 0); } - -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); -} diff --git a/GUI/View/Tool/LayoutUtil.h b/GUI/View/Tool/LayoutUtil.h index 7d070b682557667dfef5fe869976a1b15612c4bc..8a9bf7a4d0ac7d3014fa4349f43dbb6c4b81a3d9 100644 --- a/GUI/View/Tool/LayoutUtil.h +++ b/GUI/View/Tool/LayoutUtil.h @@ -35,9 +35,6 @@ void removeRow(QGridLayout* layout, int row, bool deleteWidgets = true); //! Removes column from grid layout. void removeColumn(QGridLayout* layout, int column, bool deleteWidgets = true); -//! Clear layout completely. -void clearGridLayout(QGridLayout* layout, bool deleteWidgets = true); - } // namespace GUI::Util::Layout #endif // BORNAGAIN_GUI_VIEW_TOOL_LAYOUTUTIL_H diff --git a/Img3D/Build/Particle3DContainer.cpp b/Img3D/Build/Particle3DContainer.cpp index ba9af02dcea9243da3543dce9ff0a4eb99e5e752..a1aa00b80ccd8ecf4c581125b68d9cbd47b51941 100644 --- a/Img3D/Build/Particle3DContainer.cpp +++ b/Img3D/Build/Particle3DContainer.cpp @@ -19,11 +19,6 @@ namespace Img3D { Particle3DContainer::~Particle3DContainer() = default; -void Particle3DContainer::clearContainer() -{ - m_containerParticles.clear(); -} - void Particle3DContainer::addParticle3D(Img3D::PlotParticle* particle3D) { m_containerParticles.emplace_back(particle3D); diff --git a/Img3D/Build/Particle3DContainer.h b/Img3D/Build/Particle3DContainer.h index 66f31c48db6b05e3ec8ca680c6ec624993fbc87a..0db8a457b1db9e733ae5fd64c281791c0a2e7e08 100644 --- a/Img3D/Build/Particle3DContainer.h +++ b/Img3D/Build/Particle3DContainer.h @@ -36,8 +36,6 @@ public: Particle3DContainer(Particle3DContainer&& other) = default; Particle3DContainer& operator=(Particle3DContainer&& rhs) = default; - void clearContainer(); - size_t containerSize() const { return m_containerParticles.size(); } double cumulativeAbundance() const { return m_cumulativeAbundance; } diff --git a/Img3D/Model/PlottableBody.cpp b/Img3D/Model/PlottableBody.cpp index 95b1f5e8e1d2aa94c06ffbe93967e8667df41126..6d058fc9d1727435886f9540c03a8d37f4ce5d0e 100644 --- a/Img3D/Model/PlottableBody.cpp +++ b/Img3D/Model/PlottableBody.cpp @@ -82,11 +82,6 @@ bool PlottableBody::isTransparent() const return color().alpha() < 255; } -void PlottableBody::transform(float scale, F3 rotate, F3 translate) -{ - transform(F3(scale, scale, scale), rotate, translate); -} - void PlottableBody::transform(F3 scale, F3 rotate, F3 translate) { m_matrix.setToIdentity(); diff --git a/Img3D/Model/PlottableBody.h b/Img3D/Model/PlottableBody.h index 8c4771262a68dc0859691dcf0ac6fc0551e1c94b..95c308bf37dea2de32564eb38e18d27daf730811 100644 --- a/Img3D/Model/PlottableBody.h +++ b/Img3D/Model/PlottableBody.h @@ -35,7 +35,6 @@ public: const QColor& color() const { return m_color; } bool isTransparent() const; - void transform(float scale, F3 rotate, F3 translate); void transform(F3 scale, F3 rotate, F3 translate); void transform(F3 scale, QQuaternion, F3 translate); void transform(F3 turn, F3 scale, F3 rotate, F3 translate); diff --git a/Img3D/Type/CameraParams.cpp b/Img3D/Type/CameraParams.cpp index 44cf392edd3ff70ce87f35871c8d31651d3d41f7..cd834cdeb93e9c8390def31365f6ef911382cdd0 100644 --- a/Img3D/Type/CameraParams.cpp +++ b/Img3D/Type/CameraParams.cpp @@ -14,29 +14,11 @@ #include "Img3D/Type/CameraParams.h" -namespace Img3D { - -namespace { - -F3 interpolateF3(const F3& from, const F3& to, float rat) -{ - return from * (1 - rat) + to * rat; -} - -} // namespace - -CameraParams::CameraParams(const F3& eye_, const F3& ctr_, const F3& up_, QQuaternion const& rot_) +Img3D::CameraParams::CameraParams(const F3& eye_, const F3& ctr_, const F3& up_, + QQuaternion const& rot_) : eye(eye_) , ctr(ctr_) , up(up_) , rot(rot_) { } - -CameraParams CameraParams::interpolateTo(const CameraParams& to, float r) const -{ - return {interpolateF3(eye, to.eye, r), interpolateF3(ctr, to.ctr, r), - interpolateF3(up, to.up, r), QQuaternion::slerp(rot, to.rot, r)}; -} - -} // namespace Img3D diff --git a/Img3D/Type/CameraParams.h b/Img3D/Type/CameraParams.h index 35c9c9937ab4adcbaad4469bb51833819a8bade0..d1e6ef4ed34219c4e4a580fc6e15c29ed1b041c6 100644 --- a/Img3D/Type/CameraParams.h +++ b/Img3D/Type/CameraParams.h @@ -28,8 +28,6 @@ struct CameraParams { F3 ctr; // center F3 up; QQuaternion rot; - - CameraParams interpolateTo(const CameraParams&, float) const; }; } // namespace Img3D diff --git a/Img3D/Type/FloatVector3D.cpp b/Img3D/Type/FloatVector3D.cpp index 96aa06314c76e997b9d91ebdeba056ecc0653b14..37a9fbac43a4fd28daf2a05ed2a8e10f12117659 100644 --- a/Img3D/Type/FloatVector3D.cpp +++ b/Img3D/Type/FloatVector3D.cpp @@ -62,9 +62,4 @@ F3 F3Range::mid() const return {x.mid(), y.mid(), z.mid()}; } -float F3Range::length() const -{ - return F3(x.size(), y.size(), z.size()).length(); -} - } // namespace Img3D diff --git a/Img3D/Type/FloatVector3D.h b/Img3D/Type/FloatVector3D.h index 0a6b7cf7ff2da6de1b6b4ad95db47b85b1aecbc4..06494a637b9d3a8924222b9ed85c6dcdd61eacec 100644 --- a/Img3D/Type/FloatVector3D.h +++ b/Img3D/Type/FloatVector3D.h @@ -47,8 +47,6 @@ struct F3Range { F3 size() const; F3 mid() const; - - float length() const; }; } // namespace Img3D diff --git a/Resample/Particle/IReParticle.cpp b/Resample/Particle/IReParticle.cpp index e0cc081821f6ce0e8e50c9e9b6cc5d12c59a227d..6d42fd12a6636864ad42304dc4d5095265eb7eb5 100644 --- a/Resample/Particle/IReParticle.cpp +++ b/Resample/Particle/IReParticle.cpp @@ -45,12 +45,6 @@ void IReParticle::setAdmixedMaterial(const Material& material) m_admixed_material = std::make_unique<Material>(material); } -double IReParticle::volume() const -{ - auto zero_wavevectors = WavevectorInfo::makeZeroQ(); - return std::abs(theFF(zero_wavevectors)); -} - complex_t IReParticle::coherentFF(const DiffuseElement& ele) const { const WavevectorInfo& wavevectors = ele.wavevectorInfo(); diff --git a/Resample/Particle/IReParticle.h b/Resample/Particle/IReParticle.h index 40ab3086651e1f81b5594fe95c791e4dcdb8a6b3..76b7c33b983f303ac870a6d1f23dc387bb775556 100644 --- a/Resample/Particle/IReParticle.h +++ b/Resample/Particle/IReParticle.h @@ -62,9 +62,6 @@ public: virtual Span zSpan() const = 0; - //! Returns the total volume of the particle of this form factor's shape - virtual double volume() const; - const std::optional<size_t>& i_layer() const { return m_i_layer; } size_t i_layer_or_0() const { return m_i_layer ? m_i_layer.value() : 0; } void setLayerIndex(size_t i) { m_i_layer = i; } diff --git a/Resample/Particle/ReMesocrystal.h b/Resample/Particle/ReMesocrystal.h index 82ddd034b864b2339a157a8eb8da73ec1823333a..943e423a4b56a259ce64e566a28cee4e9a25f4fd 100644 --- a/Resample/Particle/ReMesocrystal.h +++ b/Resample/Particle/ReMesocrystal.h @@ -39,7 +39,7 @@ public: m_basis->setAmbientMaterial(material); } - double volume() const override; + double volume() const; double radialExtension() const override; Span zSpan() const override; diff --git a/Resample/Particle/ReParticle.h b/Resample/Particle/ReParticle.h index de97a3ccd364854336def80744cf19dfee0d6b40..4155802e3e464099c74a90cec836ffaeb33156db 100644 --- a/Resample/Particle/ReParticle.h +++ b/Resample/Particle/ReParticle.h @@ -44,7 +44,7 @@ public: complex_t theFF(const WavevectorInfo& wavevectors) const override; SpinMatrix thePolFF(const WavevectorInfo& wavevectors) const override; - double volume() const override; + double volume() const; double radialExtension() const override;