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

#include "GUI/Model/Sample/RoughnessItemCatalog.h"
#include "Base/Util/Assert.h"
#include "GUI/Model/Sample/RoughnessItems.h"

RoughnessItem* RoughnessItemCatalog::create(Type type)
{
    switch (type) {
    case Type::None:
        return nullptr;
    case Type::Basic:
        return new BasicRoughnessItem();
    }
    ASSERT(false);
}

QVector<RoughnessItemCatalog::Type> RoughnessItemCatalog::types()
{
    return {Type::None, Type::Basic};
}

UiInfo RoughnessItemCatalog::uiInfo(Type type)
{
    switch (type) {
    case Type::None:
        return {"None", "", ""};
    case Type::Basic:
        return {"Basic", "Stretched exponential lateral correlation function", ""};
    }
    ASSERT(false);
}

RoughnessItemCatalog::Type RoughnessItemCatalog::type(const RoughnessItem* item)
{
    if (!item)
        return Type::None;

    if (dynamic_cast<const BasicRoughnessItem*>(item))
        return Type::Basic;

    ASSERT(false);
}
