All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
animQueryImpl.h
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef USDSKEL_ANIMQUERYIMPL_H
25 #define USDSKEL_ANIMQUERYIMPL_H
26 
28 
29 #include "pxr/base/tf/declarePtrs.h"
30 #include "pxr/base/tf/refBase.h"
31 #include "pxr/base/vt/types.h"
32 
33 #include "pxr/usd/usdGeom/xformable.h"
34 
35 #include "pxr/usd/sdf/path.h"
36 #include "pxr/usd/sdf/types.h"
37 
38 
39 PXR_NAMESPACE_OPEN_SCOPE
40 
41 
42 class UsdAttribute;
43 class UsdPrim;
44 class UsdTimeCode;
45 
46 
48 
49 
56 {
57 public:
59  static UsdSkel_AnimQueryImplRefPtr New(const UsdPrim& prim);
60 
61  virtual ~UsdSkel_AnimQueryImpl() {}
62 
63  virtual UsdPrim GetPrim() const = 0;
64 
65  virtual bool ComputeJointLocalTransforms(VtMatrix4dArray* xforms,
66  UsdTimeCode time) const = 0;
67 
68  virtual bool ComputeJointLocalTransforms(VtMatrix4fArray* xforms,
69  UsdTimeCode time) const = 0;
70 
71  virtual bool ComputeJointLocalTransformComponents(
72  VtVec3fArray* translations,
73  VtQuatfArray* rotations,
74  VtVec3hArray* scales,
75  UsdTimeCode time) const = 0;
76 
77  virtual bool
78  GetJointTransformTimeSamples(const GfInterval& interval,
79  std::vector<double>* times) const = 0;
80 
81  virtual bool
82  GetJointTransformAttributes(std::vector<UsdAttribute>* attrs) const = 0;
83 
84  virtual bool JointTransformsMightBeTimeVarying() const = 0;
85 
86  virtual bool
87  ComputeBlendShapeWeights(VtFloatArray* weights,
88  UsdTimeCode time=UsdTimeCode::Default()) const = 0;
89 
90  virtual bool
91  GetBlendShapeWeightTimeSamples(const GfInterval& interval,
92  std::vector<double>* times) const = 0;
93 
94  virtual bool
95  GetBlendShapeWeightAttributes(std::vector<UsdAttribute>* attrs) const = 0;
96 
97  virtual bool
98  BlendShapeWeightsMightBeTimeVarying() const = 0;
99 
100  const VtTokenArray& GetJointOrder() const { return _jointOrder; }
101 
102  const VtTokenArray& GetBlendShapeOrder() const { return _blendShapeOrder; }
103 
104 protected:
105  VtTokenArray _jointOrder, _blendShapeOrder;
106 };
107 
108 
109 PXR_NAMESPACE_CLOSE_SCOPE
110 
111 #endif // USDSKEL_ANIMQUERY_IMPL
static UsdSkel_AnimQueryImplRefPtr New(const UsdPrim &prim)
Create an anim query for prim, if the prim is a valid type.
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
Definition: attribute.h:176
Enable a concrete base class for use with TfRefPtr.
Definition: refBase.h:72
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:85
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:131
A basic mathematical interval class.
Definition: interval.h:50
Internal implementation of anim animation query.
Definition: animQueryImpl.h:55
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for &#39;default&#39;.
Definition: timeCode.h:113
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:75