From 5b4471a9523c1cae237dbec13504ec5c2882e740 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Sat, 28 May 2022 11:57:33 +0200 Subject: [PATCH] rename fct --- Base/Vector/RotMatrix.cpp | 2 +- Base/Vector/RotMatrix.h | 2 +- Sample/Scattering/Rotations.cpp | 2 +- Sim/Export/SampleToPython.cpp | 2 +- Tests/Unit/Base/RotMatrixTest.cpp | 2 +- auto/Wrap/doxygenBase.i | 2 +- auto/Wrap/libBornAgainBase.py | 8 ++++---- auto/Wrap/libBornAgainBase_wrap.cpp | 20 ++++++++++---------- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Base/Vector/RotMatrix.cpp b/Base/Vector/RotMatrix.cpp index fabd2b35be0..dfda6287c44 100644 --- a/Base/Vector/RotMatrix.cpp +++ b/Base/Vector/RotMatrix.cpp @@ -52,7 +52,7 @@ RotMatrix RotMatrix::createRotateEuler(double alpha, double beta, double gamma) return zrot * xrot * zrot2; } -void RotMatrix::calculateEulerAngles(double* p_alpha, double* p_beta, double* p_gamma) const +void RotMatrix::zxzEulerAngles(double* p_alpha, double* p_beta, double* p_gamma) const { double m00 = (-1 + 2 * x * x + 2 * s * s); double m02 = 2 * (x * z + y * s); diff --git a/Base/Vector/RotMatrix.h b/Base/Vector/RotMatrix.h index 7cb72b5e06f..a1918022400 100644 --- a/Base/Vector/RotMatrix.h +++ b/Base/Vector/RotMatrix.h @@ -45,7 +45,7 @@ public: static RotMatrix createRotateEuler(double alpha, double beta, double gamma); //! Calculates the Euler angles corresponding to the rotation - void calculateEulerAngles(double* p_alpha, double* p_beta, double* p_gamma) const; + void zxzEulerAngles(double* p_alpha, double* p_beta, double* p_gamma) const; //! Calculates the rotation angle for a rotation around the x-axis alone //! Only meaningfull if the actual rotation is around the x-axis diff --git a/Sample/Scattering/Rotations.cpp b/Sample/Scattering/Rotations.cpp index 8103317b92a..d05558413e9 100644 --- a/Sample/Scattering/Rotations.cpp +++ b/Sample/Scattering/Rotations.cpp @@ -43,7 +43,7 @@ IRotation* IRotation::createRotation(const RotMatrix& transform) } case RotMatrix::EULER: { double alpha, beta, gamma; - transform.calculateEulerAngles(&alpha, &beta, &gamma); + transform.zxzEulerAngles(&alpha, &beta, &gamma); return new RotationEuler(alpha, beta, gamma); } } diff --git a/Sim/Export/SampleToPython.cpp b/Sim/Export/SampleToPython.cpp index 44480919457..2db2fedd5b1 100644 --- a/Sim/Export/SampleToPython.cpp +++ b/Sim/Export/SampleToPython.cpp @@ -47,7 +47,7 @@ void setRotationInformation(const IParticle* particle, std::string name, std::os switch (particle->rotation()->rotMatrix().getRotationType()) { case RotMatrix::EULER: { double alpha, beta, gamma; - particle->rotation()->rotMatrix().calculateEulerAngles(&alpha, &beta, &gamma); + particle->rotation()->rotMatrix().zxzEulerAngles(&alpha, &beta, &gamma); result << indent() << name << "_rotation = ba.RotationEuler(" << Py::Fmt::printDegrees(alpha) << ", " << Py::Fmt::printDegrees(beta) << ", " << Py::Fmt::printDegrees(gamma) << ")\n"; diff --git a/Tests/Unit/Base/RotMatrixTest.cpp b/Tests/Unit/Base/RotMatrixTest.cpp index 9d105f3dcf1..640eda4209d 100644 --- a/Tests/Unit/Base/RotMatrixTest.cpp +++ b/Tests/Unit/Base/RotMatrixTest.cpp @@ -58,7 +58,7 @@ TEST_F(RotMatrixTest, RotateZ) TEST_F(RotMatrixTest, RecoverEulerAngles) { double p0, p1, p2; - mEul.calculateEulerAngles(&p0, &p1, &p2); + mEul.zxzEulerAngles(&p0, &p1, &p2); EXPECT_NEAR(p0, w0, epsilon); EXPECT_NEAR(p1, w1, epsilon); diff --git a/auto/Wrap/doxygenBase.i b/auto/Wrap/doxygenBase.i index 74ac327b5f5..e6e34a9e537 100644 --- a/auto/Wrap/doxygenBase.i +++ b/auto/Wrap/doxygenBase.i @@ -1013,7 +1013,7 @@ Destructor. Clones the transformation. "; -%feature("docstring") RotMatrix::calculateEulerAngles "void RotMatrix::calculateEulerAngles(double *p_alpha, double *p_beta, double *p_gamma) const +%feature("docstring") RotMatrix::zxzEulerAngles "void RotMatrix::zxzEulerAngles(double *p_alpha, double *p_beta, double *p_gamma) const Calculates the Euler angles corresponding to the rotation. "; diff --git a/auto/Wrap/libBornAgainBase.py b/auto/Wrap/libBornAgainBase.py index dd248d00894..8465b4415d5 100644 --- a/auto/Wrap/libBornAgainBase.py +++ b/auto/Wrap/libBornAgainBase.py @@ -1936,15 +1936,15 @@ class RotMatrix(object): r"""createRotateEuler(double alpha, double beta, double gamma) -> RotMatrix""" return _libBornAgainBase.RotMatrix_createRotateEuler(alpha, beta, gamma) - def calculateEulerAngles(self, p_alpha, p_beta, p_gamma): + def zxzEulerAngles(self, p_alpha, p_beta, p_gamma): r""" - calculateEulerAngles(RotMatrix self, double * p_alpha, double * p_beta, double * p_gamma) - void RotMatrix::calculateEulerAngles(double *p_alpha, double *p_beta, double *p_gamma) const + zxzEulerAngles(RotMatrix self, double * p_alpha, double * p_beta, double * p_gamma) + void RotMatrix::zxzEulerAngles(double *p_alpha, double *p_beta, double *p_gamma) const Calculates the Euler angles corresponding to the rotation. """ - return _libBornAgainBase.RotMatrix_calculateEulerAngles(self, p_alpha, p_beta, p_gamma) + return _libBornAgainBase.RotMatrix_zxzEulerAngles(self, p_alpha, p_beta, p_gamma) def calculateRotateXAngle(self): r""" diff --git a/auto/Wrap/libBornAgainBase_wrap.cpp b/auto/Wrap/libBornAgainBase_wrap.cpp index b3cd808d8cf..61b66fbf2b4 100644 --- a/auto/Wrap/libBornAgainBase_wrap.cpp +++ b/auto/Wrap/libBornAgainBase_wrap.cpp @@ -24773,7 +24773,7 @@ fail: } -SWIGINTERN PyObject *_wrap_RotMatrix_calculateEulerAngles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_RotMatrix_zxzEulerAngles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; RotMatrix *arg1 = (RotMatrix *) 0 ; double *arg2 = (double *) 0 ; @@ -24789,28 +24789,28 @@ SWIGINTERN PyObject *_wrap_RotMatrix_calculateEulerAngles(PyObject *SWIGUNUSEDPA int res4 = 0 ; PyObject *swig_obj[4] ; - if (!SWIG_Python_UnpackTuple(args, "RotMatrix_calculateEulerAngles", 4, 4, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "RotMatrix_zxzEulerAngles", 4, 4, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RotMatrix, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RotMatrix_calculateEulerAngles" "', argument " "1"" of type '" "RotMatrix const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RotMatrix_zxzEulerAngles" "', argument " "1"" of type '" "RotMatrix const *""'"); } arg1 = reinterpret_cast< RotMatrix * >(argp1); res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_double, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RotMatrix_calculateEulerAngles" "', argument " "2"" of type '" "double *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RotMatrix_zxzEulerAngles" "', argument " "2"" of type '" "double *""'"); } arg2 = reinterpret_cast< double * >(argp2); res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_double, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RotMatrix_calculateEulerAngles" "', argument " "3"" of type '" "double *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RotMatrix_zxzEulerAngles" "', argument " "3"" of type '" "double *""'"); } arg3 = reinterpret_cast< double * >(argp3); res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_double, 0 | 0 ); if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RotMatrix_calculateEulerAngles" "', argument " "4"" of type '" "double *""'"); + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RotMatrix_zxzEulerAngles" "', argument " "4"" of type '" "double *""'"); } arg4 = reinterpret_cast< double * >(argp4); - ((RotMatrix const *)arg1)->calculateEulerAngles(arg2,arg3,arg4); + ((RotMatrix const *)arg1)->zxzEulerAngles(arg2,arg3,arg4); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -30133,9 +30133,9 @@ static PyMethodDef SwigMethods[] = { { "RotMatrix_createRotateY", _wrap_RotMatrix_createRotateY, METH_O, "RotMatrix_createRotateY(double phi) -> RotMatrix"}, { "RotMatrix_createRotateZ", _wrap_RotMatrix_createRotateZ, METH_O, "RotMatrix_createRotateZ(double phi) -> RotMatrix"}, { "RotMatrix_createRotateEuler", _wrap_RotMatrix_createRotateEuler, METH_VARARGS, "RotMatrix_createRotateEuler(double alpha, double beta, double gamma) -> RotMatrix"}, - { "RotMatrix_calculateEulerAngles", _wrap_RotMatrix_calculateEulerAngles, METH_VARARGS, "\n" - "RotMatrix_calculateEulerAngles(RotMatrix self, double * p_alpha, double * p_beta, double * p_gamma)\n" - "void RotMatrix::calculateEulerAngles(double *p_alpha, double *p_beta, double *p_gamma) const\n" + { "RotMatrix_zxzEulerAngles", _wrap_RotMatrix_zxzEulerAngles, METH_VARARGS, "\n" + "RotMatrix_zxzEulerAngles(RotMatrix self, double * p_alpha, double * p_beta, double * p_gamma)\n" + "void RotMatrix::zxzEulerAngles(double *p_alpha, double *p_beta, double *p_gamma) const\n" "\n" "Calculates the Euler angles corresponding to the rotation. \n" "\n" -- GitLab