MaterialX 1.38.10
Loading...
Searching...
No Matches
GraphIterator Class Reference

An iterator object representing the state of an upstream graph traversal. More...

#include <Traversal.h>

Public Member Functions

 GraphIterator (ElementPtr elem)
 
bool operator== (const GraphIterator &rhs) const
 
bool operator!= (const GraphIterator &rhs) const
 
Edge operator* () const
 Dereference this iterator, returning the current edge in the traversal.
 
GraphIteratoroperator++ ()
 Iterate to the next edge in the traversal. More...
 
Elements
ElementPtr getDownstreamElement () const
 Return the downstream element of the current edge.
 
ElementPtr getConnectingElement () const
 Return the connecting element, if any, of the current edge.
 
ElementPtr getUpstreamElement () const
 Return the upstream element of the current edge.
 
size_t getUpstreamIndex () const
 Return the index of the current edge within the range of upstream edges available to the downstream element.
 
Depth
size_t getElementDepth () const
 Return the element depth of the current traversal, where a single edge between two elements represents a depth of one.
 
size_t getNodeDepth () const
 Return the node depth of the current traversal, where a single edge between two nodes represents a depth of one.
 
Pruning
void setPruneSubgraph (bool prune)
 Set the prune subgraph flag, which controls whether the current subgraph is pruned from traversal. More...
 
bool getPruneSubgraph () const
 Return the prune subgraph flag, which controls whether the current subgraph is pruned from traversal.
 

Range Methods

GraphIteratorbegin (size_t holdCount=0)
 Interpret this object as an iteration range, and return its begin iterator.
 
static const GraphIteratorend ()
 Return the sentinel end iterator for this class.
 

Detailed Description

An iterator object representing the state of an upstream graph traversal.

See also
Element::traverseGraph

Member Function Documentation

◆ operator++()

GraphIterator & operator++ ( )

Iterate to the next edge in the traversal.

Exceptions
ExceptionFoundCycleif a cycle is encountered.

◆ setPruneSubgraph()

void setPruneSubgraph ( bool  prune)
inline

Set the prune subgraph flag, which controls whether the current subgraph is pruned from traversal.

Parameters
pruneIf set to true, then the current subgraph will be pruned.

The documentation for this class was generated from the following files: