8#ifndef PXR_BASE_TS_TANGENT_CONVERSION_H
9#define PXR_BASE_TS_TANGENT_CONVERSION_H
12#include "pxr/base/ts/types.h"
13#include "pxr/base/vt/value.h"
15PXR_NAMESPACE_OPEN_SCOPE
18bool TsConvertToStandardTangent(
21 bool convertHeightToSlope,
22 bool divideValuesByThree,
28bool TsConvertToStandardTangent(
31 bool convertHeightToSlope,
32 bool divideValuesByThree,
38bool TsConvertFromStandardTangent(
41 bool convertSlopeToHeight,
42 bool multiplyValuesByThree,
48bool TsConvertFromStandardTangent(
51 bool convertSlopeToHeight,
52 bool multiplyValuesByThree,
60bool Ts_ConvertToStandardHelper(
62 const T slopeOrHeightIn,
63 bool convertHeightToSlope,
64 bool divideValuesByThree,
70bool Ts_ConvertFromStandardHelper(
73 bool convertSlopeToHeight,
74 bool multiplyValuesByThree,
82#define _MAKE_CLAUSE(unused, tuple) \
83 std::is_same_v<NonVolatileT, TS_SPLINE_VALUE_CPP_TYPE(tuple)> ||
86bool TsConvertToStandardTangent(
88 const T slopeOrHeightIn,
89 bool convertHeightToSlope,
90 bool divideValuesByThree,
95 using NonVolatileT =
typename std::remove_volatile<T>::type;
98 TF_PP_SEQ_FOR_EACH(_MAKE_CLAUSE, ~, TS_SPLINE_SUPPORTED_VALUE_TYPES) \
99 false),
"Can only use the values supported by the spline system.");
101 return Ts_ConvertToStandardHelper(
102 widthIn, slopeOrHeightIn, convertHeightToSlope, divideValuesByThree,
103 negateHeight, widthOut, slopeOut);
107bool TsConvertFromStandardTangent(
108 const TsTime widthIn,
110 bool convertSlopeToHeight,
111 bool multiplyValuesByThree,
116 using NonVolatileT =
typename std::remove_volatile<T>::type;
119 TF_PP_SEQ_FOR_EACH(_MAKE_CLAUSE, ~, TS_SPLINE_SUPPORTED_VALUE_TYPES) \
120 false),
"Can only use the values supported by the spline system.");
122 return Ts_ConvertFromStandardHelper(
123 widthIn, slopeIn, convertSlopeToHeight, multiplyValuesByThree,
124 negateHeight, widthOut, slopeOrHeightOut);
129PXR_NAMESPACE_CLOSE_SCOPE
Provides a container which may hold any type, and provides introspection and iteration over array typ...