Skip to content
Snippets Groups Projects
Commit e6bced08 authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

Use getDefTransform() to get default position for AXF. Closes #97

parent f2392d69
Branches
Tags
1 merge request!220Use getDefTransform() to get default position for AlignableTransforms
Pipeline #6480162 passed
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
// Added support for "Verbose" output // Added support for "Verbose" output
// - Feb 2023 - R.M.Bianchi <riccardo.maria.bianchi@cern.ch> // - Feb 2023 - R.M.Bianchi <riccardo.maria.bianchi@cern.ch>
// Added 'setLoglevel' method, to steer output messages // Added 'setLoglevel' method, to steer output messages
// - Nov 2023 - R.M.Bianchi <riccardo.maria.bianchi@cern.ch>
// Updated to use the AlignableTransform 'default position',
// which does not include alignment constants
//
// local includes // local includes
#include "GeoModelWrite/WriteGeoModel.h" #include "GeoModelWrite/WriteGeoModel.h"
...@@ -796,22 +800,30 @@ unsigned int WriteGeoModel::storeTranform(const GeoTransform* node) { ...@@ -796,22 +800,30 @@ unsigned int WriteGeoModel::storeTranform(const GeoTransform* node) {
* get the 12 matrix elements * get the 12 matrix elements
*/ */
// Get the 9 rotation coefficients // Get the 9 rotation coefficients
double xx = node->getTransform()(0, 0); // NOTE: we use the 'getDefTransform' method,
double xy = node->getTransform()(0, 1); // instead of the 'getTransform' one,
double xz = node->getTransform()(0, 2); // because we want to get the 'default position'
// for GeoAlignableTransforms.
double yx = node->getTransform()(1, 0); // For GeoAlignableTransform, in fact,
double yy = node->getTransform()(1, 1); // the 'getTransform' method returns the transformation plus
double yz = node->getTransform()(1, 2); // the alignment constants.
// Both methods return the same transform for GeoTransforms.
double zx = node->getTransform()(2, 0); double xx = node->getDefTransform()(0, 0);
double zy = node->getTransform()(2, 1); double xy = node->getDefTransform()(0, 1);
double zz = node->getTransform()(2, 2); double xz = node->getDefTransform()(0, 2);
double yx = node->getDefTransform()(1, 0);
double yy = node->getDefTransform()(1, 1);
double yz = node->getDefTransform()(1, 2);
double zx = node->getDefTransform()(2, 0);
double zy = node->getDefTransform()(2, 1);
double zz = node->getDefTransform()(2, 2);
// Get the 3 translation coefficients // Get the 3 translation coefficients
double dx = node->getTransform()(0, 3); double dx = node->getDefTransform()(0, 3);
double dy = node->getTransform()(1, 3); double dy = node->getDefTransform()(1, 3);
double dz = node->getTransform()(2, 3); double dz = node->getDefTransform()(2, 3);
// Instanciate an Eigen's 3D Transformation // Instanciate an Eigen's 3D Transformation
GeoTrf::Transform3D tr; GeoTrf::Transform3D tr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment