24 #ifndef PXR_USD_PCP_ITERATOR_H
25 #define PXR_USD_PCP_ITERATOR_H
37 #include <hboost/iterator/iterator_facade.hpp>
38 #include <hboost/iterator/reverse_iterator.hpp>
44 class PcpPrimIndex_Graph;
53 :
public hboost::iterator_facade<
56 hboost::random_access_traversal_tag,
73 _graph(graph), _nodeIdx(nodeIdx) {}
77 void increment() { ++_nodeIdx; }
78 void decrement() { --_nodeIdx; }
79 void advance(difference_type
n) { _nodeIdx +=
n; }
81 return (difference_type)(other._nodeIdx) - _nodeIdx;
84 return (_graph == other._graph) & (_nodeIdx == other._nodeIdx);
86 reference dereference()
const {
91 PcpPrimIndex_Graph* _graph;
101 :
public hboost::reverse_iterator<PcpNodeIterator>
115 :
public hboost::iterator_facade<
118 hboost::random_access_traversal_tag,
148 void advance(difference_type
n);
150 difference_type distance_to(
const PcpPrimIterator& other)
const;
152 bool equal(
const PcpPrimIterator& other)
const;
154 reference dereference()
const;
167 :
public hboost::reverse_iterator<PcpPrimIterator>
177 return (--tmp).GetNode();
183 return (--tmp)._GetSiteRef();
193 :
public hboost::iterator_facade<
195 const SdfPropertySpecHandle,
196 hboost::random_access_traversal_tag
225 void advance(difference_type
n);
227 difference_type distance_to(
const PcpPropertyIterator& other)
const;
229 bool equal(
const PcpPropertyIterator& other)
const;
231 reference dereference()
const;
244 :
public std::reverse_iterator<PcpPropertyIterator>
254 return (--tmp).GetNode();
260 return (--tmp).IsLocal();
267 #define PCP_DEFINE_RANGE(Range, Iterator, ReverseIterator) \
268 typedef std::pair<Iterator, Iterator> Range; \
270 inline Iterator begin(Range &range) { return range.first; } \
271 inline Iterator begin(const Range &range) { return range.first; } \
272 inline Iterator end(Range &range) { return range.second; } \
273 inline Iterator end(const Range &range) { return range.second; } \
276 struct Tf_IteratorInterface<Range, false> { \
277 typedef Iterator IteratorType; \
278 static IteratorType Begin(Range &c) { return c.first; } \
279 static IteratorType End(Range &c) { return c.second; } \
283 struct Tf_IteratorInterface<const Range, false> { \
284 typedef Iterator IteratorType; \
285 static IteratorType Begin(Range const &c) { return c.first; } \
286 static IteratorType End(Range const &c) { return c.second; } \
290 struct Tf_IteratorInterface<Range, true> { \
291 typedef ReverseIterator IteratorType; \
292 static IteratorType Begin(Range &c) \
293 { return IteratorType(c.second); } \
294 static IteratorType End(Range &c) \
295 { return IteratorType(c.first); } \
299 struct Tf_IteratorInterface<const Range, true> { \
300 typedef ReverseIterator IteratorType; \
301 static IteratorType Begin(Range const &c) \
302 { return IteratorType(c.second); } \
303 static IteratorType End(Range const &c) \
304 { return IteratorType(c.first); } \
308 struct Tf_ShouldIterateOverCopy<Range> : std::true_type {}; \
311 struct Tf_ShouldIterateOverCopy<const Range> : std::true_type {}
348 #endif // PXR_USD_PCP_ITERATOR_H
PcpPropertyReverseIterator(const PcpPropertyIterator &iter)
PCP_API PcpPropertyIterator()
Constructs an invalid iterator.
PcpNodeRef GetNode() const
friend class hboost::iterator_core_access
PCP_API PcpNodeRef GetNode() const
Returns the PcpNode from which the current prim originated.
IMATH_HOSTDEVICE constexpr bool equal(T1 a, T2 b, T3 t) IMATH_NOEXCEPT
PcpNodeRef GetNode() const
PcpPropertyReverseIterator()
PcpNodeIterator()
Constructs an invalid iterator.
PcpPropertyReverseIterator ReverseIteratorType
friend class hboost::iterator_core_access
#define PCP_DEFINE_RANGE(Range, Iterator, ReverseIterator)
PcpPrimReverseIterator(const PcpPrimIterator &iter)
PcpPrimReverseIterator ReverseIteratorType
constexpr size_t PCP_INVALID_INDEX
PcpNodeReverseIterator ReverseIteratorType
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
PcpPropertyRange RangeType
Pcp_SdSiteRef _GetSiteRef() const
friend class hboost::iterator_core_access
#define PXR_NAMESPACE_CLOSE_SCOPE
PCP_API bool IsLocal() const
Pcp_CompressedSdSite GetCompressedSdSite(size_t layerIndex) const
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.
PCP_API Pcp_SdSiteRef _GetSiteRef() const