From e091a38c60e517b426347125d437853645aa1081 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Mon, 13 Dec 2021 22:27:13 +0100
Subject: [PATCH] broken

---
 Sample/Scattering/DecoratedFF.cpp              | 18 ++++++++++++++----
 .../FormFactorDecoratorPositionFactor.cpp      | 10 ----------
 .../FormFactorDecoratorPositionFactor.h        |  1 -
 .../Scattering/FormFactorDecoratorRotation.cpp |  8 --------
 .../Scattering/FormFactorDecoratorRotation.h   |  1 -
 auto/Wrap/doxygenSample.i                      | 10 ----------
 6 files changed, 14 insertions(+), 34 deletions(-)

diff --git a/Sample/Scattering/DecoratedFF.cpp b/Sample/Scattering/DecoratedFF.cpp
index 4fb5f8fad90..c2205f0871b 100644
--- a/Sample/Scattering/DecoratedFF.cpp
+++ b/Sample/Scattering/DecoratedFF.cpp
@@ -14,7 +14,11 @@
 
 #include "Sample/Scattering/DecoratedFF.h"
 #include "Base/Vector/RotMatrix.h"
+<<<<<<< HEAD
 #include "Base/Vector/WavevectorInfo.h" // debug
+=======
+#include "Base/Vector/WavevectorInfo.h"
+>>>>>>> 289d652bf7 (broken)
 #include "Sample/Material/Material.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Scattering/Rotations.h"
@@ -69,11 +73,17 @@ void DecoratedFF::setRotMatrix(const RotMatrix& rotMatrix)
 complex_t DecoratedFF::theFF(const WavevectorInfo& wavevectors) const
 {
     std::cout << "DEBUG DecoratedFF::theFF, q=" << wavevectors.getQ() << std::endl;
-    complex_t result = m_ff->theFF(wavevectors);
-    std::cout << "-> sub   result = " << result << std::endl;
+    WavevectorInfo wavevectors2 = m_rotMatrix ? wavevectors.transformed(m_rotMatrix->getInverse())
+        : wavevectors;
+    std::cout << " -> wavevectors2 q=" << wavevectors2.getQ() << std::endl;
+    complex_t result = m_ff->theFF(wavevectors2);
+    std::cout << "-> ini   result = " << result << std::endl;
     if (m_material && m_ambient_material)
-        result = (m_material->scalarSubtrSLD(wavevectors)
-                  - m_ambient_material->scalarSubtrSLD(wavevectors)) * result;
+        result = (m_material->scalarSubtrSLD(wavevectors2)
+                  - m_ambient_material->scalarSubtrSLD(wavevectors2)) * result;
+    std::cout << "-> mat   result = " << result << std::endl;
+    if (m_position)
+        result *= exp_I(m_position->dot(wavevectors.getQ()));
     std::cout << "-> final result = " << result << std::endl;
     return result;
 }
diff --git a/Sample/Scattering/FormFactorDecoratorPositionFactor.cpp b/Sample/Scattering/FormFactorDecoratorPositionFactor.cpp
index 934230acd76..295072fc448 100644
--- a/Sample/Scattering/FormFactorDecoratorPositionFactor.cpp
+++ b/Sample/Scattering/FormFactorDecoratorPositionFactor.cpp
@@ -34,16 +34,6 @@ double FormFactorDecoratorPositionFactor::topZ(const IRotation* rotation) const
     return m_ff->topZ(rotation) + (rotation ? rotation->transformed(*m_position) : *m_position).z();
 }
 
-complex_t FormFactorDecoratorPositionFactor::theFF(const WavevectorInfo& wavevectors) const
-{
-    std::cout << "DEBUG FFDecPos::theFF, q=" << wavevectors.getQ() << std::endl;
-    complex_t result = m_ff->theFF(wavevectors);
-    std::cout << "-> sub   result = " << result << std::endl;
-    result *= exp_I(m_position->dot(wavevectors.getQ()));
-    std::cout << "-> final result = " << result << std::endl;
-    return result;
-}
-
 Eigen::Matrix2cd
 FormFactorDecoratorPositionFactor::thePolFF(const WavevectorInfo& wavevectors) const
 {
diff --git a/Sample/Scattering/FormFactorDecoratorPositionFactor.h b/Sample/Scattering/FormFactorDecoratorPositionFactor.h
index 986ca5b5768..c6a45d379b6 100644
--- a/Sample/Scattering/FormFactorDecoratorPositionFactor.h
+++ b/Sample/Scattering/FormFactorDecoratorPositionFactor.h
@@ -39,7 +39,6 @@ public:
 
     double topZ(const IRotation* rotation) const override;
 
-    complex_t theFF(const WavevectorInfo& wavevectors) const override;
 #ifndef SWIG
     Eigen::Matrix2cd thePolFF(const WavevectorInfo& wavevectors) const override;
 #endif
diff --git a/Sample/Scattering/FormFactorDecoratorRotation.cpp b/Sample/Scattering/FormFactorDecoratorRotation.cpp
index 32d2d83ec12..5e7aa56b099 100644
--- a/Sample/Scattering/FormFactorDecoratorRotation.cpp
+++ b/Sample/Scattering/FormFactorDecoratorRotation.cpp
@@ -45,14 +45,6 @@ double FormFactorDecoratorRotation::topZ(const IRotation* rotation) const
     return m_ff->topZ(total_rotation.get());
 }
 
-complex_t FormFactorDecoratorRotation::theFF(const WavevectorInfo& wavevectors) const
-{
-    std::cout << "DEBUG FFDecPos::theFF, q=" << wavevectors.getQ() << std::endl;
-    std::cout << "  transformed q=" << wavevectors.transformed(m_rotMatrix->getInverse()).getQ()
-         << std::endl;
-    return m_ff->theFF(wavevectors.transformed(m_rotMatrix->getInverse()));
-}
-
 Eigen::Matrix2cd FormFactorDecoratorRotation::thePolFF(const WavevectorInfo& wavevectors) const
 {
     return m_ff->thePolFF(wavevectors.transformed(m_rotMatrix->getInverse()));
diff --git a/Sample/Scattering/FormFactorDecoratorRotation.h b/Sample/Scattering/FormFactorDecoratorRotation.h
index 6f52f90b57a..8ec4ca9a9d6 100644
--- a/Sample/Scattering/FormFactorDecoratorRotation.h
+++ b/Sample/Scattering/FormFactorDecoratorRotation.h
@@ -40,7 +40,6 @@ public:
 
     double topZ(const IRotation* rotation) const override;
 
-    complex_t theFF(const WavevectorInfo& wavevectors) const override;
 #ifndef SWIG
     Eigen::Matrix2cd thePolFF(const WavevectorInfo& wavevectors) const override;
 #endif
diff --git a/auto/Wrap/doxygenSample.i b/auto/Wrap/doxygenSample.i
index 7b0d59104fe..77d3d40c7ce 100644
--- a/auto/Wrap/doxygenSample.i
+++ b/auto/Wrap/doxygenSample.i
@@ -911,11 +911,6 @@ Returns the z-coordinate of the lowest point in this shape after a given rotatio
 Returns the z-coordinate of the lowest point in this shape after a given rotation. 
 ";
 
-%feature("docstring")  FormFactorDecoratorPositionFactor::theFF "complex_t FormFactorDecoratorPositionFactor::theFF(const WavevectorInfo &wavevectors) const override
-
-Returns scattering amplitude for complex wavevectors ki, kf. 
-";
-
 %feature("docstring")  FormFactorDecoratorPositionFactor::thePolFF "Eigen::Matrix2cd FormFactorDecoratorPositionFactor::thePolFF(const WavevectorInfo &wavevectors) const override
 
 Returns scattering amplitude for matrix interactions. 
@@ -952,11 +947,6 @@ Returns the z-coordinate of the lowest point in this shape after a given rotatio
 Returns the z-coordinate of the lowest point in this shape after a given rotation. 
 ";
 
-%feature("docstring")  FormFactorDecoratorRotation::theFF "complex_t FormFactorDecoratorRotation::theFF(const WavevectorInfo &wavevectors) const override
-
-Returns scattering amplitude for complex wavevectors ki, kf. 
-";
-
 %feature("docstring")  FormFactorDecoratorRotation::thePolFF "Eigen::Matrix2cd FormFactorDecoratorRotation::thePolFF(const WavevectorInfo &wavevectors) const override
 
 Returns scattering amplitude for matrix interactions. 
-- 
GitLab