Skip to content

Commit

Permalink
Move new model warper config into separate ModelWarperV2 directory (#894
Browse files Browse the repository at this point in the history
)
  • Loading branch information
adamkewley committed Nov 12, 2024
1 parent 7e2ea4a commit 3718b9b
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 12 deletions.
5 changes: 3 additions & 2 deletions src/OpenSimCreator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/TestOpenSimCreator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <OpenSimCreator/Documents/ModelWarper/ModelWarperConfiguration.h>
#include <OpenSimCreator/Documents/ModelWarperV2/ModelWarperConfiguration.h>

#include <TestOpenSimCreator/TestOpenSimCreatorConfig.h>

Expand Down Expand Up @@ -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);
}
Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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<ProduceErrorStationWarpingStrategy>("two_targets");
Expand Down Expand Up @@ -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(); });
}
Expand All @@ -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(); });
}
Expand Down

0 comments on commit 3718b9b

Please sign in to comment.