Loading...
Searching...
No Matches
resolveInfo.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_RESOLVE_INFO_H
8#define PXR_USD_USD_RESOLVE_INFO_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usd/api.h"
14#include "pxr/usd/usd/stage.h"
15#include "pxr/base/ts/spline.h"
17#include "pxr/usd/sdf/path.h"
18#include "pxr/usd/pcp/node.h"
19
21
22#include <limits>
23#include <memory>
24#include <optional>
25
26PXR_NAMESPACE_OPEN_SCOPE
27
29
46
55{
56public:
59 , _valueIsBlocked(false)
60 , _defaultCanCompose(false)
61 , _defaultCanComposeOverWeakerTimeVaryingSources(false)
62 {
63 }
64
81 return _source;
82 }
83
90 return
91 _source == UsdResolveInfoSourceDefault ||
94 _source == UsdResolveInfoSourceSpline ||
95 _valueIsBlocked;
96 }
97
100 bool HasAuthoredValue() const {
101 return
102 _source == UsdResolveInfoSourceDefault ||
106 }
107
111 return _node;
112 }
113
118 bool ValueIsBlocked() const {
119 return _valueIsBlocked;
120 }
121
133 if (_source == UsdResolveInfoSourceTimeSamples ||
134 _source == UsdResolveInfoSourceSpline ||
136 return true;
137 }
138 if (HasNextWeakerInfo()) {
140 }
141 return _source == UsdResolveInfoSourceDefault &&
142 _defaultCanComposeOverWeakerTimeVaryingSources;
143 }
144
153 bool HasNextWeakerInfo() const {
154 return static_cast<bool>(_nextWeaker);
155 }
156
163 return _nextWeaker.get();
164 }
165
166private:
167
168 // Helper to chain an additional weaker info onto this one.
169 USD_API
170 UsdResolveInfo *_AddNextWeakerInfo();
171
182 PcpLayerStackPtr _layerStack;
183
190 SdfLayerHandle _layer;
191
194 PcpNodeRef _node;
195
200 SdfLayerOffset _layerToStageOffset;
201
213 SdfPath _primPathInLayerStack;
214
217 std::optional<TsSpline> _spline;
218
221 std::shared_ptr<UsdResolveInfo> _nextWeaker;
222
224 UsdResolveInfoSource _source;
225
229 bool _valueIsBlocked;
230
233 bool _defaultCanCompose;
234
238 bool _defaultCanComposeOverWeakerTimeVaryingSources;
239
240 friend class UsdAttribute;
241 friend class UsdAttributeQuery;
242 friend class UsdStage;
243 friend class UsdStage_ResolveInfoAccess;
244 friend class Usd_Resolver;
245};
246
247
248PXR_NAMESPACE_CLOSE_SCOPE
249
250#endif // PXR_USD_USD_RESOLVE_INFO_H
Represents a stack of layers that contribute opinions to composition.
Definition layerStack.h:50
PcpNode represents a node in an expression tree for compositing scene description.
Definition node.h:47
Represents a time offset and scale between layers.
Definition layerOffset.h:44
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition attribute.h:183
Object for efficiently making repeated queries for attribute values.
Container for information about the source of an attribute's value, i.e.
Definition resolveInfo.h:55
bool ValueSourceMightBeTimeVarying() const
Return true if the resolve info value source might be time-varying; false otherwise.
bool ValueIsBlocked() const
Return true if this UsdResolveInfo represents an attribute whose value is blocked.
UsdResolveInfoSource GetSource() const
Return some information about the source of the associated attribute's value.
Definition resolveInfo.h:80
PcpNodeRef GetNode() const
Return the node within the containing PcpPrimIndex that provided the resolved value opinion.
bool HasAuthoredValue() const
Return true if this UsdResolveInfo represents an attribute that has an authored value that is not blo...
bool HasAuthoredValueOpinion() const
Return true if this UsdResolveInfo represents an attribute that has an authored value opinion.
Definition resolveInfo.h:89
UsdResolveInfo const * GetNextWeakerInfo() const
If this object was returned by a call to the UsdAttribute::GetResolve() overload that takes a time an...
bool HasNextWeakerInfo() const
If this object was returned by a call to the UsdAttribute::GetResolve() overload that takes a time,...
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
Definition stage.h:135
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition declarePtrs.h:45
UsdResolveInfoSource
Describes the various sources of attribute values.
Definition resolveInfo.h:37
@ UsdResolveInfoSourceTimeSamples
Attribute time samples.
Definition resolveInfo.h:42
@ UsdResolveInfoSourceValueClips
Value clips.
Definition resolveInfo.h:43
@ UsdResolveInfoSourceDefault
Attribute default value.
Definition resolveInfo.h:41
@ UsdResolveInfoSourceSpline
Spline value.
Definition resolveInfo.h:44
@ UsdResolveInfoSourceNone
No value.
Definition resolveInfo.h:38
@ UsdResolveInfoSourceFallback
Built-in fallback value.
Definition resolveInfo.h:40