24 #ifndef PXR_USD_USD_PRIM_RANGE_H
25 #define PXR_USD_USD_PRIM_RANGE_H
147 explicit _PtrProxy(
const UsdPrim& prim) : _prim(prim) {}
161 : _underlyingIterator(e._range->_end)
162 , _range(e._range) {}
189 return _range == other._range &&
190 _underlyingIterator == other._underlyingIterator &&
191 _proxyPrimPath == other._proxyPrimPath &&
192 _depth == other._depth &&
193 _pruneChildrenFlag == other._pruneChildrenFlag &&
194 _isPost == other._isPost;
199 return _range == other._range &&
200 _underlyingIterator == _range->_end;
205 return !(*
this == other);
210 return !(*
this == other);
220 : _underlyingIterator(prim)
222 , _proxyPrimPath(proxyPrimPath)
228 return UsdPrim(_underlyingIterator, _proxyPrimPath);
231 _UnderlyingIterator _underlyingIterator =
nullptr;
234 unsigned int _depth = 0;
238 bool _pruneChildrenFlag =
false;
241 bool _isPost =
false;
250 , _postOrder(false) {}
282 result._postOrder =
true;
299 result._postOrder =
true;
330 Stage(
const UsdStagePtr &stage,
335 return iterator(
this, _begin, _initProxyPrimPath, _initDepth);
339 return iterator(
this, _begin, _initProxyPrimPath, _initDepth);
365 _begin = newBegin._underlyingIterator;
366 _initProxyPrimPath = newBegin._proxyPrimPath;
367 _initDepth = newBegin._depth;
374 explicit operator bool()
const {
return !
empty(); }
378 return this == &other ||
379 (_begin == other._begin &&
380 _end == other._end &&
381 _initProxyPrimPath == other._initProxyPrimPath &&
382 _predicate == other._predicate &&
383 _postOrder == other._postOrder &&
384 _initDepth == other._initDepth);
389 return !(*
this == other);
398 _Init(begin, end, proxyPrimPath, predicate);
410 _initProxyPrimPath = proxyPrimPath;
411 _predicate = _begin ?
419 if (b._underlyingIterator != _end &&
420 !Usd_EvalPredicate(_predicate, b._underlyingIterator,
422 b._pruneChildrenFlag =
true;
435 unsigned int _initDepth;
442 #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.