24 #ifndef PXR_BASE_VT_TYPES_H
25 #define PXR_BASE_VT_TYPES_H
52 #define VT_FLOATING_POINT_BUILTIN_VALUE_TYPES \
53 (( double, Double )) \
57 #define VT_INTEGRAL_BUILTIN_VALUE_TYPES \
60 (( unsigned char, UChar )) \
62 (( unsigned short, UShort )) \
64 (( unsigned int, UInt )) \
65 (( int64_t, Int64 )) \
66 (( uint64_t, UInt64 ))
68 #define VT_VEC_INT_VALUE_TYPES \
69 (( GfVec4i, Vec4i )) \
70 (( GfVec3i, Vec3i )) \
73 #define VT_VEC_HALF_VALUE_TYPES \
74 (( GfVec4h, Vec4h )) \
75 (( GfVec3h, Vec3h )) \
78 #define VT_VEC_FLOAT_VALUE_TYPES \
79 (( GfVec4f, Vec4f )) \
80 (( GfVec3f, Vec3f )) \
83 #define VT_VEC_DOUBLE_VALUE_TYPES \
84 (( GfVec4d, Vec4d )) \
85 (( GfVec3d, Vec3d )) \
88 #define VT_VEC_VALUE_TYPES \
89 VT_VEC_INT_VALUE_TYPES \
90 VT_VEC_HALF_VALUE_TYPES \
91 VT_VEC_FLOAT_VALUE_TYPES \
92 VT_VEC_DOUBLE_VALUE_TYPES
94 #define VT_MATRIX_FLOAT_VALUE_TYPES \
95 (( GfMatrix4f, Matrix4f )) \
96 (( GfMatrix3f, Matrix3f )) \
97 (( GfMatrix2f, Matrix2f )) \
99 #define VT_MATRIX_DOUBLE_VALUE_TYPES \
100 (( GfMatrix4d, Matrix4d )) \
101 (( GfMatrix3d, Matrix3d )) \
102 (( GfMatrix2d, Matrix2d ))
104 #define VT_MATRIX_VALUE_TYPES \
105 VT_MATRIX_FLOAT_VALUE_TYPES \
106 VT_MATRIX_DOUBLE_VALUE_TYPES \
108 #define VT_GFRANGE_VALUE_TYPES \
109 (( GfRange3f, Range3f )) \
110 (( GfRange3d, Range3d )) \
111 (( GfRange2f, Range2f )) \
112 (( GfRange2d, Range2d )) \
113 (( GfRange1f, Range1f )) \
114 (( GfRange1d, Range1d ))
116 #define VT_RANGE_VALUE_TYPES \
117 VT_GFRANGE_VALUE_TYPES \
118 (( GfInterval, Interval )) \
119 (( GfRect2i, Rect2i ))
121 #define VT_STRING_VALUE_TYPES \
122 (( std::string, String )) \
125 #define VT_QUATERNION_VALUE_TYPES \
126 (( GfQuath, Quath )) \
127 (( GfQuatf, Quatf )) \
128 (( GfQuatd, Quatd )) \
129 (( GfQuaternion, Quaternion ))
131 #define VT_DUALQUATERNION_VALUE_TYPES \
132 (( GfDualQuath, DualQuath )) \
133 (( GfDualQuatf, DualQuatf )) \
134 (( GfDualQuatd, DualQuatd ))
136 #define VT_NONARRAY_VALUE_TYPES \
137 (( GfFrustum, Frustum)) \
138 (( GfMultiInterval, MultiInterval))
141 #define VT_TYPE(elem) \
142 TF_PP_TUPLE_ELEM(0, elem)
143 #define VT_TYPE_NAME(elem) \
144 TF_PP_TUPLE_ELEM(1, elem)
148 #define VT_BUILTIN_NUMERIC_VALUE_TYPES \
149 VT_INTEGRAL_BUILTIN_VALUE_TYPES VT_FLOATING_POINT_BUILTIN_VALUE_TYPES
151 #define VT_BUILTIN_VALUE_TYPES \
152 VT_BUILTIN_NUMERIC_VALUE_TYPES VT_STRING_VALUE_TYPES
154 #define VT_SCALAR_CLASS_VALUE_TYPES \
156 VT_MATRIX_VALUE_TYPES \
157 VT_RANGE_VALUE_TYPES \
158 VT_QUATERNION_VALUE_TYPES \
159 VT_DUALQUATERNION_VALUE_TYPES
161 #define VT_SCALAR_VALUE_TYPES \
162 VT_SCALAR_CLASS_VALUE_TYPES VT_BUILTIN_VALUE_TYPES
171 #define VT_ARRAY_TYPEDEF(unused, elem) \
172 typedef VtArray< VT_TYPE(elem) > \
173 TF_PP_CAT(Vt, TF_PP_CAT(VT_TYPE_NAME(elem), Array)) ;
178 #define VT_ARRAY_TYPE_TUPLE(unused, elem) \
179 (( TF_PP_CAT(Vt, TF_PP_CAT(VT_TYPE_NAME(elem), Array)) , \
180 TF_PP_CAT(VT_TYPE_NAME(elem), Array) ))
181 #define VT_ARRAY_VALUE_TYPES \
182 TF_PP_SEQ_FOR_EACH(VT_ARRAY_TYPE_TUPLE, ~, VT_SCALAR_VALUE_TYPES)
184 #define VT_CLASS_VALUE_TYPES \
185 VT_ARRAY_VALUE_TYPES VT_SCALAR_CLASS_VALUE_TYPES VT_NONARRAY_VALUE_TYPES
187 #define VT_VALUE_TYPES \
188 VT_BUILTIN_VALUE_TYPES VT_CLASS_VALUE_TYPES
190 #define _VT_MAP_TYPE_LIST(unused, elem) , VT_TYPE(elem)
199 namespace Vt_KnownValueTypeDetail
204 template <
typename T>
210 template <
typename T,
typename Typelist>
216 else if (
const int indexOfTail =
219 return 1 + indexOfTail;
226 template <
typename T>
256 constexpr
int index = Vt_KnownValueTypeDetail::GetIndex<T>();
257 static_assert(index != -1,
"T is not one of the known VT_VALUE_TYPES.");
266 return Vt_KnownValueTypeDetail::GetIndex<T>() != -1;
275 static const bool value = VtIsKnownValueType<T>();
281 #define VT_SPECIALIZE_IS_VALUE_PROXY(unused, elem) \
283 VtIsValueProxy< VT_TYPE(elem) > : std::false_type {}; \
285 VtIsTypedValueProxy< VT_TYPE(elem) > : std::false_type {}; \
287 VtIsErasedValueProxy< VT_TYPE(elem) > : std::false_type {};
289 #undef VT_SPECIALIZE_IS_VALUE_PROXY
311 if (thisRank != otherRank)
317 return !(*
this == other);
320 memset(
this, 0,
sizeof(*
this));
329 #endif // PXR_BASE_VT_TYPES_H
bool operator!=(Vt_ShapeData const &other) const
PXR_NAMESPACE_OPEN_SCOPE VT_TYPE_IS_CHEAP_TO_COPY(TfToken)
unsigned int GetRank() const
IMATH_HOSTDEVICE constexpr bool equal(T1 a, T2 b, T3 t) IMATH_NOEXCEPT
#define VT_SPECIALIZE_IS_VALUE_PROXY(unused, elem)
TF_PP_SEQ_FOR_EACH(SDF_DECLARE_VALUE_TYPE_TRAITS,~, SDF_VALUE_TYPES)
#define VT_SCALAR_VALUE_TYPES
constexpr int VtGetKnownValueTypeIndex()
constexpr bool VtIsKnownValueType()
Returns true if T is a type that appears in VT_VALUE_TYPES.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define _VT_MAP_TYPE_LIST(unused, elem)
unsigned int otherDims[NumOtherDims]
#define PXR_NAMESPACE_CLOSE_SCOPE
static const int NumOtherDims
constexpr int VtGetNumKnownValueTypes()
constexpr int GetIndexImpl(TfMetaList<>)
bool operator==(Vt_ShapeData const &other) const
TfMetaApply< TfMetaTail, TfMetaList< void TF_PP_SEQ_FOR_EACH(_VT_MAP_TYPE_LIST,~, VT_VALUE_TYPES)>> Vt_ValueTypeList
#define VT_ARRAY_TYPEDEF(unused, elem)