8 #ifndef PXR_BASE_TS_KNOT_H
9 #define PXR_BASE_TS_KNOT_H
27 #include <type_traits>
74 TsKnot(
const TsKnot &other);
123 template <
typename T>
130 template <
typename T>
138 template <
typename T>
153 template <
typename T>
161 template <
typename T>
206 template <
typename T>
212 template <
typename T>
243 template <
typename T>
249 template <
typename T>
295 const std::optional<TsKnot> nextKnot,
322 const std::string &keyPath,
327 const std::string &keyPath)
const;
364 template <
typename T>
365 bool _CheckInParam(
T value)
const;
367 template <
typename T>
368 bool _CheckOutParam(
T *valueOut)
const;
370 bool _CheckSetWidth(TsTime width)
const;
371 bool _CheckInParamVt(
VtValue value)
const;
372 bool _CheckOutParamVt(
VtValue* value)
const;
374 template <
typename T>
377 template <
typename T>
393 std::unique_ptr<Ts_KnotDataProxy> _proxy;
422 template <
typename T,
443 #define _MAKE_CLAUSE(unused, tuple) \
444 static_assert(std::is_same_v<TF_PP_CAT(TF_PP_CAT(Ts, \
445 TS_SPLINE_VALUE_TYPE_NAME(tuple)), Knot), \
446 TsTypedKnot<TS_SPLINE_VALUE_CPP_TYPE(tuple)>>, \
447 "Incorrect type alias for TsKnot type: " #tuple);
456 template <
typename T>
457 bool TsKnot::_CheckInParam(
const T
value)
const
462 "Cannot pass non-floating-point type as T-typed knot parameter");
470 "Cannot set '%s' value into knot of type '%s'",
471 Ts_GetType<T>().GetTypeName().
c_str(),
486 template <
typename T>
487 bool TsKnot::_CheckOutParam(T *valueOut)
const
492 "Cannot pass non-floating-point type as T-typed knot parameter");
506 "Cannot read from knot of type '%s' into '%s'",
508 Ts_GetType<T>().GetTypeName().
c_str());
516 template <
typename T>
518 TsKnot::_TypedData()
const
523 template <
typename T>
525 TsKnot::_ConstTypedData()
const
533 template <
typename T>
539 template <
typename T>
542 if (!_CheckInParam(value))
547 _TypedData<T>()->value = value;
551 template <
typename T>
554 if (!_CheckOutParam(valueOut))
559 *valueOut = _ConstTypedData<T>()->
value;
563 template <
typename T>
566 if (!_CheckInParam(value))
572 _TypedData<T>()->preValue = value;
576 template <
typename T>
579 if (!_CheckOutParam(valueOut))
586 *valueOut = _ConstTypedData<T>()->preValue;
590 *valueOut = _ConstTypedData<T>()->
value;
599 template <
typename T>
602 if (!_CheckInParam(slope))
607 _TypedData<T>()->preTanSlope = slope;
611 template <
typename T>
614 if (!_CheckOutParam(slopeOut))
626 template <
typename T>
629 if (!_CheckInParam(slope))
634 _TypedData<T>()->postTanSlope = slope;
638 template <
typename T>
641 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
TS_API TsTangentAlgorithm GetPostTanAlgorithm() const
Get the post-tangent algorithm.
#define PXR_NAMESPACE_OPEN_SCOPE
GLsizei const GLfloat * value
TS_API bool SetPreTanAlgorithm(TsTangentAlgorithm algorithm)
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 TsTangentAlgorithm GetPreTanAlgorithm() const
Get the pre-tangent algorithm.
TS_API TsTime GetPreTanWidth() const
TS_API VtValue GetCustomDataByKey(const std::string &keyPath) const
TS_API bool UpdateTangents(const std::optional< TsKnot > prevKnot, const std::optional< TsKnot > nextKnot, TsCurveType curveType=TsCurveTypeBezier)
Update tangent values algorithmically.
TS_API bool SetPostTanWidth(TsTime width)
bool Ts_IsFinite(T value)
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 bool SetPostTanAlgorithm(TsTangentAlgorithm algorithm)
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