From 0a044820fbdef39f48eddb553bc3d1106ee9669e Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Mon, 12 Dec 2022 13:11:35 +0100
Subject: [PATCH] IFFPolyhedron: rm member m_z_bottom and fct shift

---
 Sample/HardParticle/Dodecahedron.cpp          | 1 -
 Sample/HardParticle/IFormFactorPolyhedron.cpp | 7 -------
 Sample/HardParticle/IFormFactorPolyhedron.h   | 2 --
 Sample/HardParticle/Icosahedron.cpp           | 1 -
 Sample/HardParticle/PlatonicOctahedron.cpp    | 1 -
 Sample/HardParticle/PlatonicTetrahedron.cpp   | 1 -
 6 files changed, 13 deletions(-)

diff --git a/Sample/HardParticle/Dodecahedron.cpp b/Sample/HardParticle/Dodecahedron.cpp
index af05989b915..815894eded6 100644
--- a/Sample/HardParticle/Dodecahedron.cpp
+++ b/Sample/HardParticle/Dodecahedron.cpp
@@ -33,7 +33,6 @@ std::string Dodecahedron::validate() const
         return jointError({"nonpositive edge=" + std::to_string(m_edge)});
 
     pimpl.reset(ff::make::Dodecahedron(m_edge));
-    shift(1.113516364411607 * m_edge);
 
     m_validated = true;
     return "";
diff --git a/Sample/HardParticle/IFormFactorPolyhedron.cpp b/Sample/HardParticle/IFormFactorPolyhedron.cpp
index 45bbbb39cdf..809a42eb2e7 100644
--- a/Sample/HardParticle/IFormFactorPolyhedron.cpp
+++ b/Sample/HardParticle/IFormFactorPolyhedron.cpp
@@ -34,16 +34,9 @@ IFormFactorPolyhedron::~IFormFactorPolyhedron() = default;
 void IFormFactorPolyhedron::setPolyhedron(const ff::Topology& topology, double z_bottom,
                                           const std::vector<R3>& vertices) const
 {
-    m_z_bottom = z_bottom;
-
     pimpl = std::make_unique<ff::Polyhedron>(topology, vertices, R3(0, 0, -z_bottom));
 }
 
-void IFormFactorPolyhedron::shift(double z_center) const
-{
-    m_z_bottom = -z_center;
-}
-
 double IFormFactorPolyhedron::volume() const
 {
     ASSERT(m_validated);
diff --git a/Sample/HardParticle/IFormFactorPolyhedron.h b/Sample/HardParticle/IFormFactorPolyhedron.h
index efec5466278..aab6534fa31 100644
--- a/Sample/HardParticle/IFormFactorPolyhedron.h
+++ b/Sample/HardParticle/IFormFactorPolyhedron.h
@@ -41,10 +41,8 @@ public:
 protected:
     void setPolyhedron(const ff::Topology& topology, double z_bottom,
                        const std::vector<R3>& vertices) const;
-    void shift(double z_center) const;
 
     mutable std::unique_ptr<ff::IPolyhedron> pimpl;
-    mutable double m_z_bottom;
 
 private:
     Span exec_spanZ(const IRotation* rotation) const override;
diff --git a/Sample/HardParticle/Icosahedron.cpp b/Sample/HardParticle/Icosahedron.cpp
index 7fc152b4bc6..72ba8844200 100644
--- a/Sample/HardParticle/Icosahedron.cpp
+++ b/Sample/HardParticle/Icosahedron.cpp
@@ -33,7 +33,6 @@ std::string Icosahedron::validate() const
         return jointError({"nonpositive edge=" + std::to_string(m_edge)});
 
     pimpl.reset(ff::make::Icosahedron(m_edge));
-    shift(0.7557613140761708 * m_edge);
 
     m_validated = true;
     return "";
diff --git a/Sample/HardParticle/PlatonicOctahedron.cpp b/Sample/HardParticle/PlatonicOctahedron.cpp
index 54f4a784fba..da00008ef5c 100644
--- a/Sample/HardParticle/PlatonicOctahedron.cpp
+++ b/Sample/HardParticle/PlatonicOctahedron.cpp
@@ -35,7 +35,6 @@ std::string PlatonicOctahedron::validate() const
         return jointError({"nonpositive edge=" + std::to_string(m_edge)});
 
     pimpl.reset(ff::make::Octahedron(m_edge));
-    shift(m_edge / sqrt(2));
 
     m_validated = true;
     return "";
diff --git a/Sample/HardParticle/PlatonicTetrahedron.cpp b/Sample/HardParticle/PlatonicTetrahedron.cpp
index 78c0c3ab5ad..04fa9368b8e 100644
--- a/Sample/HardParticle/PlatonicTetrahedron.cpp
+++ b/Sample/HardParticle/PlatonicTetrahedron.cpp
@@ -35,7 +35,6 @@ std::string PlatonicTetrahedron::validate() const
         return jointError({"nonpositive edge=" + std::to_string(m_edge)});
 
     pimpl.reset(ff::make::Tetrahedron(m_edge));
-    shift(sqrt(2. / 3) / 4 * m_edge);
 
     m_validated = true;
     return "";
-- 
GitLab