From d65c1958d6321cfbab9559a19cc135e9526509e6 Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Mon, 23 Jun 2025 11:27:47 +0200 Subject: [PATCH 1/2] fix(HorizonsStack): Fixed issue where top and bottom units were not set after HorizonsStack copy. --- .../builder/horizons_stack_builder.cpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/geode/geosciences/implicit/representation/builder/horizons_stack_builder.cpp b/src/geode/geosciences/implicit/representation/builder/horizons_stack_builder.cpp index 51d9f9d..7615880 100644 --- a/src/geode/geosciences/implicit/representation/builder/horizons_stack_builder.cpp +++ b/src/geode/geosciences/implicit/representation/builder/horizons_stack_builder.cpp @@ -54,6 +54,18 @@ namespace geode set_name( horizons_stack.name() ); auto mapping = copy_components( horizons_stack ); copy_stratigraphic_relationships( mapping, horizons_stack ); + const auto& horizons_mapping = + mapping.at( Horizon< dimension >::component_type_static() ); + if( const auto horizon_id = horizons_stack.bottom_horizon() ) + { + horizons_stack_.set_bottom_horizon( + horizons_mapping.at( horizon_id.value() ), {} ); + } + if( const auto horizon_id = horizons_stack.top_horizon() ) + { + horizons_stack_.set_top_horizon( + horizons_mapping.at( horizon_id.value() ), {} ); + } return mapping; } @@ -81,6 +93,18 @@ namespace geode set_name( horizons_stack.name() ); copy_components( mapping, horizons_stack ); copy_stratigraphic_relationships( mapping, horizons_stack ); + const auto& horizons_mapping = + mapping.at( Horizon< dimension >::component_type_static() ); + if( const auto horizon_id = horizons_stack.bottom_horizon() ) + { + horizons_stack_.set_bottom_horizon( + horizons_mapping.at( horizon_id.value() ), {} ); + } + if( const auto horizon_id = horizons_stack.top_horizon() ) + { + horizons_stack_.set_top_horizon( + horizons_mapping.at( horizon_id.value() ), {} ); + } } template < index_t dimension > From c3de040c374f9c32379f9f5511e84ce2e87a406e Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Mon, 23 Jun 2025 11:35:19 +0200 Subject: [PATCH 2/2] fix compil --- .../representation/builder/horizons_stack_builder.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geode/geosciences/implicit/representation/builder/horizons_stack_builder.cpp b/src/geode/geosciences/implicit/representation/builder/horizons_stack_builder.cpp index 7615880..153024a 100644 --- a/src/geode/geosciences/implicit/representation/builder/horizons_stack_builder.cpp +++ b/src/geode/geosciences/implicit/representation/builder/horizons_stack_builder.cpp @@ -59,12 +59,12 @@ namespace geode if( const auto horizon_id = horizons_stack.bottom_horizon() ) { horizons_stack_.set_bottom_horizon( - horizons_mapping.at( horizon_id.value() ), {} ); + horizons_mapping.in2out( horizon_id.value() ), {} ); } if( const auto horizon_id = horizons_stack.top_horizon() ) { horizons_stack_.set_top_horizon( - horizons_mapping.at( horizon_id.value() ), {} ); + horizons_mapping.in2out( horizon_id.value() ), {} ); } return mapping; } @@ -98,12 +98,12 @@ namespace geode if( const auto horizon_id = horizons_stack.bottom_horizon() ) { horizons_stack_.set_bottom_horizon( - horizons_mapping.at( horizon_id.value() ), {} ); + horizons_mapping.in2out( horizon_id.value() ), {} ); } if( const auto horizon_id = horizons_stack.top_horizon() ) { horizons_stack_.set_top_horizon( - horizons_mapping.at( horizon_id.value() ), {} ); + horizons_mapping.in2out( horizon_id.value() ), {} ); } }