From 8ab40d034a9034673dfa2c914c9ca2bd400e561c Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de>
Date: Fri, 25 Aug 2023 13:09:31 +0200
Subject: [PATCH] + file/class FrameTrafo

---
 Base/Axis/FrameTrafo.cpp | 23 +++++++++++++++++++++++
 Base/Axis/FrameTrafo.h   | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 Base/Axis/FrameTrafo.cpp
 create mode 100644 Base/Axis/FrameTrafo.h

diff --git a/Base/Axis/FrameTrafo.cpp b/Base/Axis/FrameTrafo.cpp
new file mode 100644
index 00000000000..98e7dfdab14
--- /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 00000000000..c2155d0366d
--- /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
-- 
GitLab