8#ifndef PXR_BASE_TS_TYPES_H
9#define PXR_BASE_TS_TYPES_H
12#include "pxr/base/ts/api.h"
16#include "pxr/base/tf/preprocessorUtilsLite.h"
22PXR_NAMESPACE_OPEN_SCOPE
30#define TS_SPLINE_SUPPORTED_VALUE_TYPES \
35#define TS_SPLINE_SAMPLE_VERTEX_TYPES \
40#define TS_SPLINE_VALUE_TYPE_NAME(x) TF_PP_TUPLE_ELEM(0, x)
41#define TS_SPLINE_VALUE_CPP_TYPE(x) TF_PP_TUPLE_ELEM(1, x)
46TsSplineIsValidDataType =
false;
48#define _TS_SUPPORT_DATA_TYPE(unused, tuple) \
50 inline constexpr bool \
51 TsSplineIsValidDataType< TS_SPLINE_VALUE_CPP_TYPE(tuple) > = true;
52TF_PP_SEQ_FOR_EACH(_TS_SUPPORT_DATA_TYPE,
54 TS_SPLINE_SUPPORTED_VALUE_TYPES)
55#undef _TS_SUPPORT_DATA_TYPE
61TsSplineIsValidSampleType =
false;
63#define _TS_SUPPORT_SAMPLE_TYPE(unused, tuple) \
65 inline constexpr bool \
66 TsSplineIsValidSampleType< TS_SPLINE_VALUE_CPP_TYPE(tuple) > = true;
67TF_PP_SEQ_FOR_EACH(_TS_SUPPORT_SAMPLE_TYPE,
69 TS_SPLINE_SAMPLE_VERTEX_TYPES)
70#undef _TS_SUPPORT_SAMPLE_TYPE
85 TsInterpValueBlock = 0,
95 TsCurveTypeBezier = 0,
96 TsCurveTypeHermite = 1
106 TsExtrapValueBlock = 0,
110 TsExtrapLoopRepeat = 4,
111 TsExtrapLoopReset = 5,
112 TsExtrapLoopOscillate = 6
121enum TsSplineSampleSource
124 TsSourcePreExtrapLoop,
125 TsSourceInnerLoopPreEcho,
126 TsSourceInnerLoopProto,
127 TsSourceInnerLoopPostEcho,
130 TsSourcePostExtrapLoop,
156enum TsTangentAlgorithm
158 TsTangentAlgorithmNone,
159 TsTangentAlgorithmCustom,
160 TsTangentAlgorithmAutoEase
198 TsTime protoStart = 0.0;
199 TsTime protoEnd = 0.0;
200 int32_t numPreLoops = 0;
201 int32_t numPostLoops = 0;
202 double valueOffset = 0.0;
225 TsExtrapMode mode = TsExtrapHeld;
251 std::optional<double> loopBoundaryTime;
285template <
typename Vertex>
289 static_assert(TsSplineIsValidSampleType<Vertex>,
290 "The Vertex template parameter to TsSplineSamples must be one"
291 " of GfVec2d, GfVec2f, or GfVec2h.");
293 using Polyline = std::vector<Vertex>;
295 std::vector<Polyline> polylines;
308template <
typename Vertex>
312 static_assert(TsSplineIsValidSampleType<Vertex>,
313 "The Vertex template parameter to TsSplineSamplesWithSources"
314 " must be one of GfVec2d, GfVec2f, or GfVec2h.");
316 using Polyline = std::vector<Vertex>;
318 std::vector<Polyline> polylines;
319 std::vector<TsSplineSampleSource> sources;
327enum TsAntiRegressionMode
331 TsAntiRegressionNone,
337 TsAntiRegressionContain,
343 TsAntiRegressionKeepRatio,
348 TsAntiRegressionKeepStart
352PXR_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...