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

sort member fcts

parent f7206401
No related branches found
No related tags found
1 merge request!531cleanup and simplify IParticle and subclasses; rename INode fcts
......@@ -35,6 +35,7 @@ class IRotation;
class IParticle : public ISampleNode {
public:
~IParticle() override;
IParticle* clone() const override = 0;
//! Creates a form factor for this particle
......
......@@ -21,8 +21,6 @@
#include "Sample/Scattering/FormFactorDecoratorPositionFactor.h"
#include "Sample/Scattering/Rotations.h"
Particle::~Particle() = default;
Particle::Particle(Material material, const IFormFactor& form_factor)
: m_material(std::move(material)), m_form_factor(form_factor.clone())
{
......@@ -34,6 +32,8 @@ Particle::Particle(Material material, const IFormFactor& form_factor, const IRot
setRotation(rotation);
}
Particle::~Particle() = default;
Particle* Particle::clone() const
{
ASSERT(m_form_factor);
......@@ -46,6 +46,11 @@ Particle* Particle::clone() const
return p_result;
}
std::vector<const INode*> Particle::nodeChildren() const
{
return std::vector<const INode*>() << IParticle::nodeChildren() << m_form_factor;
}
SlicedParticle Particle::createSlicedParticle(const ZLimits& limits) const
{
ASSERT(m_form_factor);
......@@ -60,8 +65,3 @@ SlicedParticle Particle::createSlicedParticle(const ZLimits& limits) const
sliced_ff->setMaterial(transformed_material);
return {std::move(sliced_ff), {{{volume, transformed_material}}}};
}
std::vector<const INode*> Particle::nodeChildren() const
{
return std::vector<const INode*>() << IParticle::nodeChildren() << m_form_factor;
}
......@@ -23,22 +23,20 @@
class Particle : public IParticle {
public:
std::string className() const override { return "Particle"; }
Particle(Material material, const IFormFactor& form_factor);
Particle(Material material, const IFormFactor& form_factor, const IRotation& rotation);
~Particle() override;
Particle* clone() const override;
SlicedParticle createSlicedParticle(const ZLimits& limits) const override;
std::string className() const override { return "Particle"; }
std::vector<const INode*> nodeChildren() const override;
const Material* material() const override { return &m_material; }
std::vector<const INode*> nodeChildren() const override;
const IFormFactor* formFactor() const { return m_form_factor.get(); }
SlicedParticle createSlicedParticle(const ZLimits& limits) const override;
private:
const Material m_material;
std::unique_ptr<const IFormFactor> m_form_factor;
......
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