From 81e771896a741e2019b631322ae2684b639ed7df Mon Sep 17 00:00:00 2001
From: Walter Van Herck <w.van.herck@fz-juelich.de>
Date: Fri, 3 Feb 2017 11:09:23 +0100
Subject: [PATCH] Move FullFresnelMap into FormFactorCoherentSum

---
 Core/Aggregate/FormFactorCoherentSum.cpp | 5 +++--
 Core/Aggregate/FormFactorCoherentSum.h   | 5 +++--
 Core/Multilayer/LayerStrategyBuilder.cpp | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Core/Aggregate/FormFactorCoherentSum.cpp b/Core/Aggregate/FormFactorCoherentSum.cpp
index 24648d86940..8bb9b8935b7 100644
--- a/Core/Aggregate/FormFactorCoherentSum.cpp
+++ b/Core/Aggregate/FormFactorCoherentSum.cpp
@@ -14,6 +14,7 @@
 // ************************************************************************** //
 
 #include "FormFactorCoherentSum.h"
+#include "FullFresnelMap.h"
 #include "IFormFactor.h"
 #include "SimulationElement.h"
 #include "WavevectorInfo.h"
@@ -52,9 +53,9 @@ Eigen::Matrix2cd FormFactorCoherentSum::evaluatePol(const SimulationElement& sim
     return result;
 }
 
-void FormFactorCoherentSum::setSpecularInfo(const ILayerSpecularInfo& specular_info)
+void FormFactorCoherentSum::setSpecularInfo(const FullFresnelMap* p_full_map, size_t layer_index)
 {
-    m_parts[0].setSpecularInfo(specular_info);
+    m_parts[0].setSpecularInfo(*p_full_map->layerFresnelMap(layer_index));
 }
 
 void FormFactorCoherentSum::scaleRelativeAbundance(double total_abundance)
diff --git a/Core/Aggregate/FormFactorCoherentSum.h b/Core/Aggregate/FormFactorCoherentSum.h
index 441d25e45f4..617c792605e 100644
--- a/Core/Aggregate/FormFactorCoherentSum.h
+++ b/Core/Aggregate/FormFactorCoherentSum.h
@@ -22,9 +22,9 @@
 #include "FormFactorCoherentPart.h"
 #include <vector>
 
+class FullFresnelMap;
 class IFormFactor;
 class SimulationElement;
-class ILayerSpecularInfo;
 
 //! Information about particle form factor and abundance.
 //! @ingroup formfactors_internal
@@ -41,7 +41,8 @@ public:
     Eigen::Matrix2cd evaluatePol(const SimulationElement& sim_element) const;
 #endif
 
-    void setSpecularInfo(const ILayerSpecularInfo& specular_info);
+    void setSpecularInfo(const FullFresnelMap* p_full_map, size_t layer_index);
+
     double relativeAbundance() const { return m_abundance; }
     void scaleRelativeAbundance(double total_abundance);
     double radialExtension() const;
diff --git a/Core/Multilayer/LayerStrategyBuilder.cpp b/Core/Multilayer/LayerStrategyBuilder.cpp
index ff513417563..82fbc758061 100644
--- a/Core/Multilayer/LayerStrategyBuilder.cpp
+++ b/Core/Multilayer/LayerStrategyBuilder.cpp
@@ -88,7 +88,7 @@ SafePointerVector<class FormFactorCoherentSum> LayerStrategyBuilder::collectForm
         FormFactorCoherentSum* p_ff_coh;
         p_ff_coh = createFormFactorCoherentSum(particle, p_layer_material);
         p_ff_coh->scaleRelativeAbundance(layout_abundance);
-        p_ff_coh->setSpecularInfo(*mp_full_fresnel_map->layerFresnelMap(m_layer_index));
+        p_ff_coh->setSpecularInfo(mp_full_fresnel_map, m_layer_index);
         result.push_back(p_ff_coh);
     }
     return result;
-- 
GitLab