C

ChannelRoutingTool

This routing algorithm computes orthogonal routes to the edges within a channel.
Inheritance Hierarchy

Remarks

Each edge that should be routed has to be specified by a unique key (e.g., the edge itself) as well as two points that represent the two endpoints of this edge, see addSegment. The orthogonal route of each edge consists of three segments. More precisely, for an edge with source point (sx,sy), target point (tx,ty) and VERTICAL channel orientation, the algorithm calculates the x-coordinate of the vertical middle segment (called mx) that can be obtained with method getChannelCoordinate after routing the edges. Hence, the actual route consists of points (sx,sy), (mx,sy), (mx,ty) and (tx,ty). Analogously, if the channel orientation is HORIZONTAL, the route consists of the points (sx,sy), (sx,my), (tx,my) and (tx,ty).

Besides the orientation, each channel is restricted by a smallest and largest assignable coordinate. If, for example, the orientation is VERTICAL, the calculated x-coordinate of the middle segment lies between these two values. Both values can be changed by means of method setChannel.

All edges assigned to the same coordinate are said to lie in the same sub-channel. In general, the routing algorithm tries to assign coordinates such the number of sub-channels as well as the number of edge crossings is small.

Default Values of Properties

NameDefault
epsilon0.5
ignoreEpsilonChanneltrue

Members

No filters for this type

Constructors

Creates a new instance of ChannelRoutingTool.

Parameters

min: number
The smallest assignable coordinate within the channel.
max: number
The largest assignable coordinate within the channel.
orientation?: ChannelOrientation
The orientation of the channel. If omitted, the default value is HORIZONTAL.

Properties

Gets or sets the current epsilon value.
If option ignoreEpsilonChannel is enabled, middle segments with length smaller than this value are ignored.
final

Property Value

the current epsilon value

Default Value

The default value is: 0.5

See Also

API
ignoreEpsilonChannel
Gets or sets whether or not middle segments with lengths smaller than epsilon are ignored.
final

Property Value

true if middle segments with length smaller than epsilon are ignored, false otherwise

Default Value

The default value is: true

See Also

API
epsilon
Gets the number of sub-channels (i.e., different coordinates assigned to the edge objects) within this channel.
A return value of 0 indicates that there are no sub-channels present.
readonlyfinal

Property Value

the number of sub-channels within this channel

Methods

Adds an edge object that belongs to an edge group to the set of elements that should be routed within the channel.
Edges having the same group id will be placed in the same sub-channel (i.e., the same coordinate).
final

Parameters

key: any
the unique id of the edge
groupId: any
the id of the edge group
p1: Point
the first endpoint of the edge
p2: Point
the second endpoint of the edge
Adds an edge object with endpoints p1 and p2 to the set of elements that should be routed within the channel.
final

Parameters

key: any
the unique id of the edge
p1: Point
the first endpoint of the edge
p2: Point
the second endpoint of the edge
Returns whether the given id has already been registered as a group id.
final

Parameters

groupId: any
the group id used during adding

Return Value

boolean
true if the key has already been registered, false otherwise
Returns whether the given key has already been registered.
final

Parameters

key: any
the key used during adding

Return Value

boolean
true if the key has already been registered, false otherwise
Returns the calculated channel coordinate for an added edge object.
final

Parameters

key: any
the key used during adding the edge object

Return Value

number
the channel coordinate of the associated edge object

See Also

API
addSegment
Returns the sub-channel rank for the specified edge group within the channel.
final

Parameters

groupId: any
the group id used during adding an edge object

Return Value

number
the sub-channel rank of the edge group

See Also

API
subchannelCount, addGroupSegment
Returns the sub-channel rank of the specified edge object within the channel.
The coordinate of an edge object increases with increasing sub-channel rank. Edge objects assigned to the same sub-channel rank are placed on the same coordinate.
final

Parameters

key: any
the key used during adding the edge object

Return Value

number
the sub-channel rank of the given edge object

See Also

API
subchannelCount, addSegment
Routes all added edge objects within the specified channel.
The resulting sub-channels can then be queried using method getSubchannelRank, while the exact coordinates can be queried with method getChannelCoordinate.
final

See Also

API
addSegment, addGroupSegment
Specifies the channel bounds and orientation.
Calling this method removes all previously added elements.
final

Parameters

min: number
The smallest assignable coordinate within the channel.
max: number
The largest assignable coordinate within the channel.
orientation?: ChannelOrientation
The orientation of the channel. If omitted, the default value is HORIZONTAL.

See Also

API
addSegment