24 #ifndef PXR_USD_USD_PRIM_RANGE_H
25 #define PXR_USD_USD_PRIM_RANGE_H
142 Usd_PrimDataConstPtr,
144 hboost::forward_traversal_tag,
152 : iterator_adaptor_(e._range->_end)
153 , _range(e._range) {}
166 return _range == other._range &&
167 base() == other.base() &&
168 _proxyPrimPath == other._proxyPrimPath &&
169 _depth == other._depth &&
170 _pruneChildrenFlag == other._pruneChildrenFlag &&
171 _isPost == other._isPost;
176 return _range == other._range && base() == _range->_end;
181 return !(*
this == other);
186 return !(*
this == other);
197 : iterator_adaptor_(prim)
199 , _proxyPrimPath(proxyPrimPath)
204 inline reference dereference()
const {
205 return UsdPrim(base(), _proxyPrimPath);
210 unsigned int _depth = 0;
214 bool _pruneChildrenFlag =
false;
217 bool _isPost =
false;
226 , _postOrder(false) {}
258 result._postOrder =
true;
275 result._postOrder =
true;
306 Stage(
const UsdStagePtr &stage,
311 return iterator(
this, _begin, _initProxyPrimPath, _initDepth);
315 return iterator(
this, _begin, _initProxyPrimPath, _initDepth);
341 _begin = newBegin.base();
342 _initProxyPrimPath = newBegin._proxyPrimPath;
343 _initDepth = newBegin._depth;
350 explicit operator bool()
const {
return !
empty(); }
354 return this == &other ||
355 (_begin == other._begin &&
356 _end == other._end &&
357 _initProxyPrimPath == other._initProxyPrimPath &&
358 _predicate == other._predicate &&
359 _postOrder == other._postOrder &&
360 _initDepth == other._initDepth);
365 return !(*
this == other);
374 _Init(begin, end, proxyPrimPath, predicate);
386 _initProxyPrimPath = proxyPrimPath;
387 _predicate = _begin ?
395 if (b.base() != _end &&
396 !Usd_EvalPredicate(_predicate, b.base(), proxyPrimPath)) {
397 b._pruneChildrenFlag =
true;
410 unsigned int _initDepth;
417 #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)
**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.
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.
friend class hboost::iterator_core_access
bool operator==(UsdPrimRange const &other) const
Return true if this range is equivalent to other.
const SdfPath & _ProxyPrimPath() const
GLboolean GLboolean GLboolean b
USD_API void PruneChildren()
static UsdPrimRange AllPrims(const UsdPrim &start)
GLint GLint GLsizei GLsizei GLsizei depth
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.