|
AGX Dynamics
2.37.2.0
|
Base class for all power line traversers. More...
#include <PowerLineTraverser.h>
Public Types | |
| enum | TraversalMode { CONNECTIONS_ONLY, CONNECTIONS_AND_COMPOUNDS } |
| Enumeration that controls how the traversal should behave when encountering compound GraphNodes. More... | |
Public Member Functions | |
| AbstractPowerLineTraverser () | |
| bool | traverse (GraphNodeTypes typesToVisit, UnitPtr source, TraversalMode mode) |
| Start a traversal that visits the types specified by the given GraphNodeTypes. More... | |
| bool | traverse (GraphNodeTypes typesToVisit, PowerLine *source, TraversalMode mode) |
| Start a traversal from all the units in the powerline that visits the types specified by the given GraphNodeTypes. More... | |
| bool | traverseConnectors (UnitPtr source, TraversalMode mode) |
| Start a traversal that only visits Connectors. More... | |
| bool | traverseDimensions (UnitPtr source, TraversalMode mode) |
| Start a traversal that only visits PhysicalDimensions. More... | |
| bool | traverseUnits (UnitPtr source, TraversalMode mode) |
| Start a traversal that only visits Units. More... | |
Protected Member Functions | |
| virtual | ~AbstractPowerLineTraverser () |
| virtual bool | shouldQueueChildren (UnitPtr unit) |
| virtual bool | shouldQueueChildren (DimensionPtr dimension) |
| virtual bool | shouldQueueChildren (ConnectorPtr connector) |
| virtual bool | visit (UnitPtr unit)=0 |
| Called when a Unit is encountered in the graph, if the GraphNodeTypes variable includes UNITS. More... | |
| virtual bool | visit (DimensionPtr dimension)=0 |
| Called when a PhysicalDimension is encountered in the graph, if the GraphNodeTypes variable includes DIMENSIONS. More... | |
| virtual bool | visit (ConnectorPtr connector)=0 |
| Called when a Connector is encountered in the graph, if the GraphNodeTypes variable includes CONNECTORS. More... | |
Base class for all power line traversers.
Templated on the node type pointers so that both const and non-const versions are possible.
For each node in the graph the traverser may call the pure virtual 'visit' method on itself, depending on the current value of the GraphNodeTypes variable.
Subclasses can control the extent of the traversal by overriding 'shouldQueueChildren'. By returning 'false' when passed a Unit the traversal will not descend into the PhysicalDimensions of that Unit, and by returning 'false' when passed a PhysicalDimension or a Connector the traversal will not follow any Connections from that PhysicalDimension or Connector. The default implementations always returns true.
There are two types of relationships in a power line graph: connections and compounds. Connections link PhysicalDimensions and Connectors, while compounds nest Connectors and Units inside each other. The traverser can work in two modes. It either only follows the PhysicalDimension/Connector connections or both the connections and the nesting.
Definition at line 69 of file PowerLineTraverser.h.
| enum agxPowerLine::AbstractPowerLineTraverser::TraversalMode |
Enumeration that controls how the traversal should behave when encountering compound GraphNodes.
| Enumerator | |
|---|---|
| CONNECTIONS_ONLY | |
| CONNECTIONS_AND_COMPOUNDS | |
Definition at line 76 of file PowerLineTraverser.h.
| agxPowerLine::AbstractPowerLineTraverser< UnitPtr, DimensionPtr, ConnectorPtr, SubGraphPtr >::AbstractPowerLineTraverser | ( | ) |
Definition at line 34 of file PowerLineTraverserImpl.h.
|
inlineprotectedvirtual |
Definition at line 111 of file PowerLineTraverser.h.
|
protectedvirtual |
Reimplemented in agxPowerLine::PowerLineCallbackTraverser.
Definition at line 379 of file PowerLineTraverserImpl.h.
|
protectedvirtual |
Reimplemented in agxPowerLine::PowerLineCallbackTraverser.
Definition at line 385 of file PowerLineTraverserImpl.h.
|
protectedvirtual |
Reimplemented in agxPowerLine::PowerLineCallbackTraverser.
Definition at line 391 of file PowerLineTraverserImpl.h.
| bool agxPowerLine::AbstractPowerLineTraverser< UnitPtr, DimensionPtr, ConnectorPtr, SubGraphPtr >::traverse | ( | GraphNodeTypes | typesToVisit, |
| UnitPtr | source, | ||
| TraversalMode | mode | ||
| ) |
Start a traversal that visits the types specified by the given GraphNodeTypes.
Definition at line 291 of file PowerLineTraverserImpl.h.
| bool agxPowerLine::AbstractPowerLineTraverser< UnitPtr, DimensionPtr, ConnectorPtr, SubGraphPtr >::traverse | ( | GraphNodeTypes | typesToVisit, |
| PowerLine * | source, | ||
| TraversalMode | mode | ||
| ) |
Start a traversal from all the units in the powerline that visits the types specified by the given GraphNodeTypes.
Definition at line 334 of file PowerLineTraverserImpl.h.
| bool agxPowerLine::AbstractPowerLineTraverser< UnitPtr, DimensionPtr, ConnectorPtr, SubGraphPtr >::traverseConnectors | ( | UnitPtr | source, |
| TraversalMode | mode | ||
| ) |
Start a traversal that only visits Connectors.
Definition at line 63 of file PowerLineTraverserImpl.h.
| bool agxPowerLine::AbstractPowerLineTraverser< UnitPtr, DimensionPtr, ConnectorPtr, SubGraphPtr >::traverseDimensions | ( | UnitPtr | source, |
| TraversalMode | mode | ||
| ) |
Start a traversal that only visits PhysicalDimensions.
Definition at line 53 of file PowerLineTraverserImpl.h.
| bool agxPowerLine::AbstractPowerLineTraverser< UnitPtr, DimensionPtr, ConnectorPtr, SubGraphPtr >::traverseUnits | ( | UnitPtr | source, |
| TraversalMode | mode | ||
| ) |
Start a traversal that only visits Units.
Definition at line 43 of file PowerLineTraverserImpl.h.
|
protectedpure virtual |
Called when a Unit is encountered in the graph, if the GraphNodeTypes variable includes UNITS.
Implemented in agxPowerLine::PowerLineCallbackTraverser, and agxPowerLine::PowerLineCollector.
|
protectedpure virtual |
Called when a PhysicalDimension is encountered in the graph, if the GraphNodeTypes variable includes DIMENSIONS.
Implemented in agxPowerLine::PowerLineCallbackTraverser, and agxPowerLine::PowerLineCollector.
|
protectedpure virtual |
Called when a Connector is encountered in the graph, if the GraphNodeTypes variable includes CONNECTORS.
Implemented in agxPowerLine::PowerLineCallbackTraverser, and agxPowerLine::PowerLineCollector.