24 #ifndef PXR_USD_PCP_ITERATOR_H
25 #define PXR_USD_PCP_ITERATOR_H
42 class PcpPrimIndex_Graph;
57 explicit _PtrProxy(
const PcpNodeRef& nodeRef) : _nodeRef(nodeRef) {}
80 advanced.advance(index);
81 return advanced.dereference();
85 return -distance_to(other);
112 result.advance(increment);
118 result.advance(-decrement);
137 return !equal(other);
142 return _nodeIdx < other._nodeIdx;
147 return _nodeIdx <= other._nodeIdx;
152 return _nodeIdx > other._nodeIdx;
157 return _nodeIdx >= other._nodeIdx;
163 _graph(graph), _nodeIdx(nodeIdx) {}
165 void increment() { ++_nodeIdx; }
166 void decrement() { --_nodeIdx; }
172 return (_graph == other._graph) & (_nodeIdx == other._nodeIdx);
179 PcpPrimIndex_Graph* _graph =
nullptr;
209 explicit _PtrProxy(
const SdfSite& site) : _site(site) {}
241 advanced.advance(index);
242 return advanced.dereference();
246 return -distance_to(other);
273 result.advance(increment);
279 result.advance(-decrement);
298 return !equal(other);
303 return _pos < other._pos;
308 return _pos <= other._pos;
313 return _pos > other._pos;
318 return _pos >= other._pos;
356 return (--tmp).GetNode();
362 return (--tmp)._GetSiteRef();
402 advanced.advance(index);
403 return advanced.dereference();
407 return -distance_to(other);
434 result.advance(increment);
440 result.advance(-decrement);
459 return !equal(other);
464 return _pos < other._pos;
469 return _pos <= other._pos;
474 return _pos > other._pos;
479 return _pos >= other._pos;
507 :
public std::reverse_iterator<PcpPropertyIterator>
517 return (--tmp).GetNode();
523 return (--tmp).IsLocal();
530 #define PCP_DEFINE_RANGE(Range, Iterator, ReverseIterator) \
531 typedef std::pair<Iterator, Iterator> Range; \
533 inline Iterator begin(Range &range) { return range.first; } \
534 inline Iterator begin(const Range &range) { return range.first; } \
535 inline Iterator end(Range &range) { return range.second; } \
536 inline Iterator end(const Range &range) { return range.second; } \
539 struct Tf_IteratorInterface<Range, false> { \
540 typedef Iterator IteratorType; \
541 static IteratorType Begin(Range &c) { return c.first; } \
542 static IteratorType End(Range &c) { return c.second; } \
546 struct Tf_IteratorInterface<const Range, false> { \
547 typedef Iterator IteratorType; \
548 static IteratorType Begin(Range const &c) { return c.first; } \
549 static IteratorType End(Range const &c) { return c.second; } \
553 struct Tf_IteratorInterface<Range, true> { \
554 typedef ReverseIterator IteratorType; \
555 static IteratorType Begin(Range &c) \
556 { return IteratorType(c.second); } \
557 static IteratorType End(Range &c) \
558 { return IteratorType(c.first); } \
562 struct Tf_IteratorInterface<const Range, true> { \
563 typedef ReverseIterator IteratorType; \
564 static IteratorType Begin(Range const &c) \
565 { return IteratorType(c.second); } \
566 static IteratorType End(Range const &c) \
567 { return IteratorType(c.first); } \
571 struct Tf_ShouldIterateOverCopy<Range> : std::true_type {}; \
574 struct Tf_ShouldIterateOverCopy<const Range> : std::true_type {}
611 #endif // PXR_USD_PCP_ITERATOR_H
bool operator<(const PcpPrimIterator &other) const
bool operator>=(const PcpNodeIterator &other) const
difference_type operator-(const PcpPrimIterator &other) const
PcpNodeIterator operator++(int)
PcpNodeIterator()=default
Constructs an invalid iterator.
PcpNodeIterator operator-(const difference_type decrement) const
PcpPrimIterator & operator-=(const difference_type decrement)
PcpPropertyReverseIterator(const PcpPropertyIterator &iter)
reference operator*() const
PcpPropertyIterator & operator+=(const difference_type increment)
PCP_API PcpPropertyIterator()
Constructs an invalid iterator.
PcpNodeRef GetNode() const
bool operator!=(const PcpPropertyIterator &other) const
PcpPropertyIterator operator-(const difference_type decrement) const
PcpNodeIterator & operator++()
bool operator<(const PcpNodeIterator &other) const
PcpPrimIterator & operator++()
PcpPropertyIterator & operator--()
bool operator!=(const PcpNodeIterator &other) const
PcpNodeIterator & operator--()
PCP_API PcpNodeRef GetNode() const
Returns the PcpNode from which the current prim originated.
pointer operator->() const
bool operator==(const PcpPropertyIterator &other) const
IMATH_HOSTDEVICE constexpr bool equal(T1 a, T2 b, T3 t) IMATH_NOEXCEPT
PcpNodeIterator operator--(int)
bool operator<=(const PcpPropertyIterator &other) const
**But if you need a result
bool operator!=(const PcpPrimIterator &other) const
bool operator<=(const PcpNodeIterator &other) const
difference_type operator-(const PcpNodeIterator &other) const
PcpPrimIterator & operator+=(const difference_type increment)
PcpNodeRef GetNode() const
PcpPropertyReverseIterator()
PcpPrimIterator operator++(int)
const SdfPropertySpecHandle value_type
reference operator*() const
bool operator<=(const PcpPrimIterator &other) const
bool operator==(const PcpNodeIterator &other) const
std::random_access_iterator_tag iterator_category
PcpNodeIterator operator+(const difference_type increment) const
#define TF_DEV_AXIOM(cond)
const SdfPropertySpecHandle & reference
PcpPropertyReverseIterator ReverseIteratorType
std::ptrdiff_t difference_type
reference operator[](const difference_type index) const
PcpPrimIterator operator-(const difference_type decrement) const
bool operator==(const PcpPrimIterator &other) const
PcpPropertyIterator & operator-=(const difference_type decrement)
#define PCP_DEFINE_RANGE(Range, Iterator, ReverseIterator)
PcpNodeIterator & operator-=(const difference_type decrement)
bool operator<(const PcpPropertyIterator &other) const
std::ptrdiff_t difference_type
PcpPrimReverseIterator(const PcpPrimIterator &iter)
reference operator[](const difference_type index) const
PcpPrimReverseIterator ReverseIteratorType
PcpPrimIterator & operator--()
constexpr size_t PCP_INVALID_INDEX
difference_type operator-(const PcpPropertyIterator &other) const
PcpNodeReverseIterator ReverseIteratorType
PcpPropertyIterator operator++(int)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
bool operator>(const PcpNodeIterator &other) const
PcpPropertyRange RangeType
pointer operator->() const
bool operator>(const PcpPrimIterator &other) const
Pcp_SdSiteRef _GetSiteRef() const
#define PXR_NAMESPACE_CLOSE_SCOPE
PcpNodeIterator & operator+=(const difference_type increment)
bool operator>(const PcpPropertyIterator &other) const
PCP_API bool IsLocal() const
std::random_access_iterator_tag iterator_category
Pcp_CompressedSdSite GetCompressedSdSite(size_t layerIndex) const
reference operator[](const difference_type index) const
pointer operator->() const
reference operator*() const
std::ptrdiff_t difference_type
PcpNodeReverseIterator(const PcpNodeIterator &iter)
PCP_API PcpPrimIterator()
Constructs an invalid iterator.
PCP_API PcpNodeRef GetNode() const
Returns the PcpNode from which the current property originated.
PcpPropertyIterator operator+(const difference_type increment) const
const SdfPropertySpecHandle * pointer
PcpPrimIterator operator--(int)
std::random_access_iterator_tag iterator_category
PcpPropertyIterator operator--(int)
bool operator>=(const PcpPropertyIterator &other) const
PcpPropertyIterator & operator++()
PCP_API Pcp_SdSiteRef _GetSiteRef() const
PcpPrimIterator operator+(const difference_type increment) const
bool operator>=(const PcpPrimIterator &other) const