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

#ifndef BORNAGAIN_DEVICE_DATA_TRANSFORMER_H
#define BORNAGAIN_DEVICE_DATA_TRANSFORMER_H

class Datafield;

//! A stub. To be generalized as need arises.

class Transformer {
public:
    Transformer(double wavelength, double alpha_i, double phi_i)
        : m_wavelength(wavelength)
        , m_alpha_i(alpha_i)
        , m_phi_i(phi_i)
    {
    }

    Datafield transformedDatafield(const Datafield& df) const;

#ifndef SWIG
private:
    double m_wavelength;
    double m_alpha_i;
    double m_phi_i;
#endif // SWIG
};

//! Collection of factory functions that return coordinate-frame transformers.
//!
//! As this class only contains static functions, it better were a namespace.
//! However, a class is easier to expose to Swig.

class FrameTrafo {
public:
    static Transformer ScatteringToQ(double wavelength, double alpha_i, double phi_i = 0);
    static Datafield Transpose(const Datafield& df);
};

#endif // BORNAGAIN_DEVICE_DATA_TRANSFORMER_H
