HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
types.h File Reference
#include "pxr/pxr.h"
#include "pxr/base/ts/api.h"
#include "pxr/base/gf/interval.h"
#include "pxr/base/gf/vec2d.h"
#include "pxr/base/tf/preprocessorUtilsLite.h"
#include <cstdint>
#include <vector>
+ Include dependency graph for types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TsLoopParams
 
class  TsExtrapolation
 
class  TsSplineSamples< Vertex >
 TsSplineSamples<Vertex> holds a collection of piecewise linear polylines that approximate a TsSpline. More...
 
class  TsSplineSamplesWithSources< Vertex >
 TsSplineSamplesWithSources<Vertex> is a TsSplineSamples<Vertex> that also includes source information for each polyline. More...
 

Macros

#define TS_SPLINE_SUPPORTED_VALUE_TYPES
 
#define TS_SPLINE_SAMPLE_VERTEX_TYPES
 
#define TS_SPLINE_VALUE_TYPE_NAME(x)   TF_PP_TUPLE_ELEM(0, x)
 
#define TS_SPLINE_VALUE_CPP_TYPE(x)   TF_PP_TUPLE_ELEM(1, x)
 
#define _TS_SUPPORT_DATA_TYPE(unused, tuple)
 
#define _TS_SUPPORT_SAMPLE_TYPE(unused, tuple)
 

Enumerations

enum  TsInterpMode { TsInterpValueBlock = 0, TsInterpHeld = 1, TsInterpLinear = 2, TsInterpCurve = 3 }
 
enum  TsCurveType { TsCurveTypeBezier = 0, TsCurveTypeHermite = 1 }
 
enum  TsExtrapMode {
  TsExtrapValueBlock = 0, TsExtrapHeld = 1, TsExtrapLinear = 2, TsExtrapSloped = 3,
  TsExtrapLoopRepeat = 4, TsExtrapLoopReset = 5, TsExtrapLoopOscillate = 6
}
 
enum  TsSplineSampleSource {
  TsSourcePreExtrap, TsSourcePreExtrapLoop, TsSourceInnerLoopPreEcho, TsSourceInnerLoopProto,
  TsSourceInnerLoopPostEcho, TsSourceKnotInterp, TsSourcePostExtrap, TsSourcePostExtrapLoop
}
 
enum  TsTangentAlgorithm { TsTangentAlgorithmNone, TsTangentAlgorithmCustom, TsTangentAlgorithmAutoEase }
 
enum  TsAntiRegressionMode { TsAntiRegressionNone, TsAntiRegressionContain, TsAntiRegressionKeepRatio, TsAntiRegressionKeepStart }
 

Functions

 TF_PP_SEQ_FOR_EACH (_TS_SUPPORT_DATA_TYPE,~, TS_SPLINE_SUPPORTED_VALUE_TYPES) template< class T > inline const expr bool TsSplineIsValidSampleType
 True if template parameter T is a supported spline sampling vertex type. More...
 
 TF_PP_SEQ_FOR_EACH (_TS_SUPPORT_SAMPLE_TYPE,~, TS_SPLINE_SAMPLE_VERTEX_TYPES) using TsTime
 

Variables

template<class T >
constexpr bool TsSplineIsValidDataType = false
 True if template parameter T is a supported spline data type. More...
 

Macro Definition Documentation

#define _TS_SUPPORT_DATA_TYPE (   unused,
  tuple 
)
Value:
template <> \
inline constexpr bool \
TsSplineIsValidDataType< TS_SPLINE_VALUE_CPP_TYPE(tuple) > = true;

Definition at line 47 of file types.h.

#define _TS_SUPPORT_SAMPLE_TYPE (   unused,
  tuple 
)
Value:
template <> \
inline constexpr bool \
TsSplineIsValidSampleType< TS_SPLINE_VALUE_CPP_TYPE(tuple) > = true;

Definition at line 62 of file types.h.

#define TS_SPLINE_SAMPLE_VERTEX_TYPES
Value:
((Vec2d, GfVec2d)) \
((Vec2f, GfVec2f)) \
((Vec2h, GfVec2h))
Definition: vec2d.h:45
Definition: vec2h.h:46
Definition: vec2f.h:45
math::Vec2< float > Vec2f
Definition: Types.h:46

Definition at line 34 of file types.h.

#define TS_SPLINE_SUPPORTED_VALUE_TYPES

Sequence of value types that are supported by the spline system.

  • double
  • float
  • GfHalf

Definition at line 29 of file types.h.

#define TS_SPLINE_VALUE_CPP_TYPE (   x)    TF_PP_TUPLE_ELEM(1, x)

Definition at line 40 of file types.h.

#define TS_SPLINE_VALUE_TYPE_NAME (   x)    TF_PP_TUPLE_ELEM(0, x)

Definition at line 39 of file types.h.

Enumeration Type Documentation

Modes for enforcing non-regression in splines.

See page_ts_regression for a general introduction to regression and anti-regression.

Enumerator
TsAntiRegressionNone 

Do not enforce. If there is regression, runtime evaluation will use KeepRatio.

TsAntiRegressionContain 

Prevent tangents from crossing neighboring knots. This guarantees non-regression, but is slightly over-conservative, preventing the authoring of some extreme curves that cannot be created without non-contained tangents.

TsAntiRegressionKeepRatio 

If there is regression in a segment, shorten both of its tangents until the regression is just barely prevented (the curve comes to a near-standstill at some time). Preserve the ratio of the tangent lengths.

TsAntiRegressionKeepStart 

If there is regression in a segment, leave its start tangent alone, and shorten its end tangent until the regression is just barely prevented. This matches Maya behavior.

Definition at line 295 of file types.h.

Type of interpolation for a spline's Curve segments.

Enumerator
TsCurveTypeBezier 
TsCurveTypeHermite 

Definition at line 92 of file types.h.

Curve-shaping mode for one of a spline's extrapolation regions (before all knots and after all knots).

Enumerator
TsExtrapValueBlock 
TsExtrapHeld 
TsExtrapLinear 
TsExtrapSloped 
TsExtrapLoopRepeat 
TsExtrapLoopReset 
TsExtrapLoopOscillate 

Definition at line 101 of file types.h.

Interpolation mode for a spline segment (region between two knots).

Enumerator
TsInterpValueBlock 
TsInterpHeld 
TsInterpLinear 
TsInterpCurve 

Definition at line 82 of file types.h.

The source for a particular part of a sampled spline. A TsSpline can have a number of different regions. The source is not important to the values that vary over time, but if the spline is sampled and displayed in a user interface, the source can be used to highlight different regions of the displayed spline.

Enumerator
TsSourcePreExtrap 
TsSourcePreExtrapLoop 
TsSourceInnerLoopPreEcho 
TsSourceInnerLoopProto 
TsSourceInnerLoopPostEcho 
TsSourceKnotInterp 
TsSourcePostExtrap 
TsSourcePostExtrapLoop 

Definition at line 118 of file types.h.

Automatic tangent calculation algorithms.

Which automatic tangent algorithm to use.

  • None - Tangents are not automatically calculated, the provided values are used. Note that the tangent values are still subject to modification by the spline's anti-regression setting.
  • Custom - The tangent algorithm is determined by the "preTanAlgorithm" and "postTanAlgorithm" keys in the knot's custom data. These custom data keys are reserved for this purpose. If the custom data values do not exist or if their value cannot be understood, then Custom behaves as if the None algorithm was used. Note that the Custom algorithm is not yet implemented so it currently always behaves like None.
  • AutoEase - Use the "Auto Ease" algorithm from Maya/animX. This is a cubic controlled blending algorithm that computes a slope between the slopes to the knots on either side of this knot. If there is a discontinuity in the spline at this knot (this knot has no previous or next knot, is dual valued, or is adjacent to a value blocked segment of the spline) then the slope will be 0 (flat).
See Also
TsKnot::SetPreTanAlgorithm, TsKnot::SetPostTanAlgorithm
Enumerator
TsTangentAlgorithmNone 
TsTangentAlgorithmCustom 
TsTangentAlgorithmAutoEase 

Definition at line 153 of file types.h.

Function Documentation

TF_PP_SEQ_FOR_EACH ( _TS_SUPPORT_DATA_TYPE  ,
,
TS_SPLINE_SUPPORTED_VALUE_TYPES   
) const

True if template parameter T is a supported spline sampling vertex type.

TF_PP_SEQ_FOR_EACH ( _TS_SUPPORT_SAMPLE_TYPE  ,
,
TS_SPLINE_SAMPLE_VERTEX_TYPES   
)

Variable Documentation

template<class T >
constexpr bool TsSplineIsValidDataType = false
inline

True if template parameter T is a supported spline data type.

Definition at line 45 of file types.h.