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 std::stringstream msg;
48 msg << get_path_points(i) <<
": Cannot find a PathPoint in 'path_points' in the source model (or it isn't a PathPoint)";
59 const OpenSim::Model& sourceModel,
60 OpenSim::Model& resultModel)
const final
65 for (
int i = 0; i < getProperty_path_points().size(); ++i) {
66 const auto* sourcePathPoint = FindComponent<OpenSim::PathPoint>(sourceModel, get_path_points(i));
67 OSC_ASSERT_ALWAYS(sourcePathPoint &&
"could not find a path point in the source model");
70 const auto* resultPathPoint = FindComponent<OpenSim::PathPoint>(resultModel, get_path_points(i));
76 sourcePathPoint->get_location(),
77 resultPathPoint->get_location(),
78 sourcePathPoint->getParentFrame(),
79 resultPathPoint->getParentFrame(),
80 *commonParams.sourceLandmarksFrame,
81 *commonParams.resultLandmarksFrame,
82 commonParams.tpsInputs,
83 commonParams.compensateForFrameChanges
86 auto* resultPathPointMut = FindComponentMut<OpenSim::PathPoint>(resultModel, get_path_points(i));
87 OSC_ASSERT_ALWAYS(resultPathPointMut &&
"could not find a corresponding path point in the result model");
88 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:82
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:71