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
209 TsTime protoStart = 0.0;
210 TsTime protoEnd = 0.0;
211 int32_t numPreLoops = 0;
212 int32_t numPostLoops = 0;
213 double valueOffset = 0.0;
236 TsExtrapMode mode = TsExtrapHeld;
262 std::optional<double> loopBoundaryTime;
296template <
typename Vertex>
300 static_assert(TsSplineIsValidSampleType<Vertex>,
301 "The Vertex template parameter to TsSplineSamples must be one"
302 " of GfVec2d, GfVec2f, or GfVec2h.");
304 using Polyline = std::vector<Vertex>;
306 std::vector<Polyline> polylines;
319template <
typename Vertex>
323 static_assert(TsSplineIsValidSampleType<Vertex>,
324 "The Vertex template parameter to TsSplineSamplesWithSources"
325 " must be one of GfVec2d, GfVec2f, or GfVec2h.");
327 using Polyline = std::vector<Vertex>;
329 std::vector<Polyline> polylines;
330 std::vector<TsSplineSampleSource> sources;
338enum TsAntiRegressionMode
342 TsAntiRegressionNone,
348 TsAntiRegressionContain,
354 TsAntiRegressionKeepRatio,
359 TsAntiRegressionKeepStart
363PXR_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...