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 messages.emplace_back(
50 std::format(
"{}: Cannot a Station in 'stations' in the source model (or it isn't a Station).", get_stations(i))
61 const OpenSim::Model& sourceModel,
62 OpenSim::Model& resultModel)
const final
67 for (
int i = 0; i < getProperty_stations().size(); ++i) {
68 const auto* sourceStation = FindComponent<OpenSim::Station>(sourceModel, get_stations(i));
69 OSC_ASSERT_ALWAYS(sourceStation &&
"could not find a station in the source model");
72 const auto* resultStation = FindComponent<OpenSim::Station>(resultModel, get_stations(i));
78 sourceStation->get_location(),
79 resultStation->get_location(),
80 sourceStation->getParentFrame(),
81 resultStation->getParentFrame(),
82 *commonParams.sourceLandmarksFrame,
83 *commonParams.resultLandmarksFrame,
84 commonParams.tpsInputs,
85 commonParams.compensateForFrameChanges
88 auto* resultStationMut = FindComponentMut<OpenSim::Station>(resultModel, get_stations(i));
89 OSC_ASSERT_ALWAYS(resultStationMut &&
"could not find a corresponding station in the result model");
90 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: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