From 4007850334e1e50ccac7e843e9b5347af8ff7b9b Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Tue, 4 Jul 2023 20:53:58 +0200
Subject: [PATCH] rm nameOfAxis

---
 Device/Coord/CoordSystem1D.cpp | 40 ----------------------------------
 Device/Coord/CoordSystem1D.h   |  6 -----
 Device/Coord/CoordSystem2D.cpp | 38 --------------------------------
 Device/Coord/CoordSystem2D.h   |  8 -------
 Device/Coord/ICoordSystem.h    |  2 --
 5 files changed, 94 deletions(-)

diff --git a/Device/Coord/CoordSystem1D.cpp b/Device/Coord/CoordSystem1D.cpp
index 272bf817624..6b54c65fe6c 100644
--- a/Device/Coord/CoordSystem1D.cpp
+++ b/Device/Coord/CoordSystem1D.cpp
@@ -23,24 +23,6 @@
 #include <stdexcept>
 using std::numbers::pi;
 
-namespace {
-
-/*
-double getQ(double wavelength, double angle)
-{
-    return 4.0 * pi * std::sin(angle) / wavelength;
-}
-
-  double getInvQ(double wavelength, double q)
-{
-    double sin_angle = q * wavelength / (4.0 * pi);
-    return std::asin(sin_angle);
-}
-*/
-
-} // namespace
-
-
 //  ************************************************************************************************
 //  class CoordSystem1D
 //  ************************************************************************************************
@@ -59,12 +41,6 @@ AngularReflectometryCoords::AngularReflectometryCoords(double wavelength, const
     : CoordSystem1D(axis.clone())
     , m_wavelength(wavelength)
 {
-    /*
-    if (m_axes[0]->min() < 0 || m_axes[0]->max() > (pi / 2)) {
-        std::cout << "DEBUG min=" << m_axes[0]->min() << " max=" << m_axes[0]->max() << std::endl;
-        throw std::runtime_error("Error in CoordSystem1D: input axis range is out of bounds");
-    }
-    */
 }
 
 AngularReflectometryCoords::AngularReflectometryCoords(const AngularReflectometryCoords& other)
@@ -80,17 +56,6 @@ AngularReflectometryCoords* AngularReflectometryCoords::clone() const
     return new AngularReflectometryCoords(*this);
 }
 
-std::string AngularReflectometryCoords::nameOfAxis(size_t i_axis) const
-{
-    ASSERT(i_axis == 0);
-    return nameOfAxis0();
-}
-
-std::string AngularReflectometryCoords::nameOfAxis0() // static
-{
-    return "alpha_i [deg]";
-}
-
 //  ************************************************************************************************
 //  class WavenumberReflectometryCoords
 //  ************************************************************************************************
@@ -112,8 +77,3 @@ WavenumberReflectometryCoords* WavenumberReflectometryCoords::clone() const
 {
     return new WavenumberReflectometryCoords(*this);
 }
-
-std::string WavenumberReflectometryCoords::nameOfAxis(size_t) const
-{
-    return "Q [1/nm]";
-}
diff --git a/Device/Coord/CoordSystem1D.h b/Device/Coord/CoordSystem1D.h
index ae8ca7b1f07..decf0bbce1e 100644
--- a/Device/Coord/CoordSystem1D.h
+++ b/Device/Coord/CoordSystem1D.h
@@ -42,11 +42,7 @@ public:
 
     AngularReflectometryCoords* clone() const override;
 
-    static std::string nameOfAxis0();
-
 private:
-    std::string nameOfAxis(size_t i_axis) const override;
-
     AngularReflectometryCoords(const AngularReflectometryCoords& other);
     double m_wavelength; //!< basic wavelength in nm (for translation to q-space).
 };
@@ -61,8 +57,6 @@ public:
     WavenumberReflectometryCoords* clone() const override;
 
 private:
-    std::string nameOfAxis(size_t i_axis) const override;
-
     WavenumberReflectometryCoords(const WavenumberReflectometryCoords& other);
 };
 
diff --git a/Device/Coord/CoordSystem2D.cpp b/Device/Coord/CoordSystem2D.cpp
index 94a51368621..185cf93a571 100644
--- a/Device/Coord/CoordSystem2D.cpp
+++ b/Device/Coord/CoordSystem2D.cpp
@@ -63,15 +63,6 @@ double SphericalCoords::calculateValue(size_t, double value) const
     return value;
 }
 
-std::string SphericalCoords::nameOfAxis(size_t i_axis) const
-{
-    if (i_axis == 0)
-        return "phi_f [deg]";
-    if (i_axis == 1)
-        return "alpha_f [deg]";
-    ASSERT(false);
-}
-
 //  ************************************************************************************************
 //  class ImageCoords
 //  ************************************************************************************************
@@ -104,15 +95,6 @@ double ImageCoords::calculateValue(size_t, double value) const
     return value;
 }
 
-std::string ImageCoords::nameOfAxis(size_t i_axis) const
-{
-    if (i_axis == 0)
-        return "X [mm]";
-    if (i_axis == 1)
-        return "Y [mm]";
-    ASSERT(false);
-}
-
 //  ************************************************************************************************
 //  class OffspecCoords
 //  ************************************************************************************************
@@ -134,17 +116,6 @@ double OffspecCoords::calculateValue(size_t, double value) const
     return value;
 }
 
-std::string OffspecCoords::nameOfAxis(size_t i_axis) const
-{
-    if (i_axis == 0) {
-        return "alpha_i [deg]";
-    }
-    if (i_axis == 1) {
-        return "alpha_f [deg]";
-    }
-    ASSERT(false);
-}
-
 //  ************************************************************************************************
 //  class DepthprobeCoords
 //  ************************************************************************************************
@@ -170,12 +141,3 @@ double DepthprobeCoords::calculateValue(size_t, double value) const
 {
     return value;
 }
-
-std::string DepthprobeCoords::nameOfAxis(size_t i_axis) const
-{
-    if (i_axis == 0)
-        return "alpha_i [deg]";
-    if (i_axis == 1)
-        return "Position [nm]";
-    ASSERT(false);
-}
diff --git a/Device/Coord/CoordSystem2D.h b/Device/Coord/CoordSystem2D.h
index ab65ce7003f..eab2b3c2675 100644
--- a/Device/Coord/CoordSystem2D.h
+++ b/Device/Coord/CoordSystem2D.h
@@ -51,8 +51,6 @@ public:
     SphericalCoords* clone() const override;
 
 private:
-    std::string nameOfAxis(size_t i_axis) const override;
-
     SphericalCoords(const SphericalCoords& other); //!< used by clone()
     double calculateValue(size_t i_axis, double value) const override;
     const R3 m_ki;
@@ -71,8 +69,6 @@ public:
     ImageCoords* clone() const override;
 
 private:
-    std::string nameOfAxis(size_t i_axis) const override;
-
     ImageCoords(const ImageCoords& other); //!< used by clone()
     double calculateValue(size_t i_axis, double value) const override;
 
@@ -92,8 +88,6 @@ public:
     OffspecCoords* clone() const override;
 
 private:
-    std::string nameOfAxis(size_t i_axis) const override;
-
     OffspecCoords(const OffspecCoords& other); //!< used by clone()
     double calculateValue(size_t i_axis, double value) const override;
 };
@@ -110,8 +104,6 @@ public:
     DepthprobeCoords* clone() const override;
 
 private:
-    std::string nameOfAxis(size_t i_axis) const override;
-
     DepthprobeCoords(const DepthprobeCoords& other); //!< used by clone()
     double calculateValue(size_t, double value) const override;
     const double m_ki0;
diff --git a/Device/Coord/ICoordSystem.h b/Device/Coord/ICoordSystem.h
index 02a8e31930f..3ed8bef2e05 100644
--- a/Device/Coord/ICoordSystem.h
+++ b/Device/Coord/ICoordSystem.h
@@ -29,8 +29,6 @@ public:
     ~ICoordSystem() override;
 
     ICoordSystem* clone() const override = 0;
-
-    virtual std::string nameOfAxis(size_t i_axis) const = 0;
 };
 
 #endif // BORNAGAIN_DEVICE_COORD_ICOORDSYSTEM_H
-- 
GitLab