HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
primData.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_PRIM_DATA_H
8 #define PXR_USD_USD_PRIM_DATA_H
9 
10 /// \file usd/primData.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usd/api.h"
14 #include "pxr/usd/usd/common.h"
15 #include "pxr/usd/usd/primFlags.h"
18 #include "pxr/usd/sdf/types.h"
19 
22 #include "pxr/base/tf/token.h"
23 
24 #include "pxr/usd/sdf/path.h"
25 
26 #include <atomic>
27 #include <cstdint>
28 #include <vector>
29 
31 
33 
34 // Private class that stores cached prim information and defines the prim tree
35 // on a UsdStage.
36 //
37 // Usd_PrimData objects are arranged in a tree structure, represented as a
38 // binary tree. See the _firstChild and _nextSiblingOrParent members.
39 //
40 // UsdStage builds and manages the tree structure of Usd_PrimData objects. The
41 // Usd_PrimData objects lifetimes are governed by an internal reference count
42 // (see _refCount). Two objects mutate this reference count: UsdStage owns
43 // references to all the Usd_PrimData objects that represent the scene graph,
44 // and UsdObject (and by inheritance its subclasses) owns a reference to its
45 // prim data object via Usd_PrimDataHandle.
46 //
47 // Usd_PrimData has a 'dead' flag (see _IsDead and _MarkDead). UsdStage sets
48 // this when a prim data object is removed from the scene graph.
49 // Usd_PrimDataHandle, which is a smart pointer to Usd_PrimData consults this
50 // dead flag to determine prim validity, and to issue informative crash messages
51 // on invalid use. See USD_CHECK_ALL_PRIM_ACCESSES.
52 //
54 {
55 public:
56 
57  // --------------------------------------------------------------------- //
58  /// \name Prim Data & Behavior
59  // --------------------------------------------------------------------- //
60 
61  /// Returns the composed path for the prim.
62  ///
63  /// This path is absolute with respect to the current stage and may require
64  /// translation when used in the context of individual layers of which the
65  /// current stage is composed.
66  /// This always returns a cached result.
67  const SdfPath &GetPath() const { return _path; }
68 
69  const TfToken &GetName() const { return GetPath().GetNameToken(); }
70 
71  UsdStage *GetStage() const { return _stage; }
72 
73  /// Returns the prim definition for this prim.
75  return _primTypeInfo->GetPrimDefinition();
76  }
77 
78  /// Returns the composed type name for the prim.
79  /// Note that this value is cached and is efficient to query.
80  const TfToken& GetTypeName() const {
81  return _primTypeInfo->GetTypeName();
82  }
83 
84  /// Returns the full type info for the prim.
86  return *_primTypeInfo;
87  }
88 
89  /// Returns true if this prim is the pseudoroot.
90  bool IsPseudoRoot() const { return _flags[Usd_PrimPseudoRootFlag]; }
91 
92  /// Return true if this prim is active, meaning neither it nor any of its
93  /// ancestors have active=false. Return false otherwise.
94  bool IsActive() const { return _flags[Usd_PrimActiveFlag]; }
95 
96  /// Return true if this prim is active, and \em either it is loadable and
97  /// it is loaded, \em or its nearest loadable ancestor is loaded, \em or it
98  /// has no loadable ancestor; false otherwise.
99  bool IsLoaded() const { return _flags[Usd_PrimLoadedFlag]; }
100 
101  /// Return true if this prim is a model based on its kind metadata, false
102  /// otherwise.
103  bool IsModel() const { return _flags[Usd_PrimModelFlag]; }
104 
105  /// Return true if this prim is a model group based on its kind metadata,
106  /// false otherwise. If this prim is a group, it is also necessarily a
107  /// model.
108  bool IsGroup() const { return _flags[Usd_PrimGroupFlag]; }
109 
110  bool IsComponent() const { return _flags[Usd_PrimComponentFlag]; }
111 
112  USD_API
113  bool IsSubComponent() const;
114 
115  /// Return true if this prim or any of its ancestors is a class.
116  bool IsAbstract() const { return _flags[Usd_PrimAbstractFlag]; }
117 
118  /// Return true if this prim and all its ancestors have defining specifiers,
119  /// false otherwise. \sa SdfIsDefiningSpecifier.
120  bool IsDefined() const { return _flags[Usd_PrimDefinedFlag]; }
121 
122  /// Return true if this prim has the specifier SdfSpecifierDef or
123  /// SdfSpecifierClass.
124  bool HasDefiningSpecifier() const {
125  return _flags[Usd_PrimHasDefiningSpecifierFlag];
126  }
127 
128  /// Return true if this prim has the specifier SdfSpecifierClass.
129  bool HasClassSpecifier() const {
130  return _flags[Usd_PrimHasClassSpecifierFlag];
131  }
132 
133  /// Return true if this prim has one or more payload composition arcs.
134  bool HasPayload() const { return _flags[Usd_PrimHasPayloadFlag]; }
135 
136  /// Return true if attributes on this prim may have opinions in clips,
137  /// false otherwise. If true, the relevant clips will be examined for
138  /// opinions during value resolution.
139  bool MayHaveOpinionsInClips() const { return _flags[Usd_PrimClipsFlag]; }
140 
141  /// Return this prim's composed specifier.
142  USD_API
143  SdfSpecifier GetSpecifier() const;
144 
145  // --------------------------------------------------------------------- //
146  /// \name Parent & Stage
147  // --------------------------------------------------------------------- //
148 
149  /// Return this prim's parent prim. Return nullptr if this is a root prim.
150  USD_API
152 
153  // --------------------------------------------------------------------- //
154  // PrimIndex access.
155  // --------------------------------------------------------------------- //
156 
157  /// Return a const reference to the PcpPrimIndex for this prim.
158  ///
159  /// The prim's PcpPrimIndex can be used to examine the scene description
160  /// sites that contribute to the prim's property and metadata values in
161  /// minute detail.
162  ///
163  /// For prototype prims this prim index will be empty; this ensures
164  /// that these prims do not provide any attribute or metadata
165  /// values.
166  ///
167  /// For all other prims in prototypes, this is the prim index for the
168  /// instance that was chosen to serve as the prototype for all other
169  /// instances.
170  ///
171  /// In either of the above two cases, this prim index will not have the
172  /// same path as the prim's path.
173  USD_API
174  const class PcpPrimIndex &GetPrimIndex() const;
175 
176  /// Return a const reference to the source PcpPrimIndex for this prim.
177  ///
178  /// For all prims in prototypes (which includes the prototype prim itself),
179  /// this is the prim index for the instance that was chosen to serve
180  /// as the prototype for all other instances. This prim index will not
181  /// have the same path as the prim's path.
182  USD_API
183  const class PcpPrimIndex &GetSourcePrimIndex() const;
184 
185  // --------------------------------------------------------------------- //
186  // Tree Structure
187  // --------------------------------------------------------------------- //
188 
189  // Return this prim data's first child if it has one, nullptr otherwise.
190  Usd_PrimDataPtr GetFirstChild() const { return _firstChild; }
191 
192  // Return this prim data's next sibling if it has one, nullptr otherwise.
194  return !_nextSiblingOrParent.BitsAs<bool>() ?
195  _nextSiblingOrParent.Get() : nullptr;
196  }
197 
198  // Return this prim data's parent if this prim data is the last in its chain
199  // of siblings. That is, if the _nextSiblingOrParent field is pointing to
200  // its parent. Return nullptr otherwise.
202  return _nextSiblingOrParent.BitsAs<bool>() ?
203  _nextSiblingOrParent.Get() : nullptr;
204  }
205 
206  // Return the next prim data "to the right" of this one. That is, this
207  // prim's next sibling if it has one, otherwise the next sibling of the
208  // nearest ancestor with a sibling, if there is one, otherwise null.
209  inline Usd_PrimDataPtr GetNextPrim() const {
210  if (Usd_PrimDataPtr sibling = GetNextSibling())
211  return sibling;
212  for (Usd_PrimDataPtr p = GetParentLink(); p; p = p->GetParentLink()) {
213  if (Usd_PrimDataPtr sibling = p->GetNextSibling())
214  return sibling;
215  }
216  return nullptr;
217  }
218 
219  // Return the prim data at \p path. If \p path indicates a prim
220  // beneath an instance, return the prim data for the corresponding
221  // prim in the instance's prototype.
224 
225  // --------------------------------------------------------------------- //
226  // Instancing
227  // --------------------------------------------------------------------- //
228 
229  /// Return true if this prim is an instance of a shared prototype prim,
230  /// false otherwise.
231  bool IsInstance() const { return _flags[Usd_PrimInstanceFlag]; }
232 
233  /// Return true if this prim is a shared prototype prim, false otherwise.
234  bool IsPrototype() const {
235  return IsInPrototype() && GetPath().IsRootPrimPath();
236  }
237 
238  /// Return true if this prim is a child of a shared prototype prim,
239  /// false otherwise.
240  bool IsInPrototype() const { return _flags[Usd_PrimPrototypeFlag]; }
241 
242  /// If this prim is an instance, return the prim data for the corresponding
243  /// prototype. Otherwise, return nullptr.
245 
246  // --------------------------------------------------------------------- //
247  // Private Members
248  // --------------------------------------------------------------------- //
249 private:
250 
251  USD_API
252  Usd_PrimData(UsdStage *stage, const SdfPath& path);
253  USD_API
254  ~Usd_PrimData();
255 
256  // Compute and store type info and cached flags.
257  void _ComposeAndCacheFlags(
258  Usd_PrimDataConstPtr parent, bool isPrototypePrim);
259 
260  // Flags direct access for Usd_PrimFlagsPredicate.
262  const Usd_PrimFlagBits &_GetFlags() const {
263  return _flags;
264  }
265 
266  // --------------------------------------------------------------------- //
267  // Prim Children
268  // --------------------------------------------------------------------- //
269 
270  // Composes the prim children, reporting errors as they occur. Returns true
271  // on success false on failure.
272  bool _ComposePrimChildNames(TfTokenVector* nameOrder);
273 
274  void _SetSiblingLink(Usd_PrimDataPtr sibling) {
275  _nextSiblingOrParent.Set(sibling, /* isParent */ false);
276  }
277 
278  void _SetParentLink(Usd_PrimDataPtr parent) {
279  _nextSiblingOrParent.Set(parent, /* isParent */ true);
280  }
281 
282  // Set the dead bit on this prim data object.
283  void _MarkDead() {
284  _flags[Usd_PrimDeadFlag] = true;
285  _stage = nullptr;
286  _primIndex = nullptr;
287  }
288 
289  // Return true if this prim's dead flag is set, false otherwise.
290  bool _IsDead() const { return _flags[Usd_PrimDeadFlag]; }
291 
292  // Set whether this prim or any of its namespace ancestors had clips
293  // specified.
294  void _SetMayHaveOpinionsInClips(bool hasClips) {
295  _flags[Usd_PrimClipsFlag] = hasClips;
296  }
297 
298  inline class Usd_PrimDataSiblingIterator _ChildrenBegin() const;
299  inline class Usd_PrimDataSiblingIterator _ChildrenEnd() const;
300 
301  inline class Usd_PrimDataSubtreeIterator _SubtreeBegin() const;
302  inline class Usd_PrimDataSubtreeIterator _SubtreeEnd() const;
303 
304  // Data members.
305  UsdStage *_stage;
306  const PcpPrimIndex *_primIndex;
307  SdfPath _path;
308  const UsdPrimTypeInfo *_primTypeInfo;
309  Usd_PrimData *_firstChild;
310  TfPointerAndBits<Usd_PrimData> _nextSiblingOrParent;
311  mutable std::atomic<int64_t> _refCount;
312  Usd_PrimFlagBits _flags;
313 
314  // intrusive_ptr core primitives implementation.
315  friend void TfDelegatedCountIncrement(const Usd_PrimData *prim) noexcept {
316  prim->_refCount.fetch_add(1, std::memory_order_relaxed);
317  }
318  friend void TfDelegatedCountDecrement(const Usd_PrimData *prim) noexcept {
319  if (prim->_refCount.fetch_sub(1, std::memory_order_release) == 1)
320  delete prim;
321  }
322 
323  USD_API
324  friend void Usd_ThrowExpiredPrimAccessError(Usd_PrimData const *p);
325  friend std::string
326  Usd_DescribePrimData(const Usd_PrimData *p, SdfPath const &proxyPrimPath);
327 
328  friend inline bool Usd_IsDead(Usd_PrimData const *p) {
329  return p->_IsDead();
330  }
331 
332  friend class UsdPrim;
333  friend class UsdStage;
334 };
335 
336 // Sibling iterator class.
339 public:
340  using iterator_category = std::forward_iterator_tag;
343  using pointer = void;
344  using difference_type = std::ptrdiff_t;
345 
346  // Default ctor.
347  Usd_PrimDataSiblingIterator() = default;
348 
349  reference operator*() const { return _underlyingIterator; }
350 
351  // pre-increment
353  increment();
354  return *this;
355  }
356 
357  // post-increment
360  increment();
361  return result;
362  }
363 
364  bool operator==(const Usd_PrimDataSiblingIterator& other) const {
365  return _underlyingIterator == other._underlyingIterator;
366  }
367 
368  bool operator!=(const Usd_PrimDataSiblingIterator& other) const {
369  return _underlyingIterator != other._underlyingIterator;
370  }
371 
372 private:
373  friend class Usd_PrimData;
374 
375  // Constructor used by Prim.
377  : _underlyingIterator(i) {}
378 
379  void increment() {
380  _underlyingIterator = _underlyingIterator->GetNextSibling();
381  }
382 
383  _UnderylingIterator _underlyingIterator = nullptr;
384 };
385 
387 Usd_PrimData::_ChildrenBegin() const
388 {
389  return Usd_PrimDataSiblingIterator(_firstChild);
390 }
391 
393 Usd_PrimData::_ChildrenEnd() const
394 {
395  return Usd_PrimDataSiblingIterator(0);
396 }
397 
398 // Tree iterator class.
401 public:
402  using iterator_category = std::forward_iterator_tag;
405  using pointer = void;
406  using difference_type = std::ptrdiff_t;
407 
408  // Default ctor.
409  Usd_PrimDataSubtreeIterator() = default;
410 
411  reference operator*() const { return _underlyingIterator; }
412 
413  // pre-increment
415  increment();
416  return *this;
417  }
418 
419  // post-increment
422  increment();
423  return result;
424  }
425 
426  bool operator==(const Usd_PrimDataSubtreeIterator& other) const {
427  return _underlyingIterator == other._underlyingIterator;
428  }
429 
430  bool operator!=(const Usd_PrimDataSubtreeIterator& other) const {
431  return _underlyingIterator != other._underlyingIterator;
432  }
433 
434 private:
435  friend class Usd_PrimData;
437 
438  // Constructor used by Prim.
440  : _underlyingIterator(i) {}
441 
442  void increment() {
443  _underlyingIterator = _underlyingIterator->GetFirstChild() ?
444  _underlyingIterator->GetFirstChild() :
445  _underlyingIterator->GetNextPrim();
446  }
447 
448  _UnderlyingIterator _underlyingIterator = nullptr;
449 };
450 
452 Usd_PrimData::_SubtreeBegin() const
453 {
455  _firstChild ? _firstChild : GetNextPrim());
456 }
457 
459 Usd_PrimData::_SubtreeEnd() const
460 {
462 }
463 
464 // Helpers for instance proxies.
465 
466 // Return true if the prim with prim data \p p and proxy prim path
467 // \p proxyPrimPath represents an instance proxy.
468 template <class PrimDataPtr>
469 inline bool
470 Usd_IsInstanceProxy(const PrimDataPtr &p, const SdfPath &proxyPrimPath)
471 {
472  return !proxyPrimPath.IsEmpty();
473 }
474 
475 // Helpers for subtree traversals.
476 
477 // Create a predicate based on \p pred for use when traversing the
478 // siblings or descendants of the prim with prim data \p p and proxy
479 // prim path \p proxyPrimPath. This is used by prim traversal functions
480 // like UsdPrim::GetFilteredChildren, UsdPrim::GetFilteredDescendants,
481 // UsdPrim::GetFilteredNextSibling, and UsdPrimRange.
482 template <class PrimDataPtr>
484 Usd_CreatePredicateForTraversal(const PrimDataPtr &p,
485  const SdfPath &proxyPrimPath,
487 {
488  // Don't allow traversals beneath instances unless the client has
489  // explicitly requested it or the starting point is already beneath
490  // an instance (i.e., the starting point is an instance proxy).
491  if (!Usd_IsInstanceProxy(p, proxyPrimPath) &&
493  pred.TraverseInstanceProxies(false);
494  }
495  return pred;
496 }
497 
498 // Move \p p to its parent. If \p proxyPrimPath is not empty, set it to
499 // its parent path. If after this \p p is a prototype prim, move \p p to
500 // the prim indicated by \p proxyPrimPath. If \p p's path is then equal
501 // to \p proxyPrimPath, set \p proxyPrimPath to the empty path.
502 template <class PrimDataPtr>
503 inline void
504 Usd_MoveToParent(PrimDataPtr &p, SdfPath &proxyPrimPath)
505 {
506  p = p->GetParent();
507 
508  if (!proxyPrimPath.IsEmpty()) {
509  proxyPrimPath = proxyPrimPath.GetParentPath();
510 
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) {
515  proxyPrimPath = SdfPath();
516  }
517  }
518  }
519 }
520 
521 // Search for the next sibling that matches \p pred (up to \p end). If such a
522 // sibling exists, move \p p to it and return false. If no such sibling exists
523 // then move \p p to its parent and return true. If \p end is reached while
524 // looking for siblings, move \p p to \p end and return false.
525 //
526 // If \p proxyPrimPath is not empty, update it based on the new value of \p p:
527 // - If \p p was moved to \p end, set \p proxyPrimPath to the empty path.
528 // - If \p p was moved to a sibling, set the prim name for \p proxyPrimPath
529 // to the sibling's name.
530 // - If \p p was moved to a parent, set \p proxyPrimPath and \p p the same
531 // way as Usd_MoveToParent.
532 template <class PrimDataPtr>
533 inline bool
534 Usd_MoveToNextSiblingOrParent(PrimDataPtr &p, SdfPath &proxyPrimPath,
535  PrimDataPtr end,
536  const Usd_PrimFlagsPredicate &pred)
537 {
538  // Either all siblings are instance proxies or none are. We can just
539  // compute this once and reuse it as we scan for the next sibling.
540  const bool isInstanceProxy = Usd_IsInstanceProxy(p, proxyPrimPath);
541 
542  PrimDataPtr next = p->GetNextSibling();
543  while (next && next != end &&
544  !Usd_EvalPredicate(pred, next, isInstanceProxy)) {
545  p = next;
546  next = p->GetNextSibling();
547  }
548  p = next ? next : p->GetParentLink();
549 
550  if (!proxyPrimPath.IsEmpty()) {
551  if (p == end) {
552  proxyPrimPath = SdfPath();
553  }
554  else if (p == next) {
555  proxyPrimPath =
556  proxyPrimPath.GetParentPath().AppendChild(p->GetName());
557  }
558  else {
559  proxyPrimPath = proxyPrimPath.GetParentPath();
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) {
564  proxyPrimPath = SdfPath();
565  }
566  }
567  }
568  }
569 
570  // Return true if we successfully moved to a parent, otherwise false.
571  return !next && p;
572 }
573 
574 // Convenience method for calling the above with \p end = \c nullptr.
575 template <class PrimDataPtr>
576 inline bool
577 Usd_MoveToNextSiblingOrParent(PrimDataPtr &p, SdfPath &proxyPrimPath,
578  const Usd_PrimFlagsPredicate &pred)
579 {
580  return Usd_MoveToNextSiblingOrParent(p, proxyPrimPath,
581  PrimDataPtr(nullptr), pred);
582 }
583 
584 // Search for the first direct child of \p p that matches \p pred (up to
585 // \p end). If the given \p p is an instance, search for direct children
586 // on the corresponding prototype prim. If such a direct child exists,
587 // move \p p to it, and return true. Otherwise leave the iterator
588 // unchanged and return false.
589 template <class PrimDataPtr>
590 inline bool
591 Usd_MoveToChild(PrimDataPtr &p, SdfPath &proxyPrimPath,
592  PrimDataPtr end,
593  const Usd_PrimFlagsPredicate &pred)
594 {
595  bool isInstanceProxy = Usd_IsInstanceProxy(p, proxyPrimPath);
596 
597  PrimDataPtr src = p;
598  if (src->IsInstance()) {
599  src = src->GetPrototype();
600  isInstanceProxy = true;
601  }
602 
603  if (PrimDataPtr child = src->GetFirstChild()) {
604  if (isInstanceProxy) {
605  proxyPrimPath = proxyPrimPath.IsEmpty() ?
606  p->GetPath().AppendChild(child->GetName()) :
607  proxyPrimPath.AppendChild(child->GetName());
608  }
609 
610  p = child;
611 
612  if (Usd_EvalPredicate(pred, p, isInstanceProxy) ||
613  !Usd_MoveToNextSiblingOrParent(p, proxyPrimPath, end, pred)) {
614  return true;
615  }
616  }
617  return false;
618 }
619 
620 // Convenience method for calling the above with \p end = \c nullptr.
621 template <class PrimDataPtr>
622 inline bool
623 Usd_MoveToChild(PrimDataPtr &p, SdfPath &proxyPrimPath,
624  const Usd_PrimFlagsPredicate &pred)
625 {
626  return Usd_MoveToChild(p, proxyPrimPath, PrimDataPtr(nullptr), pred);
627 }
628 
630 
631 #endif // PXR_USD_USD_PRIM_DATA_H
USD_API bool IsSubComponent() const
SDF_API const char * GetText() const
Usd_PrimDataSiblingIterator operator++(int)
Definition: primData.h:358
bool IsDefined() const
Definition: primData.h:120
bool IsModel() const
Definition: primData.h:103
void Usd_MoveToParent(PrimDataPtr &p, SdfPath &proxyPrimPath)
Definition: primData.h:504
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.
Definition: primData.h:90
USD_API const class PcpPrimIndex & GetPrimIndex() const
Usd_PrimFlagsPredicate Usd_CreatePredicateForTraversal(const PrimDataPtr &p, const SdfPath &proxyPrimPath, Usd_PrimFlagsPredicate pred)
Definition: primData.h:484
#define USD_API
Definition: api.h:23
Usd_PrimDataPtr GetFirstChild() const
Return this prim's parent prim. Return nullptr if this is a root prim.
Definition: primData.h:190
std::forward_iterator_tag iterator_category
Definition: primData.h:402
void
Definition: png.h:1083
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_PTRS(UsdStage)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
Usd_PrimDataPtr GetParentLink() const
Return this prim's parent prim. Return nullptr if this is a root prim.
Definition: primData.h:201
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
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()).
Definition: path.h:405
std::forward_iterator_tag iterator_category
Definition: primData.h:340
bool operator!=(const Usd_PrimDataSiblingIterator &other) const
Definition: primData.h:368
bool operator==(const Usd_PrimDataSiblingIterator &other) const
Definition: primData.h:364
**But if you need a result
Definition: thread.h:622
Usd_PrimFlagsPredicate & TraverseInstanceProxies(bool traverse)
Definition: primFlags.h:157
const UsdPrimDefinition & GetPrimDefinition() const
Definition: primTypeInfo.h:65
constexpr T * Get() const noexcept
Retrieve the pointer.
const SdfPath & GetPath() const
Definition: primData.h:67
bool IsInPrototype() const
Definition: primData.h:240
bool operator==(const Usd_PrimDataSubtreeIterator &other) const
Definition: primData.h:426
bool IsGroup() const
Definition: primData.h:108
bool IsPrototype() const
Return true if this prim is a shared prototype prim, false otherwise.
Definition: primData.h:234
bool MayHaveOpinionsInClips() const
Definition: primData.h:139
Definition: token.h:70
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
Definition: primData.h:71
Usd_PrimDataPtr GetNextPrim() const
Return this prim's parent prim. Return nullptr if this is a root prim.
Definition: primData.h:209
bool IsInstance() const
Definition: primData.h:231
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.
Definition: primData.h:315
bool Usd_IsInstanceProxy(const PrimDataPtr &p, const SdfPath &proxyPrimPath)
Definition: primData.h:470
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.
GLuint GLuint end
Definition: glcorearb.h:475
bool IncludeInstanceProxiesInTraversal() const
Definition: primFlags.h:171
bool HasClassSpecifier() const
Return true if this prim has the specifier SdfSpecifierClass.
Definition: primData.h:129
const UsdPrimDefinition & GetPrimDefinition() const
Returns the prim definition for this prim.
Definition: primData.h:74
constexpr Integral BitsAs() const noexcept
Retrieve the stored bits as the integral type Integral.
Definition: prim.h:116
SdfSpecifier
Definition: types.h:103
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
bool HasDefiningSpecifier() const
Definition: primData.h:124
Usd_PrimDataSubtreeIterator operator++(int)
Definition: primData.h:420
reference operator*() const
Definition: primData.h:349
Definition: path.h:280
std::ptrdiff_t difference_type
Definition: primData.h:344
SDF_API const TfToken & GetNameToken() const
bool Usd_MoveToChild(PrimDataPtr &p, SdfPath &proxyPrimPath, PrimDataPtr end, const Usd_PrimFlagsPredicate &pred)
Definition: primData.h:591
bool operator!=(const Usd_PrimDataSubtreeIterator &other) const
Definition: primData.h:430
std::ptrdiff_t difference_type
Definition: primData.h:406
bool IsAbstract() const
Return true if this prim or any of its ancestors is a class.
Definition: primData.h:116
friend void TfDelegatedCountDecrement(const Usd_PrimData *prim) noexcept
Return this prim's parent prim. Return nullptr if this is a root prim.
Definition: primData.h:318
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++()
Definition: primData.h:352
friend bool Usd_IsDead(Usd_PrimData const *p)
Return this prim's parent prim. Return nullptr if this is a root prim.
Definition: primData.h:328
bool HasPayload() const
Return true if this prim has one or more payload composition arcs.
Definition: primData.h:134
const TfToken & GetTypeName() const
Returns the concrete prim type name.
Definition: primTypeInfo.h:34
reference operator*() const
Definition: primData.h:411
const TfToken & GetName() const
Definition: primData.h:69
bool Usd_MoveToNextSiblingOrParent(PrimDataPtr &p, SdfPath &proxyPrimPath, PrimDataPtr end, const Usd_PrimFlagsPredicate &pred)
Definition: primData.h:534
SDF_API bool IsRootPrimPath() const
bool IsComponent() const
Definition: primData.h:110
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
SDF_API SdfPath GetParentPath() const
bool IsLoaded() const
Definition: primData.h:99
USD_API Usd_PrimDataConstPtr GetPrototype() const
const TfToken & GetTypeName() const
Definition: primData.h:80
std::bitset< Usd_PrimNumFlags > Usd_PrimFlagBits
Definition: primFlags.h:95
bool IsActive() const
Definition: primData.h:94
Usd_PrimDataPtr GetNextSibling() const
Return this prim's parent prim. Return nullptr if this is a root prim.
Definition: primData.h:193
Usd_PrimDataSubtreeIterator & operator++()
Definition: primData.h:414
const UsdPrimTypeInfo & GetPrimTypeInfo() const
Returns the full type info for the prim.
Definition: primData.h:85
GLenum src
Definition: glcorearb.h:1793