25 OpenSim_DECLARE_LIST_PROPERTY(path_points, std::string,
"Query paths (e.g. `/forceset/*`) that the engine should use to find path points in the source model that should be warped by this scaling step.");
31 setDescription(
"Warps the locations of path points in the model using the Thin-Plate Spline (TPS) warping algorithm.");
32 constructProperty_path_points();
38 const OpenSim::Model& sourceModel)
const final
44 for (
int i = 0; i < getProperty_path_points().size(); ++i) {
45 const auto* pathPoint = FindComponent<OpenSim::PathPoint>(sourceModel, get_path_points(i));
47 messages.emplace_back(
49 std::format(
"{}: Cannot find a PathPoint in 'path_points' in the source model (or it isn't a PathPoint)", get_path_points(i))
60 const OpenSim::Model& sourceModel,
61 OpenSim::Model& resultModel)
const final
66 for (
int i = 0; i < getProperty_path_points().size(); ++i) {
67 const auto* sourcePathPoint = FindComponent<OpenSim::PathPoint>(sourceModel, get_path_points(i));
68 OSC_ASSERT_ALWAYS(sourcePathPoint &&
"could not find a path point in the source model");
71 const auto* resultPathPoint = FindComponent<OpenSim::PathPoint>(resultModel, get_path_points(i));
77 sourcePathPoint->get_location(),
78 resultPathPoint->get_location(),
79 sourcePathPoint->getParentFrame(),
80 resultPathPoint->getParentFrame(),
81 *commonParams.sourceLandmarksFrame,
82 *commonParams.resultLandmarksFrame,
83 commonParams.tpsInputs,
84 commonParams.compensateForFrameChanges
87 auto* resultPathPointMut = FindComponentMut<OpenSim::PathPoint>(resultModel, get_path_points(i));
88 OSC_ASSERT_ALWAYS(resultPathPointMut &&
"could not find a corresponding path point in the result model");
89 resultPathPointMut->set_location(warpedLocation);
SimTK::Vec3 lookupTPSWarpedRigidPoint(const OpenSim::Model &sourceModel, const OpenSim::Model &resultModel, const SimTK::Vec3 &sourceLocation, const SimTK::Vec3 &resultLocation, const OpenSim::Frame &sourceParentFrame, const OpenSim::Frame &resultParentFrame, const OpenSim::Frame &sourceLandmarksFrame, const OpenSim::Frame &resultLandmarksFrame, const ThinPlateSplineCommonInputs &tpsInputs, bool compensateForFrameChanges)
Definition scaling_cache.h:83
virtual std::vector< ScalingStepValidationMessage > implValidate(ScalingCache &, const ScalingParameters &, const OpenSim::Model &) const
Definition scaling_step.h:92
virtual void implApplyScalingStep(ScalingCache &, const ScalingParameters &, const OpenSim::Model &, OpenSim::Model &) const
Definition scaling_step.h:103
std::vector< ScalingStepValidationMessage > implValidate(ScalingCache &, const ScalingParameters &, const OpenSim::Model &sourceModel) const override
Definition thin_plate_spline_scaling_step.h:72