8#ifndef PXR_BASE_TS_TYPES_H
9#define PXR_BASE_TS_TYPES_H
12#include "pxr/base/ts/api.h"
18#include "pxr/base/tf/preprocessorUtilsLite.h"
24PXR_NAMESPACE_OPEN_SCOPE
34#define TS_SPLINE_SUPPORTED_VALUE_TYPES \
38 ((TimeCode, GfTimeCode)) \
39 ((Duration, GfDuration))
41#define TS_SPLINE_STORAGE_VALUE_TYPES \
46#define TS_SPLINE_SAMPLE_VERTEX_TYPES \
51#define TS_SPLINE_VALUE_TYPE_NAME(x) TF_PP_TUPLE_ELEM(0, x)
52#define TS_SPLINE_VALUE_CPP_TYPE(x) TF_PP_TUPLE_ELEM(1, x)
57TsSplineIsValidDataType =
false;
59#define _TS_SUPPORT_DATA_TYPE(unused, tuple) \
61 inline constexpr bool \
62 TsSplineIsValidDataType< TS_SPLINE_VALUE_CPP_TYPE(tuple) > = true;
63TF_PP_SEQ_FOR_EACH(_TS_SUPPORT_DATA_TYPE,
65 TS_SPLINE_SUPPORTED_VALUE_TYPES)
66#undef _TS_SUPPORT_DATA_TYPE
72TsSplineIsValidSampleType =
false;
74#define _TS_SUPPORT_SAMPLE_TYPE(unused, tuple) \
76 inline constexpr bool \
77 TsSplineIsValidSampleType< TS_SPLINE_VALUE_CPP_TYPE(tuple) > = true;
78TF_PP_SEQ_FOR_EACH(_TS_SUPPORT_SAMPLE_TYPE,
80 TS_SPLINE_SAMPLE_VERTEX_TYPES)
81#undef _TS_SUPPORT_SAMPLE_TYPE
96 TsInterpValueBlock = 0,
106 TsCurveTypeBezier = 0,
107 TsCurveTypeHermite = 1
117 TsExtrapValueBlock = 0,
121 TsExtrapLoopRepeat = 4,
122 TsExtrapLoopReset = 5,
123 TsExtrapLoopOscillate = 6
132enum TsSplineSampleSource
135 TsSourcePreExtrapLoop,
136 TsSourceInnerLoopPreEcho,
137 TsSourceInnerLoopProto,
138 TsSourceInnerLoopPostEcho,
141 TsSourcePostExtrapLoop,
167enum TsTangentAlgorithm
169 TsTangentAlgorithmNone,
170 TsTangentAlgorithmCustom,
171 TsTangentAlgorithmAutoEase
179using TsLoopParams [[deprecated(
"TsSpline inner looping is deprecated")]] =
224 TsTime protoStart = 0.0;
225 TsTime protoEnd = 0.0;
226 int32_t numPreLoops = 0;
227 int32_t numPostLoops = 0;
228 double valueOffset = 0.0;
232 bool operator==(
const Ts_LoopParams &other)
const;
235 bool operator!=(
const Ts_LoopParams &other)
const;
251 TsExtrapMode mode = TsExtrapHeld;
277 std::optional<double> loopBoundaryTime;
311template <
typename Vertex>
315 static_assert(TsSplineIsValidSampleType<Vertex>,
316 "The Vertex template parameter to TsSplineSamples must be one"
317 " of GfVec2d, GfVec2f, or GfVec2h.");
319 using Polyline = std::vector<Vertex>;
321 std::vector<Polyline> polylines;
334template <
typename Vertex>
338 static_assert(TsSplineIsValidSampleType<Vertex>,
339 "The Vertex template parameter to TsSplineSamplesWithSources"
340 " must be one of GfVec2d, GfVec2f, or GfVec2h.");
342 using Polyline = std::vector<Vertex>;
344 std::vector<Polyline> polylines;
345 std::vector<TsSplineSampleSource> sources;
353enum TsAntiRegressionMode
357 TsAntiRegressionNone,
363 TsAntiRegressionContain,
369 TsAntiRegressionKeepRatio,
374 TsAntiRegressionKeepStart
378PXR_NAMESPACE_CLOSE_SCOPE
A basic mathematical interval class.
TS_API GfInterval GetLoopedInterval() const
Returns the union of the prototype region and the echo region(s).
TS_API GfInterval GetPrototypeInterval() const
Returns the prototype region, [protoStart, protoEnd).
TsSplineSamples<Vertex> holds a collection of piecewise linear polylines that approximate a TsSpline.
TsSplineSamplesWithSources<Vertex> is a TsSplineSamples<Vertex> that also includes source information...