HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
interpolation.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_USD_USD_INTERPOLATION_H
8 #define PXR_USD_USD_INTERPOLATION_H
9 
10 /// \file usd/interpolation.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usd/api.h"
14 #include "pxr/usd/sdf/timeCode.h"
15 #include "pxr/base/vt/array.h"
16 #include "pxr/base/gf/declare.h"
17 
19 
20 
21 /// \enum UsdInterpolationType
22 ///
23 /// Attribute value interpolation options.
24 ///
25 /// See \ref Usd_AttributeInterpolation for more details.
26 ///
28 {
29  UsdInterpolationTypeHeld, ///< Held interpolation
30  UsdInterpolationTypeLinear ///< Linear interpolation
31 };
32 
33 /// \anchor USD_LINEAR_INTERPOLATION_TYPES
34 /// Sequence of value types that support linear interpolation.
35 /// These types and VtArrays of these types are supported:
36 /// \li <b>GfHalf</b>
37 /// \li <b>float</b>
38 /// \li <b>double</b>
39 /// \li <b>SdfTimeCode</b>
40 /// \li <b>GfMatrix2d</b>
41 /// \li <b>GfMatrix3d</b>
42 /// \li <b>GfMatrix4d</b>
43 /// \li <b>GfVec2d</b>
44 /// \li <b>GfVec2f</b>
45 /// \li <b>GfVec2h</b>
46 /// \li <b>GfVec3d</b>
47 /// \li <b>GfVec3f</b>
48 /// \li <b>GfVec3h</b>
49 /// \li <b>GfVec4d</b>
50 /// \li <b>GfVec4f</b>
51 /// \li <b>GfVec4h</b>
52 /// \li <b>GfQuatd</b> (via quaternion slerp)
53 /// \li <b>GfQuatf</b> (via quaternion slerp)
54 /// \li <b>GfQuath</b> (via quaternion slerp)
55 /// \hideinitializer
56 #define USD_LINEAR_INTERPOLATION_TYPES \
57  (GfHalf) (VtArray<GfHalf>) \
58  (float) (VtArray<float>) \
59  (double) (VtArray<double>) \
60  (SdfTimeCode) (VtArray<SdfTimeCode>) \
61  (GfMatrix2d) (VtArray<GfMatrix2d>) \
62  (GfMatrix3d) (VtArray<GfMatrix3d>) \
63  (GfMatrix4d) (VtArray<GfMatrix4d>) \
64  (GfVec2d) (VtArray<GfVec2d>) \
65  (GfVec2f) (VtArray<GfVec2f>) \
66  (GfVec2h) (VtArray<GfVec2h>) \
67  (GfVec3d) (VtArray<GfVec3d>) \
68  (GfVec3f) (VtArray<GfVec3f>) \
69  (GfVec3h) (VtArray<GfVec3h>) \
70  (GfVec4d) (VtArray<GfVec4d>) \
71  (GfVec4f) (VtArray<GfVec4f>) \
72  (GfVec4h) (VtArray<GfVec4h>) \
73  (GfQuatd) (VtArray<GfQuatd>) \
74  (GfQuatf) (VtArray<GfQuatf>) \
75  (GfQuath) (VtArray<GfQuath>)
76 
77 /// \struct UsdLinearInterpolationTraits
78 ///
79 /// Traits class describing whether a particular C++ value type
80 /// supports linear interpolation.
81 ///
82 /// UsdLinearInterpolationTraits<T>::isSupported will be true for all
83 /// types listed in the USD_LINEAR_INTERPOLATION_TYPES sequence.
84 template <class T>
86 {
87  static const bool isSupported = false;
88 };
89 
90 /// \cond INTERNAL
91 #define _USD_DECLARE_INTERPOLATION_TRAITS(unused, type) \
92 template <> \
93 struct UsdLinearInterpolationTraits<type> \
94 { \
95  static const bool isSupported = true; \
96 };
97 
98 TF_PP_SEQ_FOR_EACH(_USD_DECLARE_INTERPOLATION_TRAITS, ~,
100 
101 #undef _USD_DECLARE_INTERPOLATION_TRAITS
102 /// \endcond
103 
104 
106 
107 #endif // PXR_USD_USD_INTERPOLATION_H
Linear interpolation.
Definition: interpolation.h:30
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static const bool isSupported
Definition: interpolation.h:87
#define TF_PP_SEQ_FOR_EACH(_macro, data, seq)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Held interpolation.
Definition: interpolation.h:29
UsdInterpolationType
Definition: interpolation.h:27
#define USD_LINEAR_INTERPOLATION_TYPES
Definition: interpolation.h:56