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

[j.unused] rm unused, detected by xunused ()

Merging branch 'j.unused'  into 'main'.

See merge request !2256
parents 992aba8c 2c0765e9
Branches
Tags
1 merge request!2256rm unused, detected by xunused
Pipeline #124237 passed
Showing
with 11 additions and 138 deletions
...@@ -185,16 +185,6 @@ std::string Py::Fmt::printFunction(const std::string& name, double value1, const ...@@ -185,16 +185,6 @@ std::string Py::Fmt::printFunction(const std::string& name, double value1, const
return printFunction(name, {{value1, unit1}, {value2, unit2}}); 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::string Py::Fmt::printKvector(const R3 value)
{ {
std::ostringstream result; std::ostringstream result;
......
...@@ -62,8 +62,6 @@ std::string printFunction(const std::string& name, double value, const std::stri ...@@ -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, std::string printFunction(const std::string& name, double value1, const std::string& unit1,
double value2, const std::string& unit2); 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); std::string printKvector(R3 value);
//! Returns a string of blanks with given width. By default //! Returns a string of blanks with given width. By default
......
...@@ -25,11 +25,6 @@ InstrumentNotifier::InstrumentNotifier(MultiInstrumentNotifier* ec, InstrumentIt ...@@ -25,11 +25,6 @@ InstrumentNotifier::InstrumentNotifier(MultiInstrumentNotifier* ec, InstrumentIt
{ {
} }
void InstrumentNotifier::setInstrumentName(const QString& name)
{
m_ec->setInstrumentName(m_instrumentItem, name);
}
void InstrumentNotifier::notifyWavelengthDistributionChanged() void InstrumentNotifier::notifyWavelengthDistributionChanged()
{ {
// Update values in pointwise axis. This is necessary after a change of the mean wavelength. // Update values in pointwise axis. This is necessary after a change of the mean wavelength.
......
...@@ -35,11 +35,6 @@ class InstrumentNotifier : public QObject { ...@@ -35,11 +35,6 @@ class InstrumentNotifier : public QObject {
public: public:
InstrumentNotifier(MultiInstrumentNotifier* ec, InstrumentItem* instrument); 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 //! Update dependent data and emit a changed signal
void notifyWavelengthDistributionChanged(); void notifyWavelengthDistributionChanged();
......
...@@ -73,11 +73,6 @@ QList<QAction*> SpecularDataCanvas::actionList() ...@@ -73,11 +73,6 @@ QList<QAction*> SpecularDataCanvas::actionList()
return QList<QAction*>() << m_reset_view_action << m_save_plot_action; return QList<QAction*>() << m_reset_view_action << m_save_plot_action;
} }
QCustomPlot* SpecularDataCanvas::customPlot()
{
return m_plot_canvas->customPlot();
}
void SpecularDataCanvas::enableDeprecatedOnMousePress(bool b) void SpecularDataCanvas::enableDeprecatedOnMousePress(bool b)
{ {
if (b) if (b)
......
...@@ -16,10 +16,8 @@ ...@@ -16,10 +16,8 @@
#define BORNAGAIN_GUI_VIEW_CANVAS_SPECULARDATACANVAS_H #define BORNAGAIN_GUI_VIEW_CANVAS_SPECULARDATACANVAS_H
#include "GUI/View/Access/DataAccessWidget.h" #include "GUI/View/Access/DataAccessWidget.h"
#include <QWidget>
class Data1DItem; class Data1DItem;
class QCustomPlot;
class SpecularPlotCanvas; class SpecularPlotCanvas;
class SpecularDataCanvas : public DataAccessWidget { class SpecularDataCanvas : public DataAccessWidget {
...@@ -33,7 +31,6 @@ public: ...@@ -33,7 +31,6 @@ public:
QSize minimumSizeHint() const override; QSize minimumSizeHint() const override;
QList<QAction*> actionList() override; QList<QAction*> actionList() override;
QCustomPlot* customPlot();
//! Enable or disable the onMousePress() handler. //! Enable or disable the onMousePress() handler.
//! For legacy reasons the onMousePress handler is enabled. //! For legacy reasons the onMousePress handler is enabled.
......
...@@ -254,25 +254,6 @@ void DocksController::addDockActionsToMenu(QMenu* menu) ...@@ -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> DocksController::saveSettings() const
{ {
QHash<QString, QVariant> settings; QHash<QString, QVariant> settings;
......
...@@ -45,9 +45,7 @@ public: ...@@ -45,9 +45,7 @@ public:
void addDockActionsToMenu(QMenu* menu); void addDockActionsToMenu(QMenu* menu);
QHash<QString, QVariant> saveSettings() const; QHash<QString, QVariant> saveSettings() const;
void saveSettings(QSettings* settings) const;
void restoreSettings(const QHash<QString, QVariant>& settings); void restoreSettings(const QHash<QString, QVariant>& settings);
void restoreSettings(const QSettings* settings);
public slots: public slots:
void setDockHeightForWidget(int height); void setDockHeightForWidget(int height);
......
...@@ -60,19 +60,9 @@ DetailedMessageBox::DetailedMessageBox(QWidget* parent, const QString& title, co ...@@ -60,19 +60,9 @@ DetailedMessageBox::DetailedMessageBox(QWidget* parent, const QString& title, co
setSizeGripEnabled(true); 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. //! Returns layout with icon for left part of the widget.
QBoxLayout* DetailedMessageBox::createLogoLayout() QBoxLayout* DetailedMessageBox::createLogoLayout() const
{ {
auto* result = new QVBoxLayout; auto* result = new QVBoxLayout;
result->setContentsMargins(5, 5, 5, 5); result->setContentsMargins(5, 5, 5, 5);
...@@ -89,7 +79,7 @@ QBoxLayout* DetailedMessageBox::createLogoLayout() ...@@ -89,7 +79,7 @@ QBoxLayout* DetailedMessageBox::createLogoLayout()
//! Creates right layout with text and QComboBox selection. //! Creates right layout with text and QComboBox selection.
QBoxLayout* DetailedMessageBox::createInfoLayout() QBoxLayout* DetailedMessageBox::createInfoLayout() const
{ {
m_topLabel->setWordWrap(true); m_topLabel->setWordWrap(true);
...@@ -101,7 +91,7 @@ QBoxLayout* DetailedMessageBox::createInfoLayout() ...@@ -101,7 +91,7 @@ QBoxLayout* DetailedMessageBox::createInfoLayout()
//! Creates button layout with buttons. //! Creates button layout with buttons.
QBoxLayout* DetailedMessageBox::createButtonLayout() QBoxLayout* DetailedMessageBox::createButtonLayout() const
{ {
auto* result = new QHBoxLayout; auto* result = new QHBoxLayout;
......
...@@ -30,13 +30,10 @@ public: ...@@ -30,13 +30,10 @@ public:
DetailedMessageBox(QWidget* parent, const QString& title, const QString& text, DetailedMessageBox(QWidget* parent, const QString& title, const QString& text,
const QString& details); const QString& details);
void setText(const QString& text);
void setDetailedText(const QString& text);
private: private:
QBoxLayout* createLogoLayout(); QBoxLayout* createLogoLayout() const;
QBoxLayout* createInfoLayout(); QBoxLayout* createInfoLayout() const;
QBoxLayout* createButtonLayout(); QBoxLayout* createButtonLayout() const;
QLabel* m_topLabel; QLabel* m_topLabel;
QTextEdit* m_textEdit; QTextEdit* m_textEdit;
......
...@@ -27,24 +27,6 @@ ...@@ -27,24 +27,6 @@
#include "GUI/View/Sample/SampleEditorController.h" #include "GUI/View/Sample/SampleEditorController.h"
#include <QMenu> #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, void LayerEditorUtil::addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol,
const DoubleProperties& valueProperties, const DoubleProperties& valueProperties,
SampleEditorController* ec, bool vertically, SampleEditorController* ec, bool vertically,
...@@ -58,10 +40,9 @@ void LayerEditorUtil::addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firs ...@@ -58,10 +40,9 @@ void LayerEditorUtil::addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firs
addSpacer); addSpacer);
} }
void LayerEditorUtil::addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol, void LayerEditorUtil::addMultiPropertyToGrid(
const DoubleProperties& valueProperties, QGridLayout* m_gridLayout, int firstCol, const DoubleProperties& valueProperties,
function<void(double, DoubleProperty&)> setNewValue, std::function<void(double, DoubleProperty&)> setNewValue, bool vertically, bool addSpacer)
bool vertically, bool addSpacer)
{ {
int col = firstCol; int col = firstCol;
for (auto* d : valueProperties) { for (auto* d : valueProperties) {
......
...@@ -36,8 +36,6 @@ class VectorProperty; ...@@ -36,8 +36,6 @@ class VectorProperty;
//! Utility functions to support layer oriented sample editor //! Utility functions to support layer oriented sample editor
namespace LayerEditorUtil { namespace LayerEditorUtil {
QString withUnit(QString text, const QString& unit);
//! Create DoubleSpinBoxes for the DoubleProperties and connect them to //! Create DoubleSpinBoxes for the DoubleProperties and connect them to
//! SampleEditorController::setDouble() //! SampleEditorController::setDouble()
void addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol, void addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol,
......
...@@ -109,9 +109,3 @@ void GUI::Util::Layout::removeColumn(QGridLayout* layout, int column, bool delet ...@@ -109,9 +109,3 @@ void GUI::Util::Layout::removeColumn(QGridLayout* layout, int column, bool delet
layout->setColumnMinimumWidth(column, 0); layout->setColumnMinimumWidth(column, 0);
layout->setColumnStretch(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);
}
...@@ -35,9 +35,6 @@ void removeRow(QGridLayout* layout, int row, bool deleteWidgets = true); ...@@ -35,9 +35,6 @@ void removeRow(QGridLayout* layout, int row, bool deleteWidgets = true);
//! Removes column from grid layout. //! Removes column from grid layout.
void removeColumn(QGridLayout* layout, int column, bool deleteWidgets = true); void removeColumn(QGridLayout* layout, int column, bool deleteWidgets = true);
//! Clear layout completely.
void clearGridLayout(QGridLayout* layout, bool deleteWidgets = true);
} // namespace GUI::Util::Layout } // namespace GUI::Util::Layout
#endif // BORNAGAIN_GUI_VIEW_TOOL_LAYOUTUTIL_H #endif // BORNAGAIN_GUI_VIEW_TOOL_LAYOUTUTIL_H
...@@ -19,11 +19,6 @@ namespace Img3D { ...@@ -19,11 +19,6 @@ namespace Img3D {
Particle3DContainer::~Particle3DContainer() = default; Particle3DContainer::~Particle3DContainer() = default;
void Particle3DContainer::clearContainer()
{
m_containerParticles.clear();
}
void Particle3DContainer::addParticle3D(Img3D::PlotParticle* particle3D) void Particle3DContainer::addParticle3D(Img3D::PlotParticle* particle3D)
{ {
m_containerParticles.emplace_back(particle3D); m_containerParticles.emplace_back(particle3D);
......
...@@ -36,8 +36,6 @@ public: ...@@ -36,8 +36,6 @@ public:
Particle3DContainer(Particle3DContainer&& other) = default; Particle3DContainer(Particle3DContainer&& other) = default;
Particle3DContainer& operator=(Particle3DContainer&& rhs) = default; Particle3DContainer& operator=(Particle3DContainer&& rhs) = default;
void clearContainer();
size_t containerSize() const { return m_containerParticles.size(); } size_t containerSize() const { return m_containerParticles.size(); }
double cumulativeAbundance() const { return m_cumulativeAbundance; } double cumulativeAbundance() const { return m_cumulativeAbundance; }
......
...@@ -82,11 +82,6 @@ bool PlottableBody::isTransparent() const ...@@ -82,11 +82,6 @@ bool PlottableBody::isTransparent() const
return color().alpha() < 255; 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) void PlottableBody::transform(F3 scale, F3 rotate, F3 translate)
{ {
m_matrix.setToIdentity(); m_matrix.setToIdentity();
......
...@@ -35,7 +35,6 @@ public: ...@@ -35,7 +35,6 @@ public:
const QColor& color() const { return m_color; } const QColor& color() const { return m_color; }
bool isTransparent() const; bool isTransparent() const;
void transform(float scale, F3 rotate, F3 translate);
void transform(F3 scale, F3 rotate, F3 translate); void transform(F3 scale, F3 rotate, F3 translate);
void transform(F3 scale, QQuaternion, F3 translate); void transform(F3 scale, QQuaternion, F3 translate);
void transform(F3 turn, F3 scale, F3 rotate, F3 translate); void transform(F3 turn, F3 scale, F3 rotate, F3 translate);
......
...@@ -14,29 +14,11 @@ ...@@ -14,29 +14,11 @@
#include "Img3D/Type/CameraParams.h" #include "Img3D/Type/CameraParams.h"
namespace Img3D { Img3D::CameraParams::CameraParams(const F3& eye_, const F3& ctr_, const F3& up_,
QQuaternion const& rot_)
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_)
: eye(eye_) : eye(eye_)
, ctr(ctr_) , ctr(ctr_)
, up(up_) , up(up_)
, rot(rot_) , 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
...@@ -28,8 +28,6 @@ struct CameraParams { ...@@ -28,8 +28,6 @@ struct CameraParams {
F3 ctr; // center F3 ctr; // center
F3 up; F3 up;
QQuaternion rot; QQuaternion rot;
CameraParams interpolateTo(const CameraParams&, float) const;
}; };
} // namespace Img3D } // namespace Img3D
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment