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,
153enum TsTangentAlgorithm
155 TsTangentAlgorithmNone,
156 TsTangentAlgorithmCustom,
157 TsTangentAlgorithmAutoEase
195 TsTime protoStart = 0.0;
196 TsTime protoEnd = 0.0;
197 int32_t numPreLoops = 0;
198 int32_t numPostLoops = 0;
199 double valueOffset = 0.0;
222 TsExtrapMode mode = TsExtrapHeld;
250template <
typename Vertex>
254 static_assert(TsSplineIsValidSampleType<Vertex>,
255 "The Vertex template parameter to TsSplineSamples must be one"
256 " of GfVec2d, GfVec2f, or GfVec2h.");
258 using Polyline = std::vector<Vertex>;
260 std::vector<Polyline> polylines;
273template <
typename Vertex>
277 static_assert(TsSplineIsValidSampleType<Vertex>,
278 "The Vertex template parameter to TsSplineSamplesWithSources"
279 " must be one of GfVec2d, GfVec2f, or GfVec2h.");
281 using Polyline = std::vector<Vertex>;
283 std::vector<Polyline> polylines;
284 std::vector<TsSplineSampleSource> sources;
289#define TS_SAMPLE_EXTERN_IMPL(unused, tuple) \
290 TS_API_TEMPLATE_CLASS( \
291 TsSplineSamples< TS_SPLINE_VALUE_CPP_TYPE(tuple) >); \
292 TS_API_TEMPLATE_CLASS( \
293 TsSplineSamplesWithSources< TS_SPLINE_VALUE_CPP_TYPE(tuple) >);
294TF_PP_SEQ_FOR_EACH(TS_SAMPLE_EXTERN_IMPL, ~, TS_SPLINE_SAMPLE_VERTEX_TYPES)
295#undef TS_SAMPLE_EXTERN_IMPL
302enum TsAntiRegressionMode
306 TsAntiRegressionNone,
312 TsAntiRegressionContain,
318 TsAntiRegressionKeepRatio,
323 TsAntiRegressionKeepStart
327PXR_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...