8 #ifndef PXR_BASE_TS_KNOT_H
9 #define PXR_BASE_TS_KNOT_H
26 #include <type_traits>
64 TsKnot(
const TsKnot &other);
113 template <
typename T>
120 template <
typename T>
128 template <
typename T>
143 template <
typename T>
151 template <
typename T>
197 template <
typename T>
203 template <
typename T>
219 template <
typename T>
225 template <
typename T>
252 const std::string &keyPath,
257 const std::string &keyPath)
const;
294 template <
typename T>
295 bool _CheckInParam(
T value)
const;
297 template <
typename T>
298 bool _CheckOutParam(
T *valueOut)
const;
300 bool _CheckGetWidth()
const;
301 bool _CheckSetWidth(TsTime width)
const;
302 bool _CheckInParamVt(
VtValue value)
const;
303 bool _CheckOutParamVt(
VtValue* value)
const;
305 template <
typename T>
308 template <
typename T>
324 std::unique_ptr<Ts_KnotDataProxy> _proxy;
353 template <
typename T,
374 #define _MAKE_CLAUSE(unused, tuple) \
375 static_assert(std::is_same_v<TF_PP_CAT(TF_PP_CAT(Ts, \
376 TS_SPLINE_VALUE_TYPE_NAME(tuple)), Knot), \
377 TsTypedKnot<TS_SPLINE_VALUE_CPP_TYPE(tuple)>>, \
378 "Incorrect type alias for TsKnot type: " #tuple);
387 template <
typename T>
388 bool TsKnot::_CheckInParam(
const T
value)
const
393 "Cannot pass non-floating-point type as T-typed knot parameter");
401 "Cannot set '%s' value into knot of type '%s'",
402 Ts_GetType<T>().GetTypeName().
c_str(),
417 template <
typename T>
418 bool TsKnot::_CheckOutParam(T *valueOut)
const
423 "Cannot pass non-floating-point type as T-typed knot parameter");
437 "Cannot read from knot of type '%s' into '%s'",
439 Ts_GetType<T>().GetTypeName().
c_str());
447 template <
typename T>
449 TsKnot::_TypedData()
const
454 template <
typename T>
456 TsKnot::_ConstTypedData()
const
464 template <
typename T>
470 template <
typename T>
473 if (!_CheckInParam(value))
478 _TypedData<T>()->value = value;
482 template <
typename T>
485 if (!_CheckOutParam(valueOut))
490 *valueOut = _ConstTypedData<T>()->
value;
494 template <
typename T>
497 if (!_CheckInParam(value))
503 _TypedData<T>()->preValue = value;
507 template <
typename T>
510 if (!_CheckOutParam(valueOut))
517 *valueOut = _ConstTypedData<T>()->preValue;
521 *valueOut = _ConstTypedData<T>()->
value;
530 template <
typename T>
533 if (!_CheckInParam(slope))
538 _TypedData<T>()->preTanSlope = slope;
542 template <
typename T>
545 if (!_CheckOutParam(slopeOut))
557 template <
typename T>
560 if (!_CheckInParam(slope))
565 _TypedData<T>()->postTanSlope = slope;
569 template <
typename T>
572 if (!_CheckOutParam(slopeOut))
TS_API bool IsC0Continuous() const
Not yet implemented.
TS_API bool SetCustomDataByKey(const std::string &keyPath, VtValue value)
TS_API bool SetTime(TsTime time)
TS_API bool GetValue(VtValue *valueOut) const
TS_API bool operator==(const TsKnot &other) const
Default constructor creates a double-typed knot.
GT_API const UT_StringHolder time
GLsizei const GLfloat * value
const Ts_KnotData * _GetData() const
TS_API TsCurveType GetCurveType() const
TS_API bool GetPreTanSlope(VtValue *slopeOut) const
TS_API bool SetPreValue(VtValue value)
TS_API bool SetValue(VtValue value)
#define _MAKE_CLAUSE(unused, tuple)
TS_API bool SetPreTanSlope(VtValue slope)
TS_API TfType GetValueType() const
TS_API TsInterpMode GetNextInterpolation() const
Sets the interpolation mode of the spline segment following this knot.
TS_API TsTime GetPostTanWidth() const
TS_API bool SetPreTanWidth(TsTime width)
TS_API std::ostream & operator<<(std::ostream &out, const TsKnot &knot)
Output a text representation of a spline to a stream.
TS_API bool SetCustomData(VtDictionary customData)
TS_API TsTime GetTime() const
TS_API bool SetNextInterpolation(TsInterpMode mode)
Sets the interpolation mode of the spline segment following this knot.
TS_API bool operator!=(const TsKnot &other) const
Default constructor creates a double-typed knot.
TS_API TsTime GetPreTanWidth() const
TS_API VtValue GetCustomDataByKey(const std::string &keyPath) const
TS_API bool SetPostTanWidth(TsTime width)
bool Ts_IsFinite(T value)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
TS_API bool IsC1Continuous() const
Not yet implemented.
#define TF_PP_SEQ_FOR_EACH(_macro, data, seq)
#define PXR_NAMESPACE_CLOSE_SCOPE
PXR_NAMESPACE_OPEN_SCOPE TfType Ts_GetType()
TS_API bool GetPostTanSlope(VtValue *slopeOut) const
TS_API bool SetPostTanSlope(VtValue slope)
#define TS_SPLINE_SUPPORTED_VALUE_TYPES
TS_API bool IsG1Continuous() const
Not yet implemented.
OIIO_UTIL_API const char * c_str(string_view str)
TS_API bool ClearPreValue()
TS_API ~TsKnot()
Default constructor creates a double-typed knot.
TS_API TsKnot & operator=(const TsKnot &other)
Default constructor creates a double-typed knot.
TS_API bool SetCurveType(TsCurveType curveType)
TS_API VtDictionary GetCustomData() const
TS_API TsKnot()
Default constructor creates a double-typed knot.
TS_API bool GetPreValue(VtValue *valueOut) const
TS_API bool IsDualValued() const