42 const OpenSim::Model& sourceModel)
const final
48 for (
int i = 0; i < getProperty_offset_frames().size(); ++i) {
49 const auto* offsetFrame = FindComponent<OpenSim::PhysicalOffsetFrame>(sourceModel, get_offset_frames(i));
50 if (not offsetFrame) {
51 std::stringstream msg;
52 msg << get_offset_frames(i) <<
": Cannot find a `PhysicalOffsetFrame` in 'offset_frames' in the source model (or it isn't a `PhysicalOffsetFrame`).";
63 const OpenSim::Model& sourceModel,
64 OpenSim::Model& resultModel)
const final
70 for (
int i = 0; i < getProperty_offset_frames().size(); ++i) {
71 const auto* sourceOffsetFrame = FindComponent<OpenSim::PhysicalOffsetFrame>(sourceModel, get_offset_frames(i));
72 OSC_ASSERT_ALWAYS(sourceOffsetFrame &&
"could not find a `PhysicalOffsetFrame` in the source model");
75 const auto* resultOffsetFrame = FindComponent<OpenSim::PhysicalOffsetFrame>(resultModel, get_offset_frames(i));
76 OSC_ASSERT_ALWAYS(resultOffsetFrame &&
"could not find a `PhysicalOffsetFrame` in the model");
78 const SimTK::Vec3 warpedLocation = scalingCache.lookupTPSWarpedRigidPoint(
81 sourceOffsetFrame->get_translation(),
82 resultOffsetFrame->get_translation(),
83 sourceOffsetFrame->getParentFrame(),
84 resultOffsetFrame->getParentFrame(),
85 *commonParams.sourceLandmarksFrame,
86 *commonParams.resultLandmarksFrame,
87 commonParams.tpsInputs,
88 commonParams.compensateForFrameChanges
91 auto* resultOffsetFrameMut = FindComponentMut<OpenSim::PhysicalOffsetFrame>(resultModel, get_offset_frames(i));
92 OSC_ASSERT_ALWAYS(resultOffsetFrameMut &&
"could not find a corresponding `PhysicalOffsetFrame` in the result model");
93 resultOffsetFrameMut->set_translation(warpedLocation);