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

+ debmsg

parent 662ece38
No related branches found
No related tags found
1 merge request!560Resolve Decorator Pattern in IFormFactor hierarchy
......@@ -15,6 +15,7 @@
#include "Sample/Particle/IParticle.h"
#include "Sample/Particle/ParticleInSlice.h"
#include "Sample/Scattering/Rotations.h"
#include <iostream>
IParticle::~IParticle() = default;
......@@ -66,5 +67,7 @@ std::vector<std::unique_ptr<IParticle>> IParticle::decompose() const
ZLimits IParticle::zSpan() const
{
std::unique_ptr<IFormFactor> ff(createFormFactor());
std::cout << "DEBUG IParticle::zSpan " << ff->bottomZ(nullptr)
<< " to " << ff->topZ(nullptr) << std::endl;
return {ff->bottomZ(nullptr), ff->topZ(nullptr)};
}
......@@ -98,6 +98,7 @@ complex_t DecoratedFF::theFF(const WavevectorInfo& wavevectors) const
- m_ambient_material->scalarSubtrSLD(wavevectors2)) * result;
if (m_position)
result *= exp_I(m_position->dot(wavevectors.getQ()));
std::cout << "DEBUG DFF::thePol " << result << std::endl;
return result;
}
......@@ -132,6 +133,7 @@ double DecoratedFF::bottomZ(const IRotation* rotation) const
double result = m_ff->bottomZ(total_rotation.get());
if (m_position)
result += (rotation ? rotation->transformed(*m_position) : *m_position).z();
std::cout << "DEBUG DFF::botZ " << result << std::endl;
return result;
}
......@@ -144,5 +146,6 @@ double DecoratedFF::topZ(const IRotation* rotation) const
double result = m_ff->topZ(total_rotation.get());
if (m_position)
result += (rotation ? rotation->transformed(*m_position) : *m_position).z();
std::cout << "DEBUG DFF::topZ " << result << std::endl;
return result;
}
......@@ -18,6 +18,7 @@
#include "Base/Vector/WavevectorInfo.h"
#include "Sample/Scattering/Rotations.h"
#include "Sample/Shapes/IShape3D.h"
#include <iostream>
#include <stdexcept>
namespace {
......@@ -66,14 +67,18 @@ double IBornFF::bottomZ(const IRotation* rotation) const
{
if (!m_shape3D)
throw std::runtime_error("Bug: Form factor has no m_shape3D, cannot compute bottom z");
return BottomZ(m_shape3D->vertices(), rotation);
double result = BottomZ(m_shape3D->vertices(), rotation);
std::cout << "DEBUG IBornFF::botZ " << result << std::endl;
return result;
}
double IBornFF::topZ(const IRotation* rotation) const
{
if (!m_shape3D)
throw std::runtime_error("Bug: Form factor has no m_shape3D, cannot compute top z");
return TopZ(m_shape3D->vertices(), rotation);
double result = TopZ(m_shape3D->vertices(), rotation);
std::cout << "DEBUG IBornFF::topZ " << result << std::endl;
return result;
}
bool IBornFF::canSliceAnalytically(const IRotation* rotation) const
......
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