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
137 if (_source == UsdResolveInfoSourceTimeSamples ||
138 _source == UsdResolveInfoSourceSpline ||
140 return true;
141 }
142 if (HasNextWeakerInfo()) {
144 }
145 return _source == UsdResolveInfoSourceDefault &&
146 _defaultCanComposeOverWeakerTimeVaryingSources;
147 }
148
157 bool HasNextWeakerInfo() const {
158 return static_cast<bool>(_nextWeaker);
159 }
160
167 return _nextWeaker.get();
168 }
169
170private:
171
172 // Helper to chain an additional weaker info onto this one.
173 USD_API
174 UsdResolveInfo *_AddNextWeakerInfo();
175
186 PcpLayerStackPtr _layerStack;
187
194 SdfLayerHandle _layer;
195
198 PcpNodeRef _node;
199
204 SdfLayerOffset _layerToStageOffset;
205
217 SdfPath _primPathInLayerStack;
218
221 std::optional<TsSpline> _spline;
222
225 std::shared_ptr<UsdResolveInfo> _nextWeaker;
226
228 UsdResolveInfoSource _source;
229
233 bool _valueIsBlocked;
234
237 bool _defaultCanCompose;
238
242 bool _defaultCanComposeOverWeakerTimeVaryingSources;
243
244 enum class _ValueClipsSourceFormat
245 {
246 TimeSamples,
247 Spline
248 };
251 _ValueClipsSourceFormat _clipsSourceFormat;
252
253 friend class UsdAttribute;
254 friend class UsdAttributeQuery;
255 friend class UsdStage;
256 friend class UsdStage_ResolveInfoAccess;
257 friend class Usd_Resolver;
258};
259
260
261PXR_NAMESPACE_CLOSE_SCOPE
262
263#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