From 58da295101fd3eb0dc1ff45d8f57be2f0a0d1de6 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Wed, 8 Dec 2021 15:06:10 +0100
Subject: [PATCH] rename transformed -> rotated

---
 GUI/Model/From/GUISampleBuilder.cpp   |  2 +-
 Sample/Lattice/Lattice3D.cpp          |  8 ++--
 Sample/Lattice/Lattice3D.h            |  4 +-
 Sample/Particle/Crystal.cpp           |  8 ++--
 Sample/Particle/Crystal.h             |  2 +-
 Tests/Unit/Sample/LatticeTest.cpp     |  4 +-
 auto/Wrap/doxygenSample.i             |  6 +--
 auto/Wrap/libBornAgainSample.py       | 18 ++++-----
 auto/Wrap/libBornAgainSample_wrap.cpp | 54 +++++++++++++--------------
 9 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/GUI/Model/From/GUISampleBuilder.cpp b/GUI/Model/From/GUISampleBuilder.cpp
index 10f31c55327..56cd8f585dc 100644
--- a/GUI/Model/From/GUISampleBuilder.cpp
+++ b/GUI/Model/From/GUISampleBuilder.cpp
@@ -149,7 +149,7 @@ void GUISampleBuilder::copyParticle(const IParticle* iparticle,
         FromDomain::setFormFactor(mesoItem, meso->outerShape());
         FromDomain::setRotation(mesoItem, meso->rotation());
 
-        auto lattice = meso->particleStructure().transformedLattice();
+        auto lattice = meso->particleStructure().rotatedLattice();
         mesoItem->setVectorA(lattice.getBasisVectorA());
         mesoItem->setVectorB(lattice.getBasisVectorB());
         mesoItem->setVectorC(lattice.getBasisVectorC());
diff --git a/Sample/Lattice/Lattice3D.cpp b/Sample/Lattice/Lattice3D.cpp
index ce95e1d765e..ec17a00adf1 100644
--- a/Sample/Lattice/Lattice3D.cpp
+++ b/Sample/Lattice/Lattice3D.cpp
@@ -31,11 +31,11 @@ Lattice3D::Lattice3D(const Lattice3D& lattice) : Lattice3D(lattice.m_a, lattice.
 
 Lattice3D::~Lattice3D() = default;
 
-Lattice3D Lattice3D::transformed(const RotMatrix& transform) const
+Lattice3D Lattice3D::rotated(const RotMatrix& rotMatrix) const
 {
-    R3 q1 = transform.transformed(m_a);
-    R3 q2 = transform.transformed(m_b);
-    R3 q3 = transform.transformed(m_c);
+    R3 q1 = rotMatrix.transformed(m_a);
+    R3 q2 = rotMatrix.transformed(m_b);
+    R3 q3 = rotMatrix.transformed(m_c);
     Lattice3D result = {q1, q2, q3};
     if (m_selection_rule)
         result.setSelectionRule(*m_selection_rule);
diff --git a/Sample/Lattice/Lattice3D.h b/Sample/Lattice/Lattice3D.h
index 2fb174a29b9..30db2c1f3c9 100644
--- a/Sample/Lattice/Lattice3D.h
+++ b/Sample/Lattice/Lattice3D.h
@@ -37,8 +37,8 @@ public:
     ~Lattice3D() override;
     Lattice3D& operator=(const Lattice3D&) = delete;
 
-    //! Creates transformed lattice
-    Lattice3D transformed(const RotMatrix& transform) const;
+    //! Creates rotated lattice
+    Lattice3D rotated(const RotMatrix& rotMatrix) const;
 
     //! Returns basis vector a
     R3 getBasisVectorA() const { return m_a; }
diff --git a/Sample/Particle/Crystal.cpp b/Sample/Particle/Crystal.cpp
index d011422b412..20c137052dc 100644
--- a/Sample/Particle/Crystal.cpp
+++ b/Sample/Particle/Crystal.cpp
@@ -42,13 +42,13 @@ Crystal* Crystal::clone() const
 IFormFactor* Crystal::createTotalFormFactor(const IFormFactor& meso_crystal_form_factor,
                                             const IRotation* rotation, const R3& translation) const
 {
-    Lattice3D transformed_lattice = transformedLattice(rotation);
+    Lattice3D rotated_lattice = rotatedLattice(rotation);
     std::unique_ptr<IParticle> basis_clone{m_basis->clone()};
     if (rotation)
         basis_clone->rotate(*rotation);
     basis_clone->translate(translation);
     const std::unique_ptr<IFormFactor> basis_ff(basis_clone->createFormFactor());
-    return new FormFactorCrystal(transformed_lattice, *basis_ff, meso_crystal_form_factor,
+    return new FormFactorCrystal(rotated_lattice, *basis_ff, meso_crystal_form_factor,
                                  m_position_variance);
 }
 
@@ -70,11 +70,11 @@ Admixtures Crystal::admixtures() const
     return result;
 }
 
-Lattice3D Crystal::transformedLattice(const IRotation* rotation) const
+Lattice3D Crystal::rotatedLattice(const IRotation* rotation) const
 {
     if (!rotation)
         return m_lattice;
-    return m_lattice.transformed(rotation->getRotMatrix());
+    return m_lattice.rotated(rotation->getRotMatrix());
 }
 
 std::vector<const INode*> Crystal::getChildren() const
diff --git a/Sample/Particle/Crystal.h b/Sample/Particle/Crystal.h
index b33e4d2c6cc..e7926a1f3a1 100644
--- a/Sample/Particle/Crystal.h
+++ b/Sample/Particle/Crystal.h
@@ -48,7 +48,7 @@ public:
 
     Admixtures admixtures() const;
 
-    Lattice3D transformedLattice(const IRotation* rotation = nullptr) const;
+    Lattice3D rotatedLattice(const IRotation* rotation = nullptr) const; // TODO provide Py example
 
     std::vector<const INode*> getChildren() const override;
     const IParticle* basis() const;
diff --git a/Tests/Unit/Sample/LatticeTest.cpp b/Tests/Unit/Sample/LatticeTest.cpp
index f2d01aef345..2670b84c430 100644
--- a/Tests/Unit/Sample/LatticeTest.cpp
+++ b/Tests/Unit/Sample/LatticeTest.cpp
@@ -42,7 +42,7 @@ TEST_F(LatticeTest, reciprocalTest)
     EXPECT_EQ(m_rc, b3);
 }
 
-// tests whether Lattice has been transformed correctly
+// tests whether Lattice has been rotated correctly
 TEST_F(LatticeTest, transformTest)
 {
     R3 a1(1, 0, 0);
@@ -52,7 +52,7 @@ TEST_F(LatticeTest, transformTest)
 
     // use rotation by 90 degrees around z axis as a transformation
     RotMatrix tr = RotMatrix::createRotateZ(M_TWOPI / 4);
-    Lattice3D ltr = l1.transformed(tr);
+    Lattice3D ltr = l1.rotated(tr);
 
     // use EXPECT_NEAR as transform (matrix multiplication) uses double value for rotation angle
     // e.g. Rotating the vector (1,0,0) by 2*PI about z would give something like (0.99999,0,0)
diff --git a/auto/Wrap/doxygenSample.i b/auto/Wrap/doxygenSample.i
index c3d3ef4d8c2..5bd447167d9 100644
--- a/auto/Wrap/doxygenSample.i
+++ b/auto/Wrap/doxygenSample.i
@@ -175,7 +175,7 @@ Returns a clone of this  ISampleNode object.
 %feature("docstring")  Crystal::admixtures "Admixtures Crystal::admixtures() const
 ";
 
-%feature("docstring")  Crystal::transformedLattice "Lattice3D Crystal::transformedLattice(const IRotation *rotation=nullptr) const
+%feature("docstring")  Crystal::rotatedLattice "Lattice3D Crystal::rotatedLattice(const IRotation *rotation=nullptr) const
 ";
 
 %feature("docstring")  Crystal::getChildren "std::vector< const INode * > Crystal::getChildren() const override
@@ -3905,9 +3905,9 @@ C++ includes: Lattice3D.h
 %feature("docstring")  Lattice3D::~Lattice3D "Lattice3D::~Lattice3D() override
 ";
 
-%feature("docstring")  Lattice3D::transformed "Lattice3D Lattice3D::transformed(const RotMatrix &transform) const
+%feature("docstring")  Lattice3D::rotated "Lattice3D Lattice3D::rotated(const RotMatrix &rotMatrix) const
 
-Creates transformed lattice. 
+Creates rotated lattice. 
 ";
 
 %feature("docstring")  Lattice3D::getBasisVectorA "R3 Lattice3D::getBasisVectorA() const
diff --git a/auto/Wrap/libBornAgainSample.py b/auto/Wrap/libBornAgainSample.py
index 209e72d1a02..51c04b8353f 100644
--- a/auto/Wrap/libBornAgainSample.py
+++ b/auto/Wrap/libBornAgainSample.py
@@ -4282,13 +4282,13 @@ class Crystal(ISampleNode):
         """
         return _libBornAgainSample.Crystal_admixtures(self)
 
-    def transformedLattice(self, rotation=None):
+    def rotatedLattice(self, rotation=None):
         r"""
-        transformedLattice(Crystal self, IRotation rotation=None) -> Lattice3D
-        Lattice3D Crystal::transformedLattice(const IRotation *rotation=nullptr) const
+        rotatedLattice(Crystal self, IRotation rotation=None) -> Lattice3D
+        Lattice3D Crystal::rotatedLattice(const IRotation *rotation=nullptr) const
 
         """
-        return _libBornAgainSample.Crystal_transformedLattice(self, rotation)
+        return _libBornAgainSample.Crystal_rotatedLattice(self, rotation)
 
     def getChildren(self):
         r"""
@@ -11071,15 +11071,15 @@ class Lattice3D(libBornAgainParam.INode):
         _libBornAgainSample.Lattice3D_swiginit(self, _libBornAgainSample.new_Lattice3D(*args))
     __swig_destroy__ = _libBornAgainSample.delete_Lattice3D
 
-    def transformed(self, transform):
+    def rotated(self, rotMatrix):
         r"""
-        transformed(Lattice3D self, RotMatrix transform) -> Lattice3D
-        Lattice3D Lattice3D::transformed(const RotMatrix &transform) const
+        rotated(Lattice3D self, RotMatrix rotMatrix) -> Lattice3D
+        Lattice3D Lattice3D::rotated(const RotMatrix &rotMatrix) const
 
-        Creates transformed lattice. 
+        Creates rotated lattice. 
 
         """
-        return _libBornAgainSample.Lattice3D_transformed(self, transform)
+        return _libBornAgainSample.Lattice3D_rotated(self, rotMatrix)
 
     def getBasisVectorA(self):
         r"""
diff --git a/auto/Wrap/libBornAgainSample_wrap.cpp b/auto/Wrap/libBornAgainSample_wrap.cpp
index 9b346171e8b..905f7f8ab7f 100644
--- a/auto/Wrap/libBornAgainSample_wrap.cpp
+++ b/auto/Wrap/libBornAgainSample_wrap.cpp
@@ -43104,7 +43104,7 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_Crystal_transformedLattice__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
+SWIGINTERN PyObject *_wrap_Crystal_rotatedLattice__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
   PyObject *resultobj = 0;
   Crystal *arg1 = (Crystal *) 0 ;
   IRotation *arg2 = (IRotation *) 0 ;
@@ -43117,15 +43117,15 @@ SWIGINTERN PyObject *_wrap_Crystal_transformedLattice__SWIG_0(PyObject *SWIGUNUS
   if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Crystal, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Crystal_transformedLattice" "', argument " "1"" of type '" "Crystal const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Crystal_rotatedLattice" "', argument " "1"" of type '" "Crystal const *""'"); 
   }
   arg1 = reinterpret_cast< Crystal * >(argp1);
   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_IRotation, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Crystal_transformedLattice" "', argument " "2"" of type '" "IRotation const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Crystal_rotatedLattice" "', argument " "2"" of type '" "IRotation const *""'"); 
   }
   arg2 = reinterpret_cast< IRotation * >(argp2);
-  result = ((Crystal const *)arg1)->transformedLattice((IRotation const *)arg2);
+  result = ((Crystal const *)arg1)->rotatedLattice((IRotation const *)arg2);
   resultobj = SWIG_NewPointerObj((new Lattice3D(static_cast< const Lattice3D& >(result))), SWIGTYPE_p_Lattice3D, SWIG_POINTER_OWN |  0 );
   return resultobj;
 fail:
@@ -43133,7 +43133,7 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_Crystal_transformedLattice__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
+SWIGINTERN PyObject *_wrap_Crystal_rotatedLattice__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) {
   PyObject *resultobj = 0;
   Crystal *arg1 = (Crystal *) 0 ;
   void *argp1 = 0 ;
@@ -43143,10 +43143,10 @@ SWIGINTERN PyObject *_wrap_Crystal_transformedLattice__SWIG_1(PyObject *SWIGUNUS
   if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Crystal, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Crystal_transformedLattice" "', argument " "1"" of type '" "Crystal const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Crystal_rotatedLattice" "', argument " "1"" of type '" "Crystal const *""'"); 
   }
   arg1 = reinterpret_cast< Crystal * >(argp1);
-  result = ((Crystal const *)arg1)->transformedLattice();
+  result = ((Crystal const *)arg1)->rotatedLattice();
   resultobj = SWIG_NewPointerObj((new Lattice3D(static_cast< const Lattice3D& >(result))), SWIGTYPE_p_Lattice3D, SWIG_POINTER_OWN |  0 );
   return resultobj;
 fail:
@@ -43154,13 +43154,13 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_Crystal_transformedLattice(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_Crystal_rotatedLattice(PyObject *self, PyObject *args) {
   Py_ssize_t argc;
   PyObject *argv[3] = {
     0
   };
   
-  if (!(argc = SWIG_Python_UnpackTuple(args, "Crystal_transformedLattice", 0, 2, argv))) SWIG_fail;
+  if (!(argc = SWIG_Python_UnpackTuple(args, "Crystal_rotatedLattice", 0, 2, argv))) SWIG_fail;
   --argc;
   if (argc == 1) {
     int _v;
@@ -43168,7 +43168,7 @@ SWIGINTERN PyObject *_wrap_Crystal_transformedLattice(PyObject *self, PyObject *
     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Crystal, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
-      return _wrap_Crystal_transformedLattice__SWIG_1(self, argc, argv);
+      return _wrap_Crystal_rotatedLattice__SWIG_1(self, argc, argv);
     }
   }
   if (argc == 2) {
@@ -43181,16 +43181,16 @@ SWIGINTERN PyObject *_wrap_Crystal_transformedLattice(PyObject *self, PyObject *
       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_IRotation, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
-        return _wrap_Crystal_transformedLattice__SWIG_0(self, argc, argv);
+        return _wrap_Crystal_rotatedLattice__SWIG_0(self, argc, argv);
       }
     }
   }
   
 fail:
-  SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Crystal_transformedLattice'.\n"
+  SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Crystal_rotatedLattice'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    Crystal::transformedLattice(IRotation const *) const\n"
-    "    Crystal::transformedLattice() const\n");
+    "    Crystal::rotatedLattice(IRotation const *) const\n"
+    "    Crystal::rotatedLattice() const\n");
   return 0;
 }
 
@@ -65978,7 +65978,7 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_Lattice3D_transformed(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_Lattice3D_rotated(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   Lattice3D *arg1 = (Lattice3D *) 0 ;
   RotMatrix *arg2 = 0 ;
@@ -65989,21 +65989,21 @@ SWIGINTERN PyObject *_wrap_Lattice3D_transformed(PyObject *SWIGUNUSEDPARM(self),
   PyObject *swig_obj[2] ;
   SwigValueWrapper< Lattice3D > result;
   
-  if (!SWIG_Python_UnpackTuple(args, "Lattice3D_transformed", 2, 2, swig_obj)) SWIG_fail;
+  if (!SWIG_Python_UnpackTuple(args, "Lattice3D_rotated", 2, 2, swig_obj)) SWIG_fail;
   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Lattice3D, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice3D_transformed" "', argument " "1"" of type '" "Lattice3D const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice3D_rotated" "', argument " "1"" of type '" "Lattice3D const *""'"); 
   }
   arg1 = reinterpret_cast< Lattice3D * >(argp1);
   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_RotMatrix,  0  | 0);
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Lattice3D_transformed" "', argument " "2"" of type '" "RotMatrix const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Lattice3D_rotated" "', argument " "2"" of type '" "RotMatrix const &""'"); 
   }
   if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Lattice3D_transformed" "', argument " "2"" of type '" "RotMatrix const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Lattice3D_rotated" "', argument " "2"" of type '" "RotMatrix const &""'"); 
   }
   arg2 = reinterpret_cast< RotMatrix * >(argp2);
-  result = ((Lattice3D const *)arg1)->transformed((RotMatrix const &)*arg2);
+  result = ((Lattice3D const *)arg1)->rotated((RotMatrix const &)*arg2);
   resultobj = SWIG_NewPointerObj((new Lattice3D(static_cast< const Lattice3D& >(result))), SWIGTYPE_p_Lattice3D, SWIG_POINTER_OWN |  0 );
   return resultobj;
 fail:
@@ -69184,9 +69184,9 @@ static PyMethodDef SwigMethods[] = {
 		"Admixtures Crystal::admixtures() const\n"
 		"\n"
 		""},
-	 { "Crystal_transformedLattice", _wrap_Crystal_transformedLattice, METH_VARARGS, "\n"
-		"Crystal_transformedLattice(Crystal self, IRotation rotation=None) -> Lattice3D\n"
-		"Lattice3D Crystal::transformedLattice(const IRotation *rotation=nullptr) const\n"
+	 { "Crystal_rotatedLattice", _wrap_Crystal_rotatedLattice, METH_VARARGS, "\n"
+		"Crystal_rotatedLattice(Crystal self, IRotation rotation=None) -> Lattice3D\n"
+		"Lattice3D Crystal::rotatedLattice(const IRotation *rotation=nullptr) const\n"
 		"\n"
 		""},
 	 { "Crystal_getChildren", _wrap_Crystal_getChildren, METH_O, "\n"
@@ -72945,11 +72945,11 @@ static PyMethodDef SwigMethods[] = {
 		"Lattice3D::~Lattice3D() override\n"
 		"\n"
 		""},
-	 { "Lattice3D_transformed", _wrap_Lattice3D_transformed, METH_VARARGS, "\n"
-		"Lattice3D_transformed(Lattice3D self, RotMatrix transform) -> Lattice3D\n"
-		"Lattice3D Lattice3D::transformed(const RotMatrix &transform) const\n"
+	 { "Lattice3D_rotated", _wrap_Lattice3D_rotated, METH_VARARGS, "\n"
+		"Lattice3D_rotated(Lattice3D self, RotMatrix rotMatrix) -> Lattice3D\n"
+		"Lattice3D Lattice3D::rotated(const RotMatrix &rotMatrix) const\n"
 		"\n"
-		"Creates transformed lattice. \n"
+		"Creates rotated lattice. \n"
 		"\n"
 		""},
 	 { "Lattice3D_getBasisVectorA", _wrap_Lattice3D_getBasisVectorA, METH_O, "\n"
-- 
GitLab