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

ProfileBar: rename base class -> IProfileBar

parent 59659a51
No related branches found
No related tags found
No related merge requests found
...@@ -15,32 +15,32 @@ ...@@ -15,32 +15,32 @@
#ifndef BORNAGAIN_CORE_HARDPARTICLE_FORMFACTORBAR_H #ifndef BORNAGAIN_CORE_HARDPARTICLE_FORMFACTORBAR_H
#define BORNAGAIN_CORE_HARDPARTICLE_FORMFACTORBAR_H #define BORNAGAIN_CORE_HARDPARTICLE_FORMFACTORBAR_H
#include "Core/HardParticle/ProfileBar.h" #include "Core/HardParticle/IProfileBar.h"
//! The form factor of an elongated bar, with Gaussian profile in elongation direction. //! The form factor of an elongated bar, with Gaussian profile in elongation direction.
//! @ingroup legacyGrating //! @ingroup legacyGrating
class BA_CORE_API_ FormFactorBarGauss : public ProfileBar class BA_CORE_API_ FormFactorBarGauss : public IProfileBar
{ {
public: public:
FormFactorBarGauss(double length, double width, double height); FormFactorBarGauss(double length, double width, double height);
FormFactorBarGauss* clone() const override final; FormFactorBarGauss* clone() const final;
void accept(INodeVisitor* visitor) const override final; void accept(INodeVisitor* visitor) const final;
private: private:
complex_t factor_x(complex_t qx) const override final; complex_t factor_x(complex_t qx) const final;
}; };
//! The form factor of an elongated, with Lorentz form factor in elongation direction. //! The form factor of an elongated, with Lorentz form factor in elongation direction.
//! @ingroup legacyGrating //! @ingroup legacyGrating
class BA_CORE_API_ FormFactorBarLorentz : public ProfileBar class BA_CORE_API_ FormFactorBarLorentz : public IProfileBar
{ {
public: public:
FormFactorBarLorentz(double length, double width, double height); FormFactorBarLorentz(double length, double width, double height);
FormFactorBarLorentz* clone() const override final; FormFactorBarLorentz* clone() const final;
void accept(INodeVisitor* visitor) const override final; void accept(INodeVisitor* visitor) const final;
private: private:
complex_t factor_x(complex_t qx) const override final; complex_t factor_x(complex_t qx) const final;
}; };
#endif // BORNAGAIN_CORE_HARDPARTICLE_FORMFACTORBAR_H #endif // BORNAGAIN_CORE_HARDPARTICLE_FORMFACTORBAR_H
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// BornAgain: simulate and fit scattering at grazing incidence // BornAgain: simulate and fit scattering at grazing incidence
// //
//! @file Core/HardParticle/ProfileBar.cpp //! @file Core/HardParticle/IProfileBar.cpp
//! @brief Implements class ProfileBar. //! @brief Implements class ProfileBar.
//! //!
//! @homepage http://www.bornagainproject.org //! @homepage http://www.bornagainproject.org
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// //
// ************************************************************************** // // ************************************************************************** //
#include "Core/HardParticle/ProfileBar.h" #include "Core/HardParticle/IProfileBar.h"
#include "Core/Basics/Exceptions.h" #include "Core/Basics/Exceptions.h"
#include "Core/Basics/MathConstants.h" #include "Core/Basics/MathConstants.h"
#include "Core/Parametrization/RealParameter.h" #include "Core/Parametrization/RealParameter.h"
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
//! @param length: length of the rectangular base in nanometers //! @param length: length of the rectangular base in nanometers
//! @param width: width of the rectangular base in nanometers //! @param width: width of the rectangular base in nanometers
//! @param height: height of the ripple in nanometers //! @param height: height of the ripple in nanometers
ProfileBar::ProfileBar(double length, double width, double height) IProfileBar::IProfileBar(double length, double width, double height)
: m_length(length), m_width(width), m_height(height) : m_length(length), m_width(width), m_height(height)
{ {
check_initialization(); check_initialization();
...@@ -34,12 +34,12 @@ ProfileBar::ProfileBar(double length, double width, double height) ...@@ -34,12 +34,12 @@ ProfileBar::ProfileBar(double length, double width, double height)
onChange(); onChange();
} }
bool ProfileBar::check_initialization() const bool IProfileBar::check_initialization() const
{ {
bool result(true); bool result(true);
if (m_height <= 0.0 || m_width <= 0.0 || m_length <= 0.0) { if (m_height <= 0.0 || m_width <= 0.0 || m_length <= 0.0) {
std::ostringstream ostr; std::ostringstream ostr;
ostr << "ProfileBar() -> Error in class initialization with parameters "; ostr << "IProfileBar() -> Error in class initialization with parameters ";
ostr << " height:" << m_height; ostr << " height:" << m_height;
ostr << " width:" << m_width; ostr << " width:" << m_width;
ostr << " length:" << m_length << "\n\n"; ostr << " length:" << m_length << "\n\n";
...@@ -49,13 +49,13 @@ bool ProfileBar::check_initialization() const ...@@ -49,13 +49,13 @@ bool ProfileBar::check_initialization() const
return result; return result;
} }
double ProfileBar::radialExtension() const double IProfileBar::radialExtension() const
{ {
return (m_width + m_length) / 4.0; return (m_width + m_length) / 4.0;
} }
//! Complex form factor. //! Complex form factor.
complex_t ProfileBar::factor_yz(complex_t qy, complex_t qz) const complex_t IProfileBar::factor_yz(complex_t qy, complex_t qz) const
{ {
const complex_t qyWdiv2 = m_width * qy / 2.0; const complex_t qyWdiv2 = m_width * qy / 2.0;
const complex_t qzHdiv2 = m_height * qz / 2.0; const complex_t qzHdiv2 = m_height * qz / 2.0;
...@@ -64,7 +64,7 @@ complex_t ProfileBar::factor_yz(complex_t qy, complex_t qz) const ...@@ -64,7 +64,7 @@ complex_t ProfileBar::factor_yz(complex_t qy, complex_t qz) const
* MathFunctions::sinc(qzHdiv2); * MathFunctions::sinc(qzHdiv2);
} }
void ProfileBar::onChange() void IProfileBar::onChange()
{ {
mP_shape.reset(new Box(m_length, m_width, m_height)); mP_shape.reset(new Box(m_length, m_width, m_height));
} }
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// //
// BornAgain: simulate and fit scattering at grazing incidence // BornAgain: simulate and fit scattering at grazing incidence
// //
//! @file Core/HardParticle/ProfileBar.h //! @file Core/HardParticle/IProfileBar.h
//! @brief Defines class ProfileBar. //! @brief Defines class IProfileBar.
//! //!
//! @homepage http://www.bornagainproject.org //! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING) //! @license GNU General Public License v3 or higher (see COPYING)
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
//! Base class for form factors with a cosine ripple profile in the yz plane. //! Base class for form factors with a cosine ripple profile in the yz plane.
class BA_CORE_API_ ProfileBar : public IFormFactorBorn class BA_CORE_API_ IProfileBar : public IFormFactorBorn
{ {
public: public:
ProfileBar(double length, double width, double height); IProfileBar(double length, double width, double height);
double getLength() const { return m_length; } double getLength() const { return m_length; }
double getHeight() const { return m_height; } double getHeight() const { return m_height; }
......
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
%include "Core/HardParticle/FormFactorPolyhedron.h" %include "Core/HardParticle/FormFactorPolyhedron.h"
%include "Core/HardParticle/FormFactorPolyhedron.h" %include "Core/HardParticle/FormFactorPolyhedron.h"
%include "Core/HardParticle/ProfileBar.h" %include "Core/HardParticle/IProfileBar.h"
%include "Core/HardParticle/IProfileRipple.h" %include "Core/HardParticle/IProfileRipple.h"
%include "Core/HardParticle/FormFactorAnisoPyramid.h" %include "Core/HardParticle/FormFactorAnisoPyramid.h"
......
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment