Newer
Older
// ************************************************************************************************
//
// BornAgain: simulate and fit reflection and scattering
//

Wuttke, Joachim
committed
//! @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)
//
// ************************************************************************************************

Wuttke, Joachim
committed
#include "GUI/Model/Sample/RoughnessCatalog.h"
#include "Base/Util/Assert.h"
#include "GUI/Model/Sample/RoughnessItems.h"

Wuttke, Joachim
committed
RoughnessItem* RoughnessCatalog::create(Type type)
{
switch (type) {
case Type::None:
return nullptr;
case Type::Basic:
return new BasicRoughnessItem(0., .3, 5.);

Wuttke, Joachim
committed
QVector<RoughnessCatalog::Type> RoughnessCatalog::types()
{
return {Type::None, Type::Basic};
}

Wuttke, Joachim
committed
UiInfo RoughnessCatalog::uiInfo(Type type)
{
switch (type) {
case Type::None:
return {"None", "", ""};
case Type::Basic:
return {"Basic", "Fractal lateral correlation function", ""};

Wuttke, Joachim
committed
RoughnessCatalog::Type RoughnessCatalog::type(const RoughnessItem* item)
{
if (!item)
return Type::None;
if (dynamic_cast<const BasicRoughnessItem*>(item))
return Type::Basic;