|
AGX Dynamics 2.42.3.1
|
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, PowerLine *source, TraversalMode mode) |
| Start a traversal from all the units in the powerline that visits the types specified by the given GraphNodeTypes. | |
| bool | traverse (GraphNodeTypes typesToVisit, UnitPtr source, TraversalMode mode) |
| Start a traversal that visits the types specified by the given GraphNodeTypes. | |
| bool | traverseConnectors (UnitPtr source, TraversalMode mode) |
| Start a traversal that only visits Connectors. | |
| bool | traverseDimensions (UnitPtr source, TraversalMode mode) |
| Start a traversal that only visits PhysicalDimensions. | |
| bool | traverseUnits (UnitPtr source, TraversalMode mode) |
| Start a traversal that only visits Units. | |
Protected Member Functions | |
| virtual | ~AbstractPowerLineTraverser () |
| virtual bool | shouldQueueChildren (ConnectorPtr connector) |
| virtual bool | shouldQueueChildren (DimensionPtr dimension) |
| virtual bool | shouldQueueChildren (UnitPtr unit) |
| virtual bool | visit (ConnectorPtr connector)=0 |
| Called when a Connector is encountered in the graph, if the GraphNodeTypes variable includes CONNECTORS. | |
| virtual bool | visit (DimensionPtr dimension)=0 |
| Called when a PhysicalDimension is encountered in the graph, if the GraphNodeTypes variable includes DIMENSIONS. | |
| virtual bool | visit (UnitPtr unit)=0 |
| Called when a Unit is encountered in the graph, if the GraphNodeTypes variable includes UNITS. | |
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 67 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 74 of file PowerLineTraverser.h.
| agxPowerLine::AbstractPowerLineTraverser< UnitPtr, DimensionPtr, ConnectorPtr, SubGraphPtr >::AbstractPowerLineTraverser |
Definition at line 32 of file PowerLineTraverserImpl.h.
|
inlineprotectedvirtual |
Definition at line 109 of file PowerLineTraverser.h.
|
protectedvirtual |
Definition at line 389 of file PowerLineTraverserImpl.h.
|
protectedvirtual |
Definition at line 383 of file PowerLineTraverserImpl.h.
|
protectedvirtual |
Reimplemented in agxPowerLine::PowerLineCallbackTraverser.
Definition at line 377 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 332 of file PowerLineTraverserImpl.h.
References agxVerify, and agxPowerLine::PowerLine::getUnits().
| 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 289 of file PowerLineTraverserImpl.h.
References agxVerify.
| bool agxPowerLine::AbstractPowerLineTraverser< UnitPtr, DimensionPtr, ConnectorPtr, SubGraphPtr >::traverseConnectors | ( | UnitPtr | source, |
| TraversalMode | mode | ||
| ) |
Start a traversal that only visits Connectors.
Definition at line 61 of file PowerLineTraverserImpl.h.
References agxPowerLine::CONNECTORS.
| bool agxPowerLine::AbstractPowerLineTraverser< UnitPtr, DimensionPtr, ConnectorPtr, SubGraphPtr >::traverseDimensions | ( | UnitPtr | source, |
| TraversalMode | mode | ||
| ) |
Start a traversal that only visits PhysicalDimensions.
Definition at line 51 of file PowerLineTraverserImpl.h.
References agxPowerLine::DIMENSIONS.
| bool agxPowerLine::AbstractPowerLineTraverser< UnitPtr, DimensionPtr, ConnectorPtr, SubGraphPtr >::traverseUnits | ( | UnitPtr | source, |
| TraversalMode | mode | ||
| ) |
Start a traversal that only visits Units.
Definition at line 41 of file PowerLineTraverserImpl.h.
References agxPowerLine::UNITS.
|
protectedpure virtual |
Called when a Connector is encountered in the graph, if the GraphNodeTypes variable includes CONNECTORS.
Implemented in agxPowerLine::PowerLineCollector, and agxPowerLine::PowerLineCallbackTraverser.
|
protectedpure virtual |
Called when a PhysicalDimension is encountered in the graph, if the GraphNodeTypes variable includes DIMENSIONS.
Implemented in agxPowerLine::PowerLineCollector, and agxPowerLine::PowerLineCallbackTraverser.
|
protectedpure virtual |
Called when a Unit is encountered in the graph, if the GraphNodeTypes variable includes UNITS.
Implemented in agxPowerLine::PowerLineCollector, and agxPowerLine::PowerLineCallbackTraverser.