Skip to content
Snippets Groups Projects
Commit 240b545e authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

more compact

parent 3de5070d
No related branches found
No related tags found
1 merge request!190merge ITerm -> ICompute
......@@ -13,6 +13,7 @@
// ************************************************************************************************
#include "Resample/Specular/SpecularStrategyBuilder.h"
#include "Base/Utils/Assert.h"
#include "Resample/Specular/SpecularMagneticNCStrategy.h"
#include "Resample/Specular/SpecularMagneticTanhStrategy.h"
#include "Resample/Specular/SpecularScalarNCStrategy.h"
......@@ -21,27 +22,23 @@
std::unique_ptr<SpecularScalarStrategy>
SampleUtils::SpecularStrategyBuilder::buildScalar(const RoughnessModel& rm)
{
const RoughnessModel& roughnessModel = rm;
if (roughnessModel == RoughnessModel::TANH || roughnessModel == RoughnessModel::DEFAULT)
if (rm == RoughnessModel::TANH || rm == RoughnessModel::DEFAULT)
return std::make_unique<SpecularScalarTanhStrategy>();
if (roughnessModel == RoughnessModel::NEVOT_CROCE)
if (rm == RoughnessModel::NEVOT_CROCE)
return std::make_unique<SpecularScalarNCStrategy>();
throw std::logic_error("Invalid roughness model");
ASSERT(0);
}
std::unique_ptr<SpecularMagneticStrategy>
SampleUtils::SpecularStrategyBuilder::buildMagnetic(const RoughnessModel& rm)
{
const RoughnessModel& roughnessModel = rm;
if (roughnessModel == RoughnessModel::TANH || roughnessModel == RoughnessModel::DEFAULT)
if (rm == RoughnessModel::TANH || rm == RoughnessModel::DEFAULT)
return std::make_unique<SpecularMagneticTanhStrategy>();
if (roughnessModel == RoughnessModel::NEVOT_CROCE)
if (rm == RoughnessModel::NEVOT_CROCE)
return std::make_unique<SpecularMagneticNCStrategy>();
throw std::logic_error("Invalid roughness model");
ASSERT(0);
}
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