Skip to content
Snippets Groups Projects
Commit 76c93b8c authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

ProcessedSample + member m_specular_strategy, yet unused

parent 80adc511
No related branches found
No related tags found
1 merge request!197rm IFresnelMap class hierarchy
...@@ -220,6 +220,14 @@ ProcessedSample ProcessedSample::make(const MultiLayer& sample, const Simulation ...@@ -220,6 +220,14 @@ ProcessedSample ProcessedSample::make(const MultiLayer& sample, const Simulation
const SliceStack refined_stack = const SliceStack refined_stack =
options.useAvgMaterials() ? refineStack(slices1, layouts) : slices1; options.useAvgMaterials() ? refineStack(slices1, layouts) : slices1;
std::unique_ptr<const ISpecularStrategy> specular_strategy;
if (slices1.containsMagneticMaterial())
specular_strategy =
SampleUtils::SpecularStrategyBuilder::buildMagnetic(sample.roughnessModel());
else
specular_strategy =
SampleUtils::SpecularStrategyBuilder::buildScalar(sample.roughnessModel());
std::unique_ptr<const IFresnelMap> fresnel_map; std::unique_ptr<const IFresnelMap> fresnel_map;
if (slices1.containsMagneticMaterial()) if (slices1.containsMagneticMaterial())
fresnel_map = std::make_unique<const MatrixFresnelMap>( fresnel_map = std::make_unique<const MatrixFresnelMap>(
...@@ -231,23 +239,26 @@ ProcessedSample ProcessedSample::make(const MultiLayer& sample, const Simulation ...@@ -231,23 +239,26 @@ ProcessedSample ProcessedSample::make(const MultiLayer& sample, const Simulation
SampleUtils::SpecularStrategyBuilder::buildScalar(sample.roughnessModel())); SampleUtils::SpecularStrategyBuilder::buildScalar(sample.roughnessModel()));
return ProcessedSample(sample, polarized, std::move(layouts), refined_stack, return ProcessedSample(sample, polarized, std::move(layouts), refined_stack,
fresnel_map.release()); specular_strategy.release(), fresnel_map.release());
} }
ProcessedSample::ProcessedSample(const MultiLayer& sample, bool polarized, ProcessedSample::ProcessedSample(const MultiLayer& sample, bool polarized,
std::vector<ProcessedLayout>&& layouts, std::vector<ProcessedLayout>&& layouts,
const SliceStack& refined_stack, const IFresnelMap* fresnel_map) const SliceStack& refined_stack,
const ISpecularStrategy* specular_strategy,
const IFresnelMap* fresnel_map)
: m_sample(sample) : m_sample(sample)
, m_polarized(polarized) , m_polarized(polarized)
, m_layouts(std::move(layouts)) , m_layouts(std::move(layouts))
, m_refined_stack(refined_stack) , m_refined_stack(refined_stack)
, m_specular_strategy(specular_strategy)
, m_fresnel_map(fresnel_map) , m_fresnel_map(fresnel_map)
{ {
} }
ProcessedSample::ProcessedSample(ProcessedSample&&) ProcessedSample::ProcessedSample(ProcessedSample&&)
: ProcessedSample(m_sample, m_polarized, std::move(m_layouts), m_refined_stack, : ProcessedSample(m_sample, m_polarized, std::move(m_layouts), m_refined_stack,
m_fresnel_map.release()) m_specular_strategy.release(), m_fresnel_map.release())
{ {
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <vector> #include <vector>
class IFresnelMap; class IFresnelMap;
class ISpecularStrategy;
class Material; class Material;
class MultiLayer; class MultiLayer;
class ProcessedLayout; class ProcessedLayout;
...@@ -63,11 +64,13 @@ public: ...@@ -63,11 +64,13 @@ public:
private: private:
ProcessedSample(const MultiLayer& sample, bool polarized, ProcessedSample(const MultiLayer& sample, bool polarized,
std::vector<ProcessedLayout>&& layouts, const SliceStack& refined_stack, std::vector<ProcessedLayout>&& layouts, const SliceStack& refined_stack,
const ISpecularStrategy* specular_strategy,
const IFresnelMap* fresnel_map); const IFresnelMap* fresnel_map);
const MultiLayer& m_sample; const MultiLayer& m_sample;
const bool m_polarized; const bool m_polarized;
std::vector<ProcessedLayout> m_layouts; // const forbidden by &&-c'tor < needed by tests std::vector<ProcessedLayout> m_layouts; // const forbidden by &&-c'tor < needed by tests
const SliceStack m_refined_stack; const SliceStack m_refined_stack;
std::unique_ptr<const ISpecularStrategy> m_specular_strategy;
std::unique_ptr<const IFresnelMap> m_fresnel_map; std::unique_ptr<const IFresnelMap> m_fresnel_map;
}; };
......
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