//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Sample/HardParticle/EllipsoidalCylinder.h
//! @brief     Defines class EllipsoidalCylinder.
//!
//! @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_ELLIPSOIDALCYLINDER_H
#define BORNAGAIN_SAMPLE_HARDPARTICLE_ELLIPSOIDALCYLINDER_H

#include "Sample/Particle/HardFormfactor.h"

//! A cylinder with elliptical base.

class EllipsoidalCylinder : public HardFormfactor {
public:
    EllipsoidalCylinder(double radius_x, double radius_y, double height);

    complex_t formfactorAtBottom(C3 q) const override;

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

#ifndef SWIG
    EllipsoidalCylinder* clone() const override
    {
        return new EllipsoidalCylinder(m_radius_x, m_radius_y, m_height);
    }
    void validate() const override;

    double radiusX() const { return m_radius_x; }
    double radiusY() const { return m_radius_y; }
    double height() const { return m_height; }

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

private:
    double m_radius_x;
    double m_radius_y;
    double m_height;
#endif // SWIG
};

#endif // BORNAGAIN_SAMPLE_HARDPARTICLE_ELLIPSOIDALCYLINDER_H
