Skip to content

Commit 3a27fb4

Browse files
committed
Rename compensate_for_frame_warping -> compensate_for_frame_changes (#1144)
1 parent a5e4e7b commit 3a27fb4

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

libopensimcreator/UI/ModelWarper/ModelWarperTab.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ namespace
177177
const OpenSim::Frame& sourceLandmarksFrame,
178178
const OpenSim::Frame& resultLandmarksFrame,
179179
const ThinPlateSplineCommonInputs& tpsInputs,
180-
bool compensateForFrameWarping)
180+
bool compensateForFrameChanges)
181181
{
182182
// Compile the TPS coefficients from the source+destination landmarks
183183
const TPSCoefficients3D<float>& coefficients = lookupTPSCoefficients(tpsInputs);
@@ -190,7 +190,7 @@ namespace
190190
resultMesh.getFrame(),
191191
sourceLandmarksFrame,
192192
resultLandmarksFrame,
193-
compensateForFrameWarping
193+
compensateForFrameChanges
194194
);
195195

196196
// Convert the input mesh into an OSC mesh, so that it's suitable for warping.
@@ -222,7 +222,7 @@ namespace
222222
const OpenSim::Frame& sourceLandmarksFrame,
223223
const OpenSim::Frame& resultLandmarksFrame,
224224
const ThinPlateSplineCommonInputs& tpsInputs,
225-
bool compensateForFrameWarping)
225+
bool compensateForFrameChanges)
226226
{
227227
// Compile the TPS coefficients from the source+destination landmarks
228228
const TPSCoefficients3D<float>& coefficients = lookupTPSCoefficients(tpsInputs);
@@ -235,7 +235,7 @@ namespace
235235
resultParentFrame,
236236
sourceLandmarksFrame,
237237
resultLandmarksFrame,
238-
compensateForFrameWarping
238+
compensateForFrameChanges
239239
);
240240

241241
const auto resultLocationInLandmarkFrame = transform_point(transforms.localToLandmarks, to<Vector3>(resultLocation));
@@ -275,11 +275,11 @@ namespace
275275
const OpenSim::Frame& resultFrame,
276276
const OpenSim::Frame& sourceLandmarksFrame,
277277
const OpenSim::Frame& resultLandmarksFrame,
278-
bool compensateForFrameWarping) const
278+
bool compensateForFrameChanges) const
279279
{
280280
const SimTK::Transform resultTransform = resultFrame.findTransformBetween(resultModel.getWorkingState(), resultLandmarksFrame);
281281

282-
if (compensateForFrameWarping) {
282+
if (compensateForFrameChanges) {
283283
const SimTK::Transform sourceTransform = sourceFrame.findTransformBetween(sourceModel.getWorkingState(), sourceLandmarksFrame);
284284
const SimTK::Transform frameWarpTransform = sourceTransform.invert() * resultTransform;
285285
return Transforms{
@@ -469,7 +469,7 @@ namespace
469469
ThinPlateSplineCommonInputs tpsInputs;
470470
const OpenSim::Frame* sourceLandmarksFrame = nullptr;
471471
const OpenSim::Frame* resultLandmarksFrame = nullptr;
472-
bool compensateForFrameWarping = false;
472+
bool compensateForFrameChanges = false;
473473
};
474474

475475
// An abstract base class for a `ScalingStep` that uses the Thin-Plate Spline (TPS)
@@ -483,7 +483,7 @@ namespace
483483
OpenSim_DECLARE_PROPERTY(source_landmarks_file, std::string, "Filesystem path, relative to the model's filesystem path, where a CSV containing the source landmarks can be loaded from (e.g. `Geometry/torso.landmarks.csv`)");
484484
OpenSim_DECLARE_PROPERTY(destination_landmarks_file, std::string, "Filesystem path, relative to the model's filesystem path, where a CSV containing the destination landmarks can be loaded from (e.g. `DestinationGeometry/torso.landmarks.csv`)");
485485
OpenSim_DECLARE_PROPERTY(landmarks_frame, std::string, "Component path (e.g. `/bodyset/somebody`) to the frame that the landmarks defined in both `source_landmarks_file` and `destination_landmarks_file` are expressed in.\n\nThe engine uses this to figure out how to transform the input to/from the coordinate system of the warp transform.");
486-
OpenSim_DECLARE_PROPERTY(compensate_for_frame_warping, bool, "If `landmarks_frame` is different from the source data's frame, and previous scaling steps have caused the spatial transform between those two frames to change, compensate for it by inverse-applying the difference between the frames to the result, so that the effect of frame warping is compensated for. This can be necessary to stop double-warping for occurring (e.g. when separately warping a frame followed by warping data within that frame)");
486+
OpenSim_DECLARE_PROPERTY(compensate_for_frame_changes, bool, "If `landmarks_frame` is different from the source data's frame, and previous scaling steps have caused the spatial transform between those two frames to change, compensate for it by inverse-applying the difference between the frames to the result, so that the effect of those frame changes is compensated for. This can be necessary to stop double-warping for occurring (e.g. when separately warping a frame followed by warping data within that frame)");
487487
OpenSim_DECLARE_PROPERTY(source_landmarks_prescale, double, "Scaling factor that each source landmark point should be multiplied by before computing the TPS warp. This is sometimes necessary if (e.g.) the mesh is in different units (OpenSim works in meters).");
488488
OpenSim_DECLARE_PROPERTY(destination_landmarks_prescale, double, "Scaling factor that each destination landmark point should be multiplied by before computing the TPS warp. This is sometimes necessary if (e.g.) the mesh is in different units (OpenSim works in meters).");
489489

@@ -496,7 +496,7 @@ namespace
496496
constructProperty_source_landmarks_file({});
497497
constructProperty_destination_landmarks_file({});
498498
constructProperty_landmarks_frame("/ground");
499-
constructProperty_compensate_for_frame_warping(false);
499+
constructProperty_compensate_for_frame_changes(false);
500500
constructProperty_source_landmarks_prescale(1.0);
501501
constructProperty_destination_landmarks_prescale(1.0);
502502
}
@@ -596,7 +596,7 @@ namespace
596596
},
597597
.sourceLandmarksFrame = sourceLandmarksFrame,
598598
.resultLandmarksFrame = resultLandmarksFrame,
599-
.compensateForFrameWarping = get_compensate_for_frame_warping(),
599+
.compensateForFrameChanges = get_compensate_for_frame_changes(),
600600
};
601601
}
602602
};
@@ -702,7 +702,7 @@ namespace
702702
*commonParams.sourceLandmarksFrame,
703703
*commonParams.resultLandmarksFrame,
704704
commonParams.tpsInputs,
705-
commonParams.compensateForFrameWarping
705+
commonParams.compensateForFrameChanges
706706
);
707707
OSC_ASSERT_ALWAYS(warpedMesh && "warping a mesh in the model failed");
708708

@@ -780,7 +780,7 @@ namespace
780780
*commonParams.sourceLandmarksFrame,
781781
*commonParams.resultLandmarksFrame,
782782
commonParams.tpsInputs,
783-
commonParams.compensateForFrameWarping
783+
commonParams.compensateForFrameChanges
784784
);
785785

786786
auto* resultStationMut = FindComponentMut<OpenSim::Station>(resultModel, get_stations(i));
@@ -855,7 +855,7 @@ namespace
855855
*commonParams.sourceLandmarksFrame,
856856
*commonParams.resultLandmarksFrame,
857857
commonParams.tpsInputs,
858-
commonParams.compensateForFrameWarping
858+
commonParams.compensateForFrameChanges
859859
);
860860

861861
auto* resultPathPointMut = FindComponentMut<OpenSim::PathPoint>(resultModel, get_path_points(i));
@@ -933,7 +933,7 @@ namespace
933933
*commonParams.sourceLandmarksFrame,
934934
*commonParams.resultLandmarksFrame,
935935
commonParams.tpsInputs,
936-
commonParams.compensateForFrameWarping
936+
commonParams.compensateForFrameChanges
937937
);
938938

939939
auto* resultOffsetFrameMut = FindComponentMut<OpenSim::PhysicalOffsetFrame>(resultModel, get_offset_frames(i));
@@ -1159,7 +1159,7 @@ Uses the Thin-Plate Spline (TPS) warping algorithm to scale `WrapCylinder`s in t
11591159
*commonParams.sourceLandmarksFrame,
11601160
*commonParams.resultLandmarksFrame,
11611161
commonParams.tpsInputs,
1162-
commonParams.compensateForFrameWarping
1162+
commonParams.compensateForFrameChanges
11631163
);
11641164

11651165
// Calculate the `WrapCylinder`'s new projected midline point by warping it.
@@ -1175,7 +1175,7 @@ Uses the Thin-Plate Spline (TPS) warping algorithm to scale `WrapCylinder`s in t
11751175
*commonParams.sourceLandmarksFrame,
11761176
*commonParams.resultLandmarksFrame,
11771177
commonParams.tpsInputs,
1178-
commonParams.compensateForFrameWarping
1178+
commonParams.compensateForFrameChanges
11791179
);
11801180

11811181
// Calculate the source surface point by projecting the direction onto the `WrapCylinder`'s surface.
@@ -1193,7 +1193,7 @@ Uses the Thin-Plate Spline (TPS) warping algorithm to scale `WrapCylinder`s in t
11931193
*commonParams.sourceLandmarksFrame,
11941194
*commonParams.resultLandmarksFrame,
11951195
commonParams.tpsInputs,
1196-
commonParams.compensateForFrameWarping
1196+
commonParams.compensateForFrameChanges
11971197
);
11981198

11991199
// The `WrapCylinder`'s new Z axis within the parent frame is a unit vector that

0 commit comments

Comments
 (0)