//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Sample/HardParticle/Ellipsoid.h
//! @brief     Defines class Ellipsoid.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_ELLIPSOID_H
#define BORNAGAIN_SAMPLE_HARDPARTICLE_ELLIPSOID_H

#include "Sample/Particle/HardFormfactor.h"

//! An hemi ellipsoid,
//!   obtained by truncating a full ellipsoid in the middle plane spanned by two principal axes.

class Ellipsoid : public HardFormfactor {
public:
    Ellipsoid(double radius_x, double radius_y, double radius_z);
    ~Ellipsoid() override = default;

    complex_t formfactorAtBottom(C3 q) const override;

    std::string className() const final { return "Ellipsoid"; }

#ifndef SWIG
    Ellipsoid* clone() const override { return new Ellipsoid(m_radius_x, m_radius_y, m_radius_z); }

    void validate() const override;

    double radiusX() const { return m_radius_x; }
    double radiusY() const { return m_radius_y; }
    double radiusZ() const { return m_radius_z; }

    double radialExtension() const override;
    bool contains(const R3& position) const override;

private:
    double m_radius_x;
    double m_radius_y;
    double m_radius_z; //!< radius in +z direction
#endif                 // SWIG
};

#endif // BORNAGAIN_SAMPLE_HARDPARTICLE_ELLIPSOID_H
