26 OpenSim_DECLARE_LIST_PROPERTY(stations, std::string,
"Query paths (e.g. `/forceset/*`) that the engine should use to find stations in the source model that should be warped by this scaling step.");
32 setDescription(
"Warps the locations of stations in the model using the Thin-Plate Spline (TPS) warping algorithm.");
33 constructProperty_stations();
39 const OpenSim::Model& sourceModel)
const final
45 for (
int i = 0; i < getProperty_stations().size(); ++i) {
46 const auto* station = FindComponent<OpenSim::Station>(sourceModel, get_stations(i));
48 std::stringstream msg;
49 msg << get_stations(i) <<
": Cannot a Station in 'stations' in the source model (or it isn't a Station).";
60 const OpenSim::Model& sourceModel,
61 OpenSim::Model& resultModel)
const final
66 for (
int i = 0; i < getProperty_stations().size(); ++i) {
67 const auto* sourceStation = FindComponent<OpenSim::Station>(sourceModel, get_stations(i));
68 OSC_ASSERT_ALWAYS(sourceStation &&
"could not find a station in the source model");
71 const auto* resultStation = FindComponent<OpenSim::Station>(resultModel, get_stations(i));
77 sourceStation->get_location(),
78 resultStation->get_location(),
79 sourceStation->getParentFrame(),
80 resultStation->getParentFrame(),
81 *commonParams.sourceLandmarksFrame,
82 *commonParams.resultLandmarksFrame,
83 commonParams.tpsInputs,
84 commonParams.compensateForFrameChanges
87 auto* resultStationMut = FindComponentMut<OpenSim::Station>(resultModel, get_stations(i));
88 OSC_ASSERT_ALWAYS(resultStationMut &&
"could not find a corresponding station in the result model");
89 resultStationMut->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