//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Sample/Particle/CoreAndShell.h
//! @brief     Defines CoreAndShell.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifndef BORNAGAIN_SAMPLE_PARTICLE_COREANDSHELL_H
#define BORNAGAIN_SAMPLE_PARTICLE_COREANDSHELL_H

#include "Sample/Particle/IParticle.h"

class Particle;

//! A particle with a core/shell geometry.
//! The core may itself be a nested CoreAndShell to represent onion-like particles.

class CoreAndShell : public IParticle {
public:
    CoreAndShell(const IParticle& core, const Particle& shell);
    ~CoreAndShell() override;

#ifndef SWIG
    CoreAndShell* clone() const override;
    void validate() const override;

    const Particle* shellParticle() const { return m_shell.get(); }
    const IParticle* coreParticle() const { return m_core.get(); }

    void setSliceNumber(size_t n) override;

    double bottomZ() const override;
    double topZ() const override;
    double volumeToAdmix() const override;
    std::unique_ptr<const Material> materialToAdmix() const override;
    double radius() const override;
    double radialExtension() const override;
    bool containsSoftParticle() const override;

    complex_t theFF(const WavevectorInfo& wavevectors) const override;
    SpinMatrix thePolFF(const WavevectorInfo& wavevectors) const override;

    ScatteringMoments scatteringMoments(const DiffuseElement& ele) const override;
    PolScatteringMoments polScatteringMoments(const DiffuseElement& ele) const override;
    ChannelMoments channelMoments(const DwbaChannels& channels) const override;
    PolChannelMoments polChannelMoments(const PolDwbaChannels& channels) const override;

private:
    std::unique_ptr<IParticle> m_core;
    std::unique_ptr<Particle> m_shell;
#endif // SWIG
};

#endif // BORNAGAIN_SAMPLE_PARTICLE_COREANDSHELL_H
