From 3718b9bb7f392b5b36cf94e804377364266cbf8a Mon Sep 17 00:00:00 2001 From: Adam Kewley Date: Tue, 12 Nov 2024 14:01:55 +0100 Subject: [PATCH] Move new model warper config into separate ModelWarperV2 directory (#894) --- src/OpenSimCreator/CMakeLists.txt | 5 +++-- .../ModelWarperConfiguration.cpp | 0 .../ModelWarperConfiguration.h | 0 tests/TestOpenSimCreator/CMakeLists.txt | 2 +- .../TestModelWarperConfiguration.cpp | 18 +++++++++--------- .../duplicated_but_different_types.xml | 0 .../duplicated_offsetframe_strategytarget.xml | 0 .../empty_sequence.xml | 0 .../mixed_offsetframe_warpers.xml | 0 .../mixed_station_warpers.xml | 0 .../single_offsetframe_warper.xml | 0 .../single_station_warper.xml | 0 .../two_strategy_targets.xml | 0 13 files changed, 13 insertions(+), 12 deletions(-) rename src/OpenSimCreator/Documents/{ModelWarper => ModelWarperV2}/ModelWarperConfiguration.cpp (100%) rename src/OpenSimCreator/Documents/{ModelWarper => ModelWarperV2}/ModelWarperConfiguration.h (100%) rename tests/TestOpenSimCreator/Documents/{ModelWarper => ModelWarperV2}/TestModelWarperConfiguration.cpp (97%) rename tests/TestOpenSimCreator/resources/Document/{ModelWarper/ModelWarperConfiguration => ModelWarperV2}/duplicated_but_different_types.xml (100%) rename tests/TestOpenSimCreator/resources/Document/{ModelWarper/ModelWarperConfiguration => ModelWarperV2}/duplicated_offsetframe_strategytarget.xml (100%) rename tests/TestOpenSimCreator/resources/Document/{ModelWarper/ModelWarperConfiguration => ModelWarperV2}/empty_sequence.xml (100%) rename tests/TestOpenSimCreator/resources/Document/{ModelWarper/ModelWarperConfiguration => ModelWarperV2}/mixed_offsetframe_warpers.xml (100%) rename tests/TestOpenSimCreator/resources/Document/{ModelWarper/ModelWarperConfiguration => ModelWarperV2}/mixed_station_warpers.xml (100%) rename tests/TestOpenSimCreator/resources/Document/{ModelWarper/ModelWarperConfiguration => ModelWarperV2}/single_offsetframe_warper.xml (100%) rename tests/TestOpenSimCreator/resources/Document/{ModelWarper/ModelWarperConfiguration => ModelWarperV2}/single_station_warper.xml (100%) rename tests/TestOpenSimCreator/resources/Document/{ModelWarper/ModelWarperConfiguration => ModelWarperV2}/two_strategy_targets.xml (100%) diff --git a/src/OpenSimCreator/CMakeLists.txt b/src/OpenSimCreator/CMakeLists.txt index 34700083b..33b17c0b6 100644 --- a/src/OpenSimCreator/CMakeLists.txt +++ b/src/OpenSimCreator/CMakeLists.txt @@ -149,8 +149,6 @@ add_library(OpenSimCreator STATIC Documents/ModelWarper/MaybePairedLandmark.h Documents/ModelWarper/ModelWarpConfiguration.cpp Documents/ModelWarper/ModelWarpConfiguration.h - Documents/ModelWarper/ModelWarperConfiguration.cpp - Documents/ModelWarper/ModelWarperConfiguration.h Documents/ModelWarper/PointWarperFactories.cpp Documents/ModelWarper/PointWarperFactories.h Documents/ModelWarper/StationDefinedFrameWarperFactory.cpp @@ -164,6 +162,9 @@ add_library(OpenSimCreator STATIC Documents/ModelWarper/WarpableOpenSimComponent.h Documents/ModelWarper/WarpDetail.h + Documents/ModelWarperV2/ModelWarperConfiguration.cpp + Documents/ModelWarperV2/ModelWarperConfiguration.h + Documents/OutputExtractors/ComponentOutputExtractor.cpp Documents/OutputExtractors/ComponentOutputExtractor.h Documents/OutputExtractors/ComponentOutputSubfield.cpp diff --git a/src/OpenSimCreator/Documents/ModelWarper/ModelWarperConfiguration.cpp b/src/OpenSimCreator/Documents/ModelWarperV2/ModelWarperConfiguration.cpp similarity index 100% rename from src/OpenSimCreator/Documents/ModelWarper/ModelWarperConfiguration.cpp rename to src/OpenSimCreator/Documents/ModelWarperV2/ModelWarperConfiguration.cpp diff --git a/src/OpenSimCreator/Documents/ModelWarper/ModelWarperConfiguration.h b/src/OpenSimCreator/Documents/ModelWarperV2/ModelWarperConfiguration.h similarity index 100% rename from src/OpenSimCreator/Documents/ModelWarper/ModelWarperConfiguration.h rename to src/OpenSimCreator/Documents/ModelWarperV2/ModelWarperConfiguration.h diff --git a/tests/TestOpenSimCreator/CMakeLists.txt b/tests/TestOpenSimCreator/CMakeLists.txt index f5f321c73..764e2d319 100644 --- a/tests/TestOpenSimCreator/CMakeLists.txt +++ b/tests/TestOpenSimCreator/CMakeLists.txt @@ -16,9 +16,9 @@ add_executable(TestOpenSimCreator Documents/Model/TestUndoableModelStatePair.cpp Documents/ModelWarper/TestCachedModelWarper.cpp Documents/ModelWarper/TestFrameWarperFactories.cpp - Documents/ModelWarper/TestModelWarperConfiguration.cpp Documents/ModelWarper/TestPointWarperFactories.cpp Documents/ModelWarper/TestWarpableModel.cpp + Documents/ModelWarperV2/TestModelWarperConfiguration.cpp Documents/OutputExtractors/TestConstantOutputExtractor.cpp Documents/Simulation/TestForwardDynamicSimulation.cpp Documents/Simulation/TestSimulationHelpers.cpp diff --git a/tests/TestOpenSimCreator/Documents/ModelWarper/TestModelWarperConfiguration.cpp b/tests/TestOpenSimCreator/Documents/ModelWarperV2/TestModelWarperConfiguration.cpp similarity index 97% rename from tests/TestOpenSimCreator/Documents/ModelWarper/TestModelWarperConfiguration.cpp rename to tests/TestOpenSimCreator/Documents/ModelWarperV2/TestModelWarperConfiguration.cpp index 5f4de7fa7..74ca24e3b 100644 --- a/tests/TestOpenSimCreator/Documents/ModelWarper/TestModelWarperConfiguration.cpp +++ b/tests/TestOpenSimCreator/Documents/ModelWarperV2/TestModelWarperConfiguration.cpp @@ -1,4 +1,4 @@ -#include +#include #include @@ -345,7 +345,7 @@ TEST(ModelWarperConfiguration, LoadingNonExistentFileThrows) TEST(ModelWarperConfiguration, CanLoadEmptySequence) { - ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarper/ModelWarperConfiguration/empty_sequence.xml")}; + ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarperV2/empty_sequence.xml")}; configuration.finalizeFromProperties(); configuration.finalizeConnections(configuration); } @@ -354,7 +354,7 @@ TEST(ModelWarperConfiguration, CanLoadTrivialSingleOffsetFrameWarpingStrategy) { OpenSim::Object::registerType(ProduceErrorOffsetFrameWarpingStrategy{}); - ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarper/ModelWarperConfiguration/single_offsetframe_warper.xml")}; + ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarperV2/single_offsetframe_warper.xml")}; configuration.finalizeFromProperties(); configuration.finalizeConnections(configuration); @@ -368,7 +368,7 @@ TEST(ModelWarperConfiguration, CanContainAMixtureOfOffsetFrameWarpingStrategies) OpenSim::Object::registerType(ProduceErrorOffsetFrameWarpingStrategy{}); OpenSim::Object::registerType(ThinPlateSplineOnlyTranslationOffsetFrameWarpingStrategy{}); - ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarper/ModelWarperConfiguration/mixed_offsetframe_warpers.xml")}; + ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarperV2/mixed_offsetframe_warpers.xml")}; configuration.finalizeFromProperties(); configuration.finalizeConnections(configuration); @@ -381,7 +381,7 @@ TEST(ModelWarperConfiguration, CanLoadTrivialSingleStationWarpingStrategy) { OpenSim::Object::registerType(ProduceErrorStationWarpingStrategy{}); - ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarper/ModelWarperConfiguration/single_station_warper.xml")}; + ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarperV2/single_station_warper.xml")}; configuration.finalizeFromProperties(); configuration.finalizeConnections(configuration); @@ -395,7 +395,7 @@ TEST(ModelWarperConfiguration, CanLoadAMixtureOfStationWarpingStrategies) OpenSim::Object::registerType(ProduceErrorStationWarpingStrategy{}); OpenSim::Object::registerType(ThinPlateSplineStationWarpingStrategy{}); - ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarper/ModelWarperConfiguration/mixed_station_warpers.xml")}; + ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarperV2/mixed_station_warpers.xml")}; configuration.finalizeFromProperties(); configuration.finalizeConnections(configuration); @@ -421,7 +421,7 @@ TEST(ModelWarperConfiguration, LoadingConfigurationContainingStrategyWithTwoTarg { OpenSim::Object::registerType(ProduceErrorStationWarpingStrategy{}); - ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarper/ModelWarperConfiguration/two_strategy_targets.xml")}; + ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarperV2/two_strategy_targets.xml")}; configuration.finalizeFromProperties(); const auto* strategy = configuration.findComponent("two_targets"); @@ -459,7 +459,7 @@ TEST(ModelWarperConfiguration, finalizeFromPropertiesThrowsWhenGivenConfiguratio OpenSim::Object::registerType(ProduceErrorOffsetFrameWarpingStrategy{}); OpenSim::Object::registerType(ThinPlateSplineOnlyTranslationOffsetFrameWarpingStrategy{}); - ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarper/ModelWarperConfiguration/duplicated_offsetframe_strategytarget.xml")}; + ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarperV2/duplicated_offsetframe_strategytarget.xml")}; ASSERT_ANY_THROW({ configuration.finalizeFromProperties(); }); } @@ -469,7 +469,7 @@ TEST(ModelWarperConfiguration, finalizeFromPropertiesDoesNotThrowWhenGivenConfig OpenSim::Object::registerType(ProduceErrorOffsetFrameWarpingStrategy{}); OpenSim::Object::registerType(ProduceErrorStationWarpingStrategy{}); - ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarper/ModelWarperConfiguration/duplicated_but_different_types.xml")}; + ModelWarperConfiguration configuration{GetFixturePath("Document/ModelWarperV2/duplicated_but_different_types.xml")}; ASSERT_NO_THROW({ configuration.finalizeFromProperties(); }); } diff --git a/tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/duplicated_but_different_types.xml b/tests/TestOpenSimCreator/resources/Document/ModelWarperV2/duplicated_but_different_types.xml similarity index 100% rename from tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/duplicated_but_different_types.xml rename to tests/TestOpenSimCreator/resources/Document/ModelWarperV2/duplicated_but_different_types.xml diff --git a/tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/duplicated_offsetframe_strategytarget.xml b/tests/TestOpenSimCreator/resources/Document/ModelWarperV2/duplicated_offsetframe_strategytarget.xml similarity index 100% rename from tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/duplicated_offsetframe_strategytarget.xml rename to tests/TestOpenSimCreator/resources/Document/ModelWarperV2/duplicated_offsetframe_strategytarget.xml diff --git a/tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/empty_sequence.xml b/tests/TestOpenSimCreator/resources/Document/ModelWarperV2/empty_sequence.xml similarity index 100% rename from tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/empty_sequence.xml rename to tests/TestOpenSimCreator/resources/Document/ModelWarperV2/empty_sequence.xml diff --git a/tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/mixed_offsetframe_warpers.xml b/tests/TestOpenSimCreator/resources/Document/ModelWarperV2/mixed_offsetframe_warpers.xml similarity index 100% rename from tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/mixed_offsetframe_warpers.xml rename to tests/TestOpenSimCreator/resources/Document/ModelWarperV2/mixed_offsetframe_warpers.xml diff --git a/tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/mixed_station_warpers.xml b/tests/TestOpenSimCreator/resources/Document/ModelWarperV2/mixed_station_warpers.xml similarity index 100% rename from tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/mixed_station_warpers.xml rename to tests/TestOpenSimCreator/resources/Document/ModelWarperV2/mixed_station_warpers.xml diff --git a/tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/single_offsetframe_warper.xml b/tests/TestOpenSimCreator/resources/Document/ModelWarperV2/single_offsetframe_warper.xml similarity index 100% rename from tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/single_offsetframe_warper.xml rename to tests/TestOpenSimCreator/resources/Document/ModelWarperV2/single_offsetframe_warper.xml diff --git a/tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/single_station_warper.xml b/tests/TestOpenSimCreator/resources/Document/ModelWarperV2/single_station_warper.xml similarity index 100% rename from tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/single_station_warper.xml rename to tests/TestOpenSimCreator/resources/Document/ModelWarperV2/single_station_warper.xml diff --git a/tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/two_strategy_targets.xml b/tests/TestOpenSimCreator/resources/Document/ModelWarperV2/two_strategy_targets.xml similarity index 100% rename from tests/TestOpenSimCreator/resources/Document/ModelWarper/ModelWarperConfiguration/two_strategy_targets.xml rename to tests/TestOpenSimCreator/resources/Document/ModelWarperV2/two_strategy_targets.xml