8#ifndef PXR_BASE_TS_TYPES_H
9#define PXR_BASE_TS_TYPES_H
12#include "pxr/base/ts/api.h"
17#include "pxr/base/tf/preprocessorUtilsLite.h"
23PXR_NAMESPACE_OPEN_SCOPE
32#define TS_SPLINE_SUPPORTED_VALUE_TYPES \
36 ((TimeCode, GfTimeCode))
38#define TS_SPLINE_STORAGE_VALUE_TYPES \
43#define TS_SPLINE_SAMPLE_VERTEX_TYPES \
48#define TS_SPLINE_VALUE_TYPE_NAME(x) TF_PP_TUPLE_ELEM(0, x)
49#define TS_SPLINE_VALUE_CPP_TYPE(x) TF_PP_TUPLE_ELEM(1, x)
54TsSplineIsValidDataType =
false;
56#define _TS_SUPPORT_DATA_TYPE(unused, tuple) \
58 inline constexpr bool \
59 TsSplineIsValidDataType< TS_SPLINE_VALUE_CPP_TYPE(tuple) > = true;
60TF_PP_SEQ_FOR_EACH(_TS_SUPPORT_DATA_TYPE,
62 TS_SPLINE_SUPPORTED_VALUE_TYPES)
63#undef _TS_SUPPORT_DATA_TYPE
69TsSplineIsValidSampleType =
false;
71#define _TS_SUPPORT_SAMPLE_TYPE(unused, tuple) \
73 inline constexpr bool \
74 TsSplineIsValidSampleType< TS_SPLINE_VALUE_CPP_TYPE(tuple) > = true;
75TF_PP_SEQ_FOR_EACH(_TS_SUPPORT_SAMPLE_TYPE,
77 TS_SPLINE_SAMPLE_VERTEX_TYPES)
78#undef _TS_SUPPORT_SAMPLE_TYPE
93 TsInterpValueBlock = 0,
103 TsCurveTypeBezier = 0,
104 TsCurveTypeHermite = 1
114 TsExtrapValueBlock = 0,
118 TsExtrapLoopRepeat = 4,
119 TsExtrapLoopReset = 5,
120 TsExtrapLoopOscillate = 6
129enum TsSplineSampleSource
132 TsSourcePreExtrapLoop,
133 TsSourceInnerLoopPreEcho,
134 TsSourceInnerLoopProto,
135 TsSourceInnerLoopPostEcho,
138 TsSourcePostExtrapLoop,
164enum TsTangentAlgorithm
166 TsTangentAlgorithmNone,
167 TsTangentAlgorithmCustom,
168 TsTangentAlgorithmAutoEase
206 TsTime protoStart = 0.0;
207 TsTime protoEnd = 0.0;
208 int32_t numPreLoops = 0;
209 int32_t numPostLoops = 0;
210 double valueOffset = 0.0;
233 TsExtrapMode mode = TsExtrapHeld;
259 std::optional<double> loopBoundaryTime;
293template <
typename Vertex>
297 static_assert(TsSplineIsValidSampleType<Vertex>,
298 "The Vertex template parameter to TsSplineSamples must be one"
299 " of GfVec2d, GfVec2f, or GfVec2h.");
301 using Polyline = std::vector<Vertex>;
303 std::vector<Polyline> polylines;
316template <
typename Vertex>
320 static_assert(TsSplineIsValidSampleType<Vertex>,
321 "The Vertex template parameter to TsSplineSamplesWithSources"
322 " must be one of GfVec2d, GfVec2f, or GfVec2h.");
324 using Polyline = std::vector<Vertex>;
326 std::vector<Polyline> polylines;
327 std::vector<TsSplineSampleSource> sources;
335enum TsAntiRegressionMode
339 TsAntiRegressionNone,
345 TsAntiRegressionContain,
351 TsAntiRegressionKeepRatio,
356 TsAntiRegressionKeepStart
360PXR_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...