//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Sample/Aggregate/LongRangeOrdered2D.h
//! @brief     Defines and implements the interface class LongRangeOrdered2D.
//!
//! @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_AGGREGATE_LONGRANGEORDERED2D_H
#define BORNAGAIN_SAMPLE_AGGREGATE_LONGRANGEORDERED2D_H

#include "Sample/Aggregate/Ordered2D.h"

//! Base class for crystal-like long-range order planar structures.
//! Contains in-plane position variance.
class LongRangeOrdered2D : public virtual Ordered2D {
protected:
    LongRangeOrdered2D(const IParticle& particle, double lateral_var);

public:
    ~LongRangeOrdered2D() override;

    //! Sets the variance of the lateral position for the calculation of the DW factor
    //! It is defined as the rms variance in each relevant dimension
    void setLateralPositionVariance(double var);

#ifndef SWIG
    std::string className() const override { return "LongRangeOrdered2D"; }

    //! Returns the in-plane position variance
    double lateralPositionVariance() const { return m_lateral_pos_var; }

    //! structureFactors the Debye-Waller factor for a given wavevector transfer
    double DWfactor(R3 q) const override;

protected:
    void instructLRClone(LongRangeOrdered2D* dest) const;

    double m_lateral_pos_var;
#endif // SWIG
};

#endif // BORNAGAIN_SAMPLE_AGGREGATE_LONGRANGEORDERED2D_H
