diff --git a/Base/Axis/FrameTrafo.cpp b/Base/Axis/FrameTrafo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..98e7dfdab146c0f224854443532631142618dbb4 --- /dev/null +++ b/Base/Axis/FrameTrafo.cpp @@ -0,0 +1,23 @@ +// ************************************************************************************************ +// +// BornAgain: simulate and fit reflection and scattering +// +//! @file Base/Axis/FrameTrafo.cpp +//! @brief Implements class FrameTrafo. +//! +//! @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) +// +// ************************************************************************************************ + +#include "Base/Axis/FrameTrafo.h" +#include "Base/Axis/Coordinate.h" + +FrameTrafo::~FrameTrafo() = default; + +FrameTrafo* FrameTrafo::clone() const +{ + return new FrameTrafo(*this); +} diff --git a/Base/Axis/FrameTrafo.h b/Base/Axis/FrameTrafo.h new file mode 100644 index 0000000000000000000000000000000000000000..c2155d0366d3e60acbc5a4b1ceff35e1b5e8bf66 --- /dev/null +++ b/Base/Axis/FrameTrafo.h @@ -0,0 +1,37 @@ +// ************************************************************************************************ +// +// BornAgain: simulate and fit reflection and scattering +// +//! @file Base/Axis/FrameTrafo.h +//! @brief Defines class FrameTrafo. +//! +//! @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_BASE_AXIS_FRAMETRAFO_H +#define BORNAGAIN_BASE_AXIS_FRAMETRAFO_H + +#include <functional> +#include <string> + +class Coordinate; + +using trafo_t = std::function<double(double)>; + +//! One specific transform of frame coordinates. + +class FrameTrafo { +public: + ~FrameTrafo(); + FrameTrafo* clone() const; + std::string name; + std::vector<Coordinate> coords; + std::vector<trafo_t> axTrafos; + bool xMirror{false}; +}; + +#endif // BORNAGAIN_BASE_AXIS_FRAMETRAFO_H