|
||||
File indexing completed on 2025-01-18 09:27:42
0001 // This file is part of the Acts project. 0002 // 0003 // Copyright (C) 2021-2023 CERN for the benefit of the Acts project 0004 // 0005 // This Source Code Form is subject to the terms of the Mozilla Public 0006 // License, v. 2.0. If a copy of the MPL was not distributed with this 0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/. 0008 0009 #pragma once 0010 0011 #include "Acts/Definitions/Algebra.hpp" 0012 #include "Acts/Plugins/Json/ActsJson.hpp" 0013 0014 #include <nlohmann/json.hpp> 0015 0016 // Custom Json encoder/decoders. Naming is mandated by nlohmann::json and thus 0017 // can not match our naming guidelines. 0018 namespace Acts { 0019 0020 void to_json(nlohmann::json& j, const Transform3& t); 0021 0022 void from_json(const nlohmann::json& j, Transform3& t); 0023 0024 namespace Transform3JsonConverter { 0025 0026 /// @brief The options for the transform converter 0027 struct Options { 0028 /// Write the identity transform explicitly 0029 bool writeIdentity = false; 0030 /// Apply a transpose to flip column/row order 0031 bool transpose = false; 0032 }; 0033 0034 /// @brief The Transform converter to json 0035 /// 0036 /// @param t the transform to be converted 0037 /// @param options transformation options 0038 /// 0039 /// @return a json object representing the transform 0040 nlohmann::json toJson(const Transform3& t, const Options& options = {}); 0041 0042 /// @brief The Transform converter from json 0043 /// 0044 /// @param jTransform the transform json transformation 0045 /// 0046 /// @return a transform object 0047 Transform3 fromJson(const nlohmann::json& jTransform); 0048 0049 } // namespace Transform3JsonConverter 0050 } // namespace Acts
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |