//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Device/Beam/Footprint.h
//! @brief     Defines interface Footprint.
//!
//! @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_DEVICE_BEAM_IFOOTPRINT_H
#define BORNAGAIN_DEVICE_BEAM_IFOOTPRINT_H

#include "Base/Type/Cloneable.h"

//! Abstract base for classes that calculate the beam footprint factor

class Footprint : public Cloneable {
public:
    Footprint(double width_ratio);
    ~Footprint() override;

#ifndef SWIG
    Footprint* clone() const override = 0;
    virtual void validate() const;

    double widthRatio() const { return m_width_ratio; }

    //! Calculate footprint correction coefficient from the beam incident angle _alpha_.
    virtual double calculate(double alpha) const = 0;

protected:
    mutable bool m_validated{false};
    double m_width_ratio; //!< Beam to sample width ratio
#endif                    // SWIG
};

#endif // BORNAGAIN_DEVICE_BEAM_IFOOTPRINT_H
