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"
21PXR_NAMESPACE_OPEN_SCOPE
29#define TS_SPLINE_SUPPORTED_VALUE_TYPES \
34#define TS_SPLINE_SAMPLE_VERTEX_TYPES \
39#define TS_SPLINE_VALUE_TYPE_NAME(x) TF_PP_TUPLE_ELEM(0, x)
40#define TS_SPLINE_VALUE_CPP_TYPE(x) TF_PP_TUPLE_ELEM(1, x)
45TsSplineIsValidDataType =
false;
47#define _TS_SUPPORT_DATA_TYPE(unused, tuple) \
49 inline constexpr bool \
50 TsSplineIsValidDataType< TS_SPLINE_VALUE_CPP_TYPE(tuple) > = true;
51TF_PP_SEQ_FOR_EACH(_TS_SUPPORT_DATA_TYPE,
53 TS_SPLINE_SUPPORTED_VALUE_TYPES)
54#undef _TS_SUPPORT_DATA_TYPE
60TsSplineIsValidSampleType =
false;
62#define _TS_SUPPORT_SAMPLE_TYPE(unused, tuple) \
64 inline constexpr bool \
65 TsSplineIsValidSampleType< TS_SPLINE_VALUE_CPP_TYPE(tuple) > = true;
66TF_PP_SEQ_FOR_EACH(_TS_SUPPORT_SAMPLE_TYPE,
68 TS_SPLINE_SAMPLE_VERTEX_TYPES)
69#undef _TS_SUPPORT_SAMPLE_TYPE
84 TsInterpValueBlock = 0,
94 TsCurveTypeBezier = 0,
95 TsCurveTypeHermite = 1
103 TsExtrapValueBlock = 0,
107 TsExtrapLoopRepeat = 4,
108 TsExtrapLoopReset = 5,
109 TsExtrapLoopOscillate = 6
118enum TsSplineSampleSource
121 TsSourcePreExtrapLoop,
122 TsSourceInnerLoopPreEcho,
123 TsSourceInnerLoopProto,
124 TsSourceInnerLoopPostEcho,
127 TsSourcePostExtrapLoop,
165 TsTime protoStart = 0.0;
166 TsTime protoEnd = 0.0;
167 int32_t numPreLoops = 0;
168 int32_t numPostLoops = 0;
169 double valueOffset = 0.0;
192 TsExtrapMode mode = TsExtrapHeld;
220template <
typename Vertex>
224 static_assert(TsSplineIsValidSampleType<Vertex>,
225 "The Vertex template parameter to TsSplineSamples must be one"
226 " of GfVec2d, GfVec2f, or GfVec2h.");
228 using Polyline = std::vector<Vertex>;
230 std::vector<Polyline> polylines;
243template <
typename Vertex>
247 static_assert(TsSplineIsValidSampleType<Vertex>,
248 "The Vertex template parameter to TsSplineSamplesWithSources"
249 " must be one of GfVec2d, GfVec2f, or GfVec2h.");
251 using Polyline = std::vector<Vertex>;
253 std::vector<Polyline> polylines;
254 std::vector<TsSplineSampleSource> sources;
259#define TS_SAMPLE_EXTERN_IMPL(unused, tuple) \
260 TS_API_TEMPLATE_CLASS( \
261 TsSplineSamples< TS_SPLINE_VALUE_CPP_TYPE(tuple) >); \
262 TS_API_TEMPLATE_CLASS( \
263 TsSplineSamplesWithSources< TS_SPLINE_VALUE_CPP_TYPE(tuple) >);
264TF_PP_SEQ_FOR_EACH(TS_SAMPLE_EXTERN_IMPL, ~, TS_SPLINE_SAMPLE_VERTEX_TYPES)
265#undef TS_SAMPLE_EXTERN_IMPL
272enum TsAntiRegressionMode
276 TsAntiRegressionNone,
282 TsAntiRegressionContain,
288 TsAntiRegressionKeepRatio,
293 TsAntiRegressionKeepStart
297PXR_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...