7 #ifndef PXR_USD_USD_PRIM_RANGE_H
8 #define PXR_USD_USD_PRIM_RANGE_H
130 explicit _PtrProxy(
const UsdPrim& prim) : _prim(prim) {}
144 : _underlyingIterator(e._range->_end)
145 , _range(e._range) {}
172 return _range == other._range &&
173 _underlyingIterator == other._underlyingIterator &&
174 _proxyPrimPath == other._proxyPrimPath &&
175 _depth == other._depth &&
176 _pruneChildrenFlag == other._pruneChildrenFlag &&
177 _isPost == other._isPost;
182 return _range == other._range &&
183 _underlyingIterator == _range->_end;
188 return !(*
this == other);
193 return !(*
this == other);
203 : _underlyingIterator(prim)
205 , _proxyPrimPath(proxyPrimPath)
211 return UsdPrim(_underlyingIterator, _proxyPrimPath);
214 _UnderlyingIterator _underlyingIterator =
nullptr;
217 unsigned int _depth = 0;
221 bool _pruneChildrenFlag =
false;
224 bool _isPost =
false;
233 , _postOrder(false) {}
265 result._postOrder =
true;
282 result._postOrder =
true;
313 Stage(
const UsdStagePtr &stage,
318 return iterator(
this, _begin, _initProxyPrimPath, _initDepth);
322 return iterator(
this, _begin, _initProxyPrimPath, _initDepth);
348 _begin = newBegin._underlyingIterator;
349 _initProxyPrimPath = newBegin._proxyPrimPath;
350 _initDepth = newBegin._depth;
361 return this == &other ||
362 (_begin == other._begin &&
363 _end == other._end &&
364 _initProxyPrimPath == other._initProxyPrimPath &&
365 _predicate == other._predicate &&
366 _postOrder == other._postOrder &&
367 _initDepth == other._initDepth);
372 return !(*
this == other);
381 _Init(begin, end, proxyPrimPath, predicate);
393 _initProxyPrimPath = proxyPrimPath;
394 _predicate = _begin ?
402 if (b._underlyingIterator != _end &&
403 !Usd_EvalPredicate(_predicate, b._underlyingIterator,
405 b._pruneChildrenFlag =
true;
418 unsigned int _initDepth;
425 #endif // PXR_USD_USD_PRIM_RANGE_H
static USD_API UsdPrimRange Stage(const UsdStagePtr &stage, const Usd_PrimFlagsPredicate &predicate=UsdPrimDefaultPredicate)
Usd_PrimFlagsPredicate Usd_CreatePredicateForTraversal(const PrimDataPtr &p, const SdfPath &proxyPrimPath, Usd_PrimFlagsPredicate pred)
static UsdPrimRange PreAndPostVisit(const UsdPrim &start)
reference operator*() const
**But if you need a result
Y * get_pointer(TfWeakPtrFacade< X, Y > const &p)
iterator(EndSentinel e)
Allow implicit conversion from EndSentinel.
Usd_PrimDataPtr GetNextPrim() const
Return this prim's parent prim. Return nullptr if this is a root prim.
std::forward_iterator_tag iterator_category
bool operator!=(iterator const &other) const
Return true if this iterator is not equivalent to other.
bool operator!=(UsdPrimRange const &other) const
Return true if this range is not equivalent to other.
bool operator==(UsdPrimRange const &other) const
Return true if this range is equivalent to other.
const SdfPath & _ProxyPrimPath() const
pointer operator->() const
GLboolean GLboolean GLboolean b
USD_API void PruneChildren()
std::ptrdiff_t difference_type
const Usd_PrimData * Usd_PrimDataConstPtr
static UsdPrimRange AllPrims(const UsdPrim &start)
GLint GLint GLsizei GLsizei GLsizei depth
__hostdev__ uint64_t last(uint32_t i) const
const Usd_PrimDataHandle & _Prim() const
USD_API const Usd_PrimFlagsConjunction UsdPrimDefaultPredicate
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
USD_API const Usd_PrimFlagsPredicate UsdPrimAllPrimsPredicate
UsdPrimRange(const UsdPrim &start, const Usd_PrimFlagsPredicate &predicate)
UsdPrim front() const
Return the first element of this range. The range must not be empty().
#define PXR_NAMESPACE_CLOSE_SCOPE
UsdPrimRange(const UsdPrim &start)
bool operator==(EndSentinel const &other) const
Return true if this iterator is equivalent to other.
const_iterator cbegin() const
Return a const_iterator to the start of this range.
iterator end() const
Return the past-the-end iterator for this range.
bool operator==(iterator const &other) const
Return true if this iterator is equivalent to other.
bool operator!=(EndSentinel const &other) const
Return true if this iterator is not equivalent to other.
void set_begin(iterator const &newBegin)
const_iterator cend() const
Return the past-the-end const_iterator for this range.
iterator begin() const
Return an iterator to the start of this range.
static UsdPrimRange PreAndPostVisit(const UsdPrim &start, const Usd_PrimFlagsPredicate &predicate)
static UsdPrimRange AllPrimsPreAndPostVisit(const UsdPrim &start)
bool empty() const
Return true if this range contains no prims, false otherwise.