//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Device/Beam/Footprint.cpp
//! @brief     Implements 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)
//
//  ************************************************************************************************

#include "Device/Beam/Footprint.h"
#include <stdexcept>

Footprint::Footprint(double width_ratio)
    : m_width_ratio(width_ratio)
{
    if (m_width_ratio < 0.0)
        throw std::runtime_error("Error in Footprint::setWidthRatio: width ratio is negative");
}

Footprint::~Footprint() = default;

void Footprint::validate() const
{
    if (m_width_ratio < 0)
        throw std::runtime_error("width_ratio < 0");

    m_validated = true;
}
