HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tangentConversions.h
Go to the documentation of this file.
1 //
2 // Copyright 2024 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 
8 #ifndef PXR_BASE_TS_TANGENT_CONVERSION_H
9 #define PXR_BASE_TS_TANGENT_CONVERSION_H
10 
11 #include "pxr/pxr.h"
12 #include "pxr/base/ts/types.h"
13 #include "pxr/base/vt/value.h"
14 
16 
17 template <typename T>
19  TsTime widthIn,
20  T slopeOrHeightIn,
21  bool convertHeightToSlope,
22  bool divideValuesByThree,
23  bool negateHeight,
24  TsTime* widthOut,
25  T* slopeOut);
26 
27 TS_API
29  TsTime widthIn,
30  const VtValue& slopeOrHeightIn,
31  bool convertHeightToSlope,
32  bool divideValuesByThree,
33  bool negateHeight,
34  TsTime* widthOut,
35  VtValue* slopeOut);
36 
37 template <typename T>
39  TsTime widthIn,
40  T slopeIn,
41  bool convertSlopeToHeight,
42  bool multiplyValuesByThree,
43  bool negateHeight,
44  TsTime* widthOut,
45  T* slopeOrHeightOut);
46 
47 TS_API
49  TsTime widthIn,
50  const VtValue& slopeIn,
51  bool convertSlopeToHeight,
52  bool multiplyValuesByThree,
53  bool negateHeight,
54  TsTime* widthOut,
55  VtValue* slopeOrHeightOut);
56 
57 ////////////////////////////////////////////////////////////////////////////////
58 // TEMPLATE HELPERS
59 template <typename T>
61  const TsTime widthIn,
62  const T slopeOrHeightIn,
63  bool convertHeightToSlope,
64  bool divideValuesByThree,
65  bool negateHeight,
66  TsTime* widthOut,
67  T* slopeOut);
68 
69 template <typename T>
71  TsTime widthIn,
72  T slopeIn,
73  bool convertSlopeToHeight,
74  bool multiplyValuesByThree,
75  bool negateHeight,
76  TsTime* widthOut,
77  T* slopeOrHeightOut);
78 
79 ////////////////////////////////////////////////////////////////////////////////
80 // TEMPLATE DEFINITIONS
81 
82 #define _MAKE_CLAUSE(unused, tuple) \
83  std::is_same_v<NonVolatileT, TS_SPLINE_VALUE_CPP_TYPE(tuple)> ||
84 
85 template <typename T>
87  const TsTime widthIn,
88  const T slopeOrHeightIn,
89  bool convertHeightToSlope,
90  bool divideValuesByThree,
91  bool negateHeight,
92  TsTime* widthOut,
93  T* slopeOut)
94 {
95  using NonVolatileT = typename std::remove_volatile<T>::type;
96 
97  static_assert((
99  false), "Can only use the values supported by the spline system.");
100 
102  widthIn, slopeOrHeightIn, convertHeightToSlope, divideValuesByThree,
103  negateHeight, widthOut, slopeOut);
104 }
105 
106 template <typename T>
108  const TsTime widthIn,
109  const T slopeIn,
110  bool convertSlopeToHeight,
111  bool multiplyValuesByThree,
112  bool negateHeight,
113  TsTime* widthOut,
114  T* slopeOrHeightOut)
115 {
116  using NonVolatileT = typename std::remove_volatile<T>::type;
117 
118  static_assert((
120  false), "Can only use the values supported by the spline system.");
121 
123  widthIn, slopeIn, convertSlopeToHeight, multiplyValuesByThree,
124  negateHeight, widthOut, slopeOrHeightOut);
125 }
126 
127 #undef _MAKE_CLAUSE
128 
130 
131 #endif
type
Definition: core.h:556
bool Ts_ConvertFromStandardHelper(TsTime widthIn, T slopeIn, bool convertSlopeToHeight, bool multiplyValuesByThree, bool negateHeight, TsTime *widthOut, T *slopeOrHeightOut)
bool Ts_ConvertToStandardHelper(const TsTime widthIn, const T slopeOrHeightIn, bool convertHeightToSlope, bool divideValuesByThree, bool negateHeight, TsTime *widthOut, T *slopeOut)
#define _MAKE_CLAUSE(unused, tuple)
PXR_NAMESPACE_OPEN_SCOPE bool TsConvertToStandardTangent(TsTime widthIn, T slopeOrHeightIn, bool convertHeightToSlope, bool divideValuesByThree, bool negateHeight, TsTime *widthOut, T *slopeOut)
#define TS_API
Definition: api.h:24
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define TF_PP_SEQ_FOR_EACH(_macro, data, seq)
bool TsConvertFromStandardTangent(TsTime widthIn, T slopeIn, bool convertSlopeToHeight, bool multiplyValuesByThree, bool negateHeight, TsTime *widthOut, T *slopeOrHeightOut)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
#define TS_SPLINE_SUPPORTED_VALUE_TYPES
Definition: types.h:29
Definition: value.h:146