From adad4ab0ff6648ece697a346234da84ba41a543e Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 12 Feb 2024 11:39:08 +0900 Subject: [PATCH] Make the DestinationFrame in the SpiceRotation option and use GALACTIC if it is not specified --- include/openspace/util/json_helper.h | 2 +- modules/space/rotation/spicerotation.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/openspace/util/json_helper.h b/include/openspace/util/json_helper.h index af656d89ee..b98e67f645 100644 --- a/include/openspace/util/json_helper.h +++ b/include/openspace/util/json_helper.h @@ -25,9 +25,9 @@ #ifndef __OPENSPACE_CORE___JSON_HELPER___H__ #define __OPENSPACE_CORE___JSON_HELPER___H__ -#include #include #include +#include namespace openspace { diff --git a/modules/space/rotation/spicerotation.cpp b/modules/space/rotation/spicerotation.cpp index 3dfa015bfa..79d3744c67 100644 --- a/modules/space/rotation/spicerotation.cpp +++ b/modules/space/rotation/spicerotation.cpp @@ -68,8 +68,10 @@ namespace { std::string sourceFrame [[codegen::annotation("A valid SPICE NAIF name or integer")]]; - // [[codegen::verbatim(DestinationInfo.description)]] - std::string destinationFrame; + // This value specifies the destination frame that is used for the coordinate + // transformation. This has to be a valid SPICE name. If this value is not + // specified, a reference frame of 'GALACTIC' is used instead + std::optional destinationFrame; // [[codegen::verbatim(DestinationInfo.description)]] std::optional, std::string>> kernels; @@ -99,7 +101,7 @@ SpiceRotation::SpiceRotation(const ghoul::Dictionary& dictionary) const Parameters p = codegen::bake(dictionary); _sourceFrame = p.sourceFrame; - _destinationFrame = p.destinationFrame; + _destinationFrame = p.destinationFrame.value_or("GALACTIC"); if (p.kernels.has_value()) { if (std::holds_alternative(*p.kernels)) {