Skip to content
Snippets Groups Projects
RoughnessCatalog.cpp 1.48 KiB
Newer Older
  • Learn to ignore specific revisions
  • //  ************************************************************************************************
    //
    //  BornAgain: simulate and fit reflection and scattering
    //
    
    //! @file      GUI/Model/Sample/RoughnessCatalog.cpp
    //! @brief     Implements class RoughnessCatalog.
    
    //!
    //! @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 "Base/Util/Assert.h"
    #include "GUI/Model/Sample/RoughnessItems.h"
    
    
    {
        switch (type) {
        case Type::None:
            return nullptr;
        case Type::Basic:
    
            return new BasicRoughnessItem(0., .3, 5.);
    
        ASSERT_NEVER;
    
    QVector<RoughnessCatalog::Type> RoughnessCatalog::types()
    
    {
        return {Type::None, Type::Basic};
    }
    
    
    {
        switch (type) {
        case Type::None:
            return {"None", "", ""};
        case Type::Basic:
    
            return {"Basic", "Fractal lateral correlation function", ""};
    
        ASSERT_NEVER;
    
    RoughnessCatalog::Type RoughnessCatalog::type(const RoughnessItem* item)
    
    {
        if (!item)
            return Type::None;
    
        if (dynamic_cast<const BasicRoughnessItem*>(item))
            return Type::Basic;
    
    
        ASSERT_NEVER;