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;
253template <
typename Vertex>
257 static_assert(TsSplineIsValidSampleType<Vertex>,
258 "The Vertex template parameter to TsSplineSamples must be one"
259 " of GfVec2d, GfVec2f, or GfVec2h.");
261 using Polyline = std::vector<Vertex>;
263 std::vector<Polyline> polylines;
276template <
typename Vertex>
280 static_assert(TsSplineIsValidSampleType<Vertex>,
281 "The Vertex template parameter to TsSplineSamplesWithSources"
282 " must be one of GfVec2d, GfVec2f, or GfVec2h.");
284 using Polyline = std::vector<Vertex>;
286 std::vector<Polyline> polylines;
287 std::vector<TsSplineSampleSource> sources;
295enum TsAntiRegressionMode
299 TsAntiRegressionNone,
305 TsAntiRegressionContain,
311 TsAntiRegressionKeepRatio,
316 TsAntiRegressionKeepStart
320PXR_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...