19 j[
"translation"] = tdata;
21 j[
"translation"] = nlohmann::json();
24 auto rotation = t.rotation();
25 if (rotation != Acts::RotationMatrix3::Identity()) {
26 std::array<Acts::ActsScalar, 9> rdata = {
27 rotation(0, 0), rotation(0, 1), rotation(0, 2),
28 rotation(1, 0), rotation(1, 1), rotation(1, 2),
29 rotation(2, 0), rotation(2, 1), rotation(2, 2)};
30 j[
"rotation"] = rdata;
32 j[
"rotation"] = nlohmann::json();
37 t = Acts::Transform3::Identity();
38 if (j.find(
"rotation") != j.end() and not j[
"rotation"].empty()) {
39 std::array<Acts::ActsScalar, 9> rdata = j[
"rotation"];
41 rot << rdata[0], rdata[1], rdata[2], rdata[3], rdata[4], rdata[5], rdata[6],
45 if (j.find(
"translation") != j.end() and not j[
"translation"].empty()) {
46 std::array<Acts::ActsScalar, 3> tdata = j[
"translation"];
53 nlohmann::json jTransform;
59 jTransform[
"translation"] = tdata;
61 jTransform[
"translation"] = nlohmann::json();
64 auto rotation = options.
transpose ? t.rotation().transpose() : t.rotation();
65 if (rotation != Acts::RotationMatrix3::Identity() or options.
writeIdentity) {
66 std::array<Acts::ActsScalar, 9> rdata = {
67 rotation(0, 0), rotation(0, 1), rotation(0, 2),
68 rotation(1, 0), rotation(1, 1), rotation(1, 2),
69 rotation(2, 0), rotation(2, 1), rotation(2, 2)};
70 jTransform[
"rotation"] = rdata;
72 jTransform[
"rotation"] = nlohmann::json();
79 const nlohmann::json& jTransform) {