Instance Method

isConnectionLockedFromNode:toNode:

Returns a Boolean value indicating whether the specified nodes are protected from disconnection due to the addition of obstacles.

Declaration

- (BOOL)isConnectionLockedFromNode:(NodeType)startNode toNode:(NodeType)endNode;

Parameters

startNode

A node in the graph.

endNode

Another node in the graph to which the node startNode is directly connected.

Return Value

YES if the connection between the specified nodes has been locked with the lockConnectionFromNode:toNode: method; otherwise, NO.

Discussion

By default, adding obstacles with the addObstacles: method disconnects pairs of nodes if the direct path between them intersects an obstacle. This behavior ensures that using the findPathBetweenNodes:toNode: method does not result in a path through the graph that crosses obstacles. With certain nodes, this behavior might not be desirable—use the lockConnectionFromNode:toNode: method to protect a connection between nodes from being automatically destroyed and the unlockConnectionFromNode:toNode: method to remove such protection.

See Also

Locking Node Connections

- lockConnectionFromNode:toNode:

Prevents the specified nodes from being disconnected due to the addition of obstacles.

- unlockConnectionFromNode:toNode:

Allows the specified nodes to be disconnected due to the addition of obstacles.