7 #ifndef PXR_USD_USD_PRIM_DATA_H
8 #define PXR_USD_USD_PRIM_DATA_H
86 return *_primTypeInfo;
194 return !_nextSiblingOrParent.
BitsAs<
bool>() ?
195 _nextSiblingOrParent.
Get() :
nullptr;
202 return _nextSiblingOrParent.
BitsAs<
bool>() ?
203 _nextSiblingOrParent.
Get() :
nullptr;
257 void _ComposeAndCacheFlags(
275 _nextSiblingOrParent.
Set(sibling,
false);
279 _nextSiblingOrParent.
Set(parent,
true);
286 _primIndex =
nullptr;
294 void _SetMayHaveOpinionsInClips(
bool hasClips) {
311 mutable std::atomic<int64_t> _refCount;
316 prim->_refCount.fetch_add(1, std::memory_order_relaxed);
319 if (prim->_refCount.fetch_sub(1, std::memory_order_release) == 1)
365 return _underlyingIterator == other._underlyingIterator;
369 return _underlyingIterator != other._underlyingIterator;
377 : _underlyingIterator(i) {}
383 _UnderylingIterator _underlyingIterator =
nullptr;
387 Usd_PrimData::_ChildrenBegin()
const
393 Usd_PrimData::_ChildrenEnd()
const
427 return _underlyingIterator == other._underlyingIterator;
431 return _underlyingIterator != other._underlyingIterator;
440 : _underlyingIterator(i) {}
448 _UnderlyingIterator _underlyingIterator =
nullptr;
452 Usd_PrimData::_SubtreeBegin()
const
459 Usd_PrimData::_SubtreeEnd()
const
468 template <
class PrimDataPtr>
472 return !proxyPrimPath.
IsEmpty();
482 template <
class PrimDataPtr>
502 template <
class PrimDataPtr>
508 if (!proxyPrimPath.
IsEmpty()) {
511 if (p && p->IsPrototype()) {
512 p = p->GetPrimDataAtPathOrInPrototype(proxyPrimPath);
513 if (TF_VERIFY(p,
"No prim at <%s>", proxyPrimPath.
GetText()) &&
514 p->GetPath() == proxyPrimPath) {
532 template <
class PrimDataPtr>
542 PrimDataPtr next = p->GetNextSibling();
543 while (next && next != end &&
544 !Usd_EvalPredicate(pred, next, isInstanceProxy)) {
546 next = p->GetNextSibling();
548 p = next ? next : p->GetParentLink();
550 if (!proxyPrimPath.
IsEmpty()) {
554 else if (p == next) {
560 if (p && p->IsPrototype()) {
561 p = p->GetPrimDataAtPathOrInPrototype(proxyPrimPath);
562 if (TF_VERIFY(p,
"No prim at <%s>", proxyPrimPath.
GetText()) &&
563 p->GetPath() == proxyPrimPath) {
575 template <
class PrimDataPtr>
581 PrimDataPtr(
nullptr), pred);
589 template <
class PrimDataPtr>
598 if (src->IsInstance()) {
599 src = src->GetPrototype();
600 isInstanceProxy =
true;
603 if (PrimDataPtr child = src->GetFirstChild()) {
604 if (isInstanceProxy) {
605 proxyPrimPath = proxyPrimPath.
IsEmpty() ?
606 p->GetPath().AppendChild(child->GetName()) :
612 if (Usd_EvalPredicate(pred, p, isInstanceProxy) ||
621 template <
class PrimDataPtr>
631 #endif // PXR_USD_USD_PRIM_DATA_H
USD_API bool IsSubComponent() const
SDF_API const char * GetText() const
Usd_PrimDataSiblingIterator operator++(int)
void Usd_MoveToParent(PrimDataPtr &p, SdfPath &proxyPrimPath)
USD_API Usd_PrimDataConstPtr GetParent() const
Return this prim's parent prim. Return nullptr if this is a root prim.
bool IsPseudoRoot() const
Returns true if this prim is the pseudoroot.
USD_API const class PcpPrimIndex & GetPrimIndex() const
Usd_PrimFlagsPredicate Usd_CreatePredicateForTraversal(const PrimDataPtr &p, const SdfPath &proxyPrimPath, Usd_PrimFlagsPredicate pred)
Usd_PrimDataPtr GetFirstChild() const
Return this prim's parent prim. Return nullptr if this is a root prim.
std::forward_iterator_tag iterator_category
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_PTRS(UsdStage)
#define PXR_NAMESPACE_OPEN_SCOPE
Usd_PrimDataPtr GetParentLink() const
Return this prim's parent prim. Return nullptr if this is a root prim.
GLsizei const GLchar *const * path
USD_API SdfSpecifier GetSpecifier() const
Return this prim's composed specifier.
bool IsEmpty() const noexcept
Returns true if this is the empty path (SdfPath::EmptyPath()).
std::forward_iterator_tag iterator_category
bool operator!=(const Usd_PrimDataSiblingIterator &other) const
bool operator==(const Usd_PrimDataSiblingIterator &other) const
**But if you need a result
Usd_PrimFlagsPredicate & TraverseInstanceProxies(bool traverse)
const UsdPrimDefinition & GetPrimDefinition() const
constexpr T * Get() const noexcept
Retrieve the pointer.
const SdfPath & GetPath() const
bool IsInPrototype() const
bool operator==(const Usd_PrimDataSubtreeIterator &other) const
bool IsPrototype() const
Return true if this prim is a shared prototype prim, false otherwise.
bool MayHaveOpinionsInClips() const
Usd_PrimDataSiblingIterator()=default
USD_API const class PcpPrimIndex & GetSourcePrimIndex() const
USD_API Usd_PrimDataConstPtr GetPrimDataAtPathOrInPrototype(const SdfPath &path) const
Return this prim's parent prim. Return nullptr if this is a root prim.
UsdStage * GetStage() const
Usd_PrimDataPtr GetNextPrim() const
Return this prim's parent prim. Return nullptr if this is a root prim.
SDF_API SdfPath AppendChild(TfToken const &childName) const
friend void TfDelegatedCountIncrement(const Usd_PrimData *prim) noexcept
Return this prim's parent prim. Return nullptr if this is a root prim.
bool Usd_IsInstanceProxy(const PrimDataPtr &p, const SdfPath &proxyPrimPath)
friend std::string Usd_DescribePrimData(const Usd_PrimData *p, SdfPath const &proxyPrimPath)
Return this prim's parent prim. Return nullptr if this is a root prim.
bool IncludeInstanceProxiesInTraversal() const
bool HasClassSpecifier() const
Return true if this prim has the specifier SdfSpecifierClass.
const UsdPrimDefinition & GetPrimDefinition() const
Returns the prim definition for this prim.
constexpr Integral BitsAs() const noexcept
Retrieve the stored bits as the integral type Integral.
std::vector< TfToken > TfTokenVector
Convenience types.
bool HasDefiningSpecifier() const
Usd_PrimDataSubtreeIterator operator++(int)
reference operator*() const
std::ptrdiff_t difference_type
SDF_API const TfToken & GetNameToken() const
bool Usd_MoveToChild(PrimDataPtr &p, SdfPath &proxyPrimPath, PrimDataPtr end, const Usd_PrimFlagsPredicate &pred)
bool operator!=(const Usd_PrimDataSubtreeIterator &other) const
std::ptrdiff_t difference_type
bool IsAbstract() const
Return true if this prim or any of its ancestors is a class.
friend void TfDelegatedCountDecrement(const Usd_PrimData *prim) noexcept
Return this prim's parent prim. Return nullptr if this is a root prim.
USD_API friend void Usd_ThrowExpiredPrimAccessError(Usd_PrimData const *p)
Return this prim's parent prim. Return nullptr if this is a root prim.
void Set(T *ptr) noexcept
Set the pointer value to ptr.
Usd_PrimDataSiblingIterator & operator++()
friend bool Usd_IsDead(Usd_PrimData const *p)
Return this prim's parent prim. Return nullptr if this is a root prim.
bool HasPayload() const
Return true if this prim has one or more payload composition arcs.
const TfToken & GetTypeName() const
Returns the concrete prim type name.
reference operator*() const
const TfToken & GetName() const
bool Usd_MoveToNextSiblingOrParent(PrimDataPtr &p, SdfPath &proxyPrimPath, PrimDataPtr end, const Usd_PrimFlagsPredicate &pred)
SDF_API bool IsRootPrimPath() const
#define PXR_NAMESPACE_CLOSE_SCOPE
SDF_API SdfPath GetParentPath() const
USD_API Usd_PrimDataConstPtr GetPrototype() const
const TfToken & GetTypeName() const
std::bitset< Usd_PrimNumFlags > Usd_PrimFlagBits
Usd_PrimDataPtr GetNextSibling() const
Return this prim's parent prim. Return nullptr if this is a root prim.
Usd_PrimDataSubtreeIterator()=default
Usd_PrimDataSubtreeIterator & operator++()
const UsdPrimTypeInfo & GetPrimTypeInfo() const
Returns the full type info for the prim.