Skip to content
Snippets Groups Projects
Commit abc902f0 authored by Beerwerth, Randolf's avatar Beerwerth, Randolf
Browse files

Add RoughnessModel enumerate

parent 827725b5
No related branches found
No related tags found
No related merge requests found
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Core/Multilayer/SpecularMatrix.cpp
//! @brief Implements class SpecularMatrix.
//!
//! @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 "RoughnessModels.h"
#include <map>
namespace {
const std::map<RoughnessModel, std::string> roughnessModelNames = {
{RoughnessModel::DEFAULT, "RoughnessModel::DEFAULT"},
{RoughnessModel::TANH, "RoughnessModel::TANH"},
{RoughnessModel::NEVOT_CROCE, "RoughnessModel::NEVOT_CROCE"} };
}
std::string RoughnessModelWrap::roughnessModelName(RoughnessModel model)
{
auto iter = roughnessModelNames.find(model);
if (iter != roughnessModelNames.end())
return iter->second;
return "Invalid roughness model";
}
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Core/Computation/ProcessedSample.cpp
//! @brief Implements class ProcessedSample.
//!
//! @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 ROUGHNESSMODELS_H
#define ROUGHNESSMODELS_H
#include <string>
#include "WinDllMacros.h"
// workaround for SWIG (instead of just writing enum class RoughnessModel ...)
struct BA_CORE_API_ RoughnessModelWrap {
enum RoughnessModel { DEFAULT, TANH, NEVOT_CROCE };
#ifndef SWIG
// TODO: to automatize enum to string convertion, one can possibly use this solution
// https://stackoverflow.com/questions/147267/easy-way-to-use-variables-of-enum-types-as-string-in-c#202511
static std::string roughnessModelName(RoughnessModel model);
#endif
};
typedef RoughnessModelWrap::RoughnessModel RoughnessModel;
#endif // ROUGHNESSMODELS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment