From 4b179a524ced403e48d74031dec9744ec9480e76 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Fri, 3 Dec 2021 14:41:28 +0100 Subject: [PATCH] Prism -> namespace ff --- Sample/HardParticle/IFormFactorPrism.cpp | 2 +- Sample/HardParticle/IFormFactorPrism.h | 7 ++++++- Sample/ff/Prism.cpp | 8 ++++---- Sample/ff/Prism.h | 4 ++++ auto/Wrap/doxygenSample.i | 26 ++++++++++++------------ 5 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Sample/HardParticle/IFormFactorPrism.cpp b/Sample/HardParticle/IFormFactorPrism.cpp index 4ad333a9883..7232961174a 100644 --- a/Sample/HardParticle/IFormFactorPrism.cpp +++ b/Sample/HardParticle/IFormFactorPrism.cpp @@ -24,7 +24,7 @@ IFormFactorPrism::~IFormFactorPrism() = default; void IFormFactorPrism::setPrism(bool symmetry_Ci, const std::vector<R3>& vertices) { - pimpl = std::make_unique<Prism>(symmetry_Ci, height(), vertices); + pimpl = std::make_unique<ff::Prism>(symmetry_Ci, height(), vertices); } double IFormFactorPrism::bottomZ(const IRotation& rotation) const diff --git a/Sample/HardParticle/IFormFactorPrism.h b/Sample/HardParticle/IFormFactorPrism.h index 4c469649626..72d29eb5211 100644 --- a/Sample/HardParticle/IFormFactorPrism.h +++ b/Sample/HardParticle/IFormFactorPrism.h @@ -19,8 +19,13 @@ #include "Sample/Scattering/IBornFF.h" #include <memory> +namespace ff { + class Prism; +} // namespace ff + + //! A prism with a polygonal base, for form factor computation. class IFormFactorPrism : public IBornFF { @@ -41,7 +46,7 @@ protected: virtual double height() const = 0; // TODO mv parameter m_height back from children to this private: - std::unique_ptr<Prism> pimpl; + std::unique_ptr<ff::Prism> pimpl; }; #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_IFORMFACTORPRISM_H diff --git a/Sample/ff/Prism.cpp b/Sample/ff/Prism.cpp index a3bf4327a28..4b420c982f1 100644 --- a/Sample/ff/Prism.cpp +++ b/Sample/ff/Prism.cpp @@ -20,7 +20,7 @@ #include "Base/Math/Functions.h" #include <stdexcept> // need overlooked by g++ 5.4 -Prism::Prism(bool symmetry_Ci, double height, const std::vector<R3>& vertices) +ff::Prism::Prism(bool symmetry_Ci, double height, const std::vector<R3>& vertices) { m_height = height; m_vertices.clear(); @@ -42,17 +42,17 @@ Prism::Prism(bool symmetry_Ci, double height, const std::vector<R3>& vertices) } } -double Prism::area() const +double ff::Prism::area() const { return m_base->area(); } -const std::vector<R3>& Prism::vertices() const +const std::vector<R3>& ff::Prism::vertices() const { return m_vertices; } -complex_t Prism::evaluate_for_q(const C3& q) const +complex_t ff::Prism::evaluate_for_q(const C3& q) const { try { #ifdef ALGORITHM_DIAGNOSTIC diff --git a/Sample/ff/Prism.h b/Sample/ff/Prism.h index 7d4d43ff368..aeed0e29906 100644 --- a/Sample/ff/Prism.h +++ b/Sample/ff/Prism.h @@ -24,6 +24,8 @@ #include "Sample/ff/PolyhedralTopology.h" #include <memory> +namespace ff { + class Prism { public: Prism(bool symmetry_Ci, double height, const std::vector<R3>& vertices); @@ -39,5 +41,7 @@ private: std::vector<R3> m_vertices; //! for topZ, bottomZ computation only }; +} // namespace ff + #endif // BORNAGAIN_SAMPLE_FF_PRISM_H #endif // USER_API diff --git a/auto/Wrap/doxygenSample.i b/auto/Wrap/doxygenSample.i index a192d735b30..d7c18c04318 100644 --- a/auto/Wrap/doxygenSample.i +++ b/auto/Wrap/doxygenSample.i @@ -5194,24 +5194,24 @@ Returns the form factor F(q) of this polyhedron, respecting the offset z_bottom. "; -// File: classPrism.xml -%feature("docstring") Prism ""; +// File: classff_1_1Prism.xml +%feature("docstring") ff::Prism ""; -%feature("docstring") Prism::Prism "Prism::Prism(bool symmetry_Ci, double height, const std::vector< R3 > &vertices) +%feature("docstring") ff::Prism::Prism "ff::Prism::Prism(bool symmetry_Ci, double height, const std::vector< R3 > &vertices) The mathematics implemented here is described in full detail in a paper by Joachim Wuttke, entitled \"Form factor (Fourier shape transform) of polygon and polyhedron.\" "; -%feature("docstring") Prism::Prism "Prism::Prism(const Prism &)=delete +%feature("docstring") ff::Prism::Prism "ff::Prism::Prism(const Prism &)=delete "; -%feature("docstring") Prism::area "double Prism::area() const +%feature("docstring") ff::Prism::area "double ff::Prism::area() const "; -%feature("docstring") Prism::vertices "const std::vector< R3 > & Prism::vertices() const +%feature("docstring") ff::Prism::vertices "const std::vector< R3 > & ff::Prism::vertices() const "; -%feature("docstring") Prism::evaluate_for_q "complex_t Prism::evaluate_for_q(const C3 &q) const +%feature("docstring") ff::Prism::evaluate_for_q "complex_t ff::Prism::evaluate_for_q(const C3 &q) const needed for topZ, bottomZ computation "; @@ -6160,6 +6160,12 @@ Used by the hard sphere and by several soft sphere classes. // File: Polyhedron_8h.xml +// File: Prism_8cpp.xml + + +// File: Prism_8h.xml + + // File: FormFactorAnisoPyramid_8cpp.xml @@ -6337,12 +6343,6 @@ Used by the hard sphere and by several soft sphere classes. // File: IProfileRipple_8h.xml -// File: Prism_8cpp.xml - - -// File: Prism_8h.xml - - // File: Ripples_8cpp.xml -- GitLab