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