46 enum TS_API InteractiveMode
50 ModeLimitActive = 100,
71 bool preActiveAdjusted =
false;
72 TsTime preActiveAdjustedWidth = 0;
73 bool preOppositeAdjusted =
false;
74 TsTime preOppositeAdjustedWidth = 0;
78 bool postActiveAdjusted =
false;
79 TsTime postActiveAdjustedWidth = 0;
80 bool postOppositeAdjusted =
false;
81 TsTime postOppositeAdjustedWidth = 0;
85 std::string GetDebugDescription(
int precision = 6)
const;
99 TsTime activeKnotTime,
109 TsTime activeKnotTime,
110 InteractiveMode mode,
148 const TsKnot &proposedActiveKnot,
152 friend struct Ts_RegressionPreventerBatchAccess;
157 _ModeNone = TsAntiRegressionNone,
158 _ModeContain = TsAntiRegressionContain,
159 _ModeKeepRatio = TsAntiRegressionKeepRatio,
160 _ModeKeepStart = TsAntiRegressionKeepStart,
161 _ModeLimitActive = ModeLimitActive,
162 _ModeLimitOpposite = ModeLimitOpposite
168 TsTime activeKnotTime,
185 const TsKnot &originalKnot);
188 void RestoreOriginal();
192 void RemoveCurrent();
203 const TsKnot originalKnot;
206 Ts_KnotData currentParams;
212 struct _WorkingKnotState
219 _KnotState *parentState,
220 const TsKnot &proposedKnot);
226 _KnotState *parentState);
232 const Ts_KnotData &originalParams);
236 void WriteProposed();
244 _KnotState*
const parentState;
247 const TsKnot proposedKnot;
250 const Ts_KnotData proposedParams;
253 Ts_KnotData workingParams;
269 WhichSegment whichSegment,
271 _WorkingKnotState* activeKnotState,
272 _WorkingKnotState* oppositeKnotState,
287 bool _AdjustWithContain();
288 bool _AdjustWithKeepRatio();
289 bool _AdjustWithKeepStart();
290 bool _AdjustWithLimitActive();
291 bool _AdjustWithLimitOpposite();
296 TsTime _GetProposedActiveWidth()
const;
297 TsTime _GetProposedOppositeWidth()
const;
298 void _SetActiveWidth(TsTime width);
299 void _SetOppositeWidth(TsTime width);
303 TsTime _GetProposedStartWidth()
const;
304 TsTime _GetProposedEndWidth()
const;
305 void _SetStartWidth(TsTime width);
306 void _SetEndWidth(TsTime width);
309 TsTime _GetSegmentWidth()
const;
312 const WhichSegment _whichSegment;
315 _WorkingKnotState*
const _activeKnotState;
316 _WorkingKnotState*
const _oppositeKnotState;
317 SetResult*
const _result;
323 const TsKnot &proposedActiveKnot,
324 SetResult *resultOut)
const;
325 void _HandleInitialAdjustment(
326 const TsKnot &proposedActiveKnot,
327 SetResult* resultOut);
328 void _HandleTimeChange(TsTime proposedActiveTime);
330 const TsKnot &proposedActiveKnot,
332 SetResult* resultOut);
340 bool _initialAdjustmentDone;
342 std::optional<_KnotState> _activeKnotState;
343 std::optional<_KnotState> _preKnotState;
344 std::optional<_KnotState> _postKnotState;
345 std::optional<_KnotState> _overwrittenKnotState;
TS_API TsRegressionPreventer(TsSpline *spline, TsTime activeKnotTime, InteractiveMode mode, bool limit=true)
Same as the above, but with an InteractiveMode.
TS_API bool Set(const TsKnot &proposedActiveKnot, SetResult *resultOut=nullptr)
Set an edited version of the active knot into the spline, adjusting tangent widths if needed,...