7 #ifndef PXR_EXEC_VDF_SUBRANGE_VIEW_H
8 #define PXR_EXEC_VDF_SUBRANGE_VIEW_H
104 _view->_inputName == rhs._view->_inputName &&
105 _connectionIndex == rhs._connectionIndex &&
106 _rangeIndex == rhs._rangeIndex;
118 const_iterator &operator++();
143 void _AdvanceSubrange(
unsigned int rangeIndex);
146 bool _SubrangeFromConnectionIndex(
151 bool _SubrangeFromRangeIndex(
161 void _AdvanceToEnd();
167 int _connectionIndex;
170 unsigned int _rangeIndex;
181 return const_iterator(*
this, 0);
187 const_iterator
end()
const {
188 return const_iterator(*
this, -1);
207 int connectionIndex) :
209 _connectionIndex(connectionIndex),
211 _subrange(_SubrangeAtEnd())
214 if (connectionIndex >= 0) {
224 _AdvanceSubrange(_rangeIndex + 1);
231 unsigned int rangeIndex)
234 const TfToken &inputName = _view->_inputName;
235 const VdfInput *input = _view->_GetNode(context).GetInput(inputName);
238 _rangeIndex = rangeIndex;
241 if (input && _connectionIndex >= 0) {
247 for (; _connectionIndex < numConnections; ++_connectionIndex) {
255 if (mask.
IsAllZeros() || !_view->_IsRequiredInput(context, c)) {
261 const VdfVector *
v = _view->_GetInputValue(context, c, mask);
263 if (_SubrangeFromConnectionIndex(context, inputName)) {
272 if (!accessor.IsBoxed()) {
273 if (_SubrangeFromConnectionIndex(context, inputName)) {
282 if (_SubrangeFromRangeIndex(context, inputName, accessor)) {
302 _SubrangeFromConnectionIndex(
306 using Iterator =
typename Subrange::iterator;
311 if (_rangeIndex > 0) {
317 _subrange = Subrange(
318 Iterator(context, inputName, _connectionIndex, 0),
319 Iterator(context, inputName, _connectionIndex + 1, 0));
327 _SubrangeFromRangeIndex(
332 using Iterator =
typename Subrange::iterator;
351 _subrange = Subrange(
352 Iterator(context, inputName, _connectionIndex, boxedRange.
begin),
353 Iterator(context, inputName, _connectionIndex, boxedRange.
end));
362 using Iterator =
typename Subrange::iterator;
365 Iterator(*_view->_context, _view->_inputName, -1, 0),
366 Iterator(*_view->_context, _view->_inputName, -1, 0));
373 _connectionIndex = -1;
375 _subrange = _SubrangeAtEnd();
reference operator*() const
#define PXR_NAMESPACE_OPEN_SCOPE
unsigned int GetNumRanges() const
A VdfMask is placed on connections to specify the data flowing through them.
Vdf_VectorSubrangeAccessor< TYPE > GetSubrangeAccessor() const
const_iterator begin() const
bool operator==(const const_iterator &rhs) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Range GetRange(unsigned int i) const
bool operator!=(const const_iterator &rhs) const
std::forward_iterator_tag iterator_category
VdfSubrangeView(const VdfContext &context, const TfToken &inputName)
#define PXR_NAMESPACE_CLOSE_SCOPE
pointer operator->() const
const_iterator end() const
const VdfMask & GetMask() const
Returns the mask for this connection.