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

#include "Sample/Particle/HardFormfactor.h"

//! A circular cylinder.

class Cylinder : public HardFormfactor {
public:
    Cylinder(double radius, double height);

    complex_t formfactorAtBottom(C3 q) const override;

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

#ifndef SWIG
    Cylinder* clone() const override { return new Cylinder(m_radius, m_height); }
    void validate() const override;

    double height() const { return m_height; }
    double radius() const { return m_radius; }

    double radialExtension() const override { return m_radius; }
    bool contains(const R3& position) const override;

private:
    double m_radius;
    double m_height;
#endif // SWIG
};

#endif // BORNAGAIN_SAMPLE_HARDPARTICLE_CYLINDER_H
