Package | com.yworks.yfiles.layout.router.polyline |
Class | public class ChannelBasedPathRouting |
Inheritance | ChannelBasedPathRouting YObject Object |
Initialize (initialize()) must be called before the edges can be route (route()) d.
The basic approach of this router is to bundle edge segment (com.yworks.yfiles.layout.router.polyline.SegmentInfo) s into so-called com.yworks.yfiles.layout.router.polyline.Channel s and route each channel individually.
See also
Property | Defined By | ||
---|---|---|---|
configuration : PathSearchConfiguration [read-only]
Returns the configuration this class was initialized with. | ChannelBasedPathRouting |
Method | Defined By | ||
---|---|---|---|
ChannelBasedPathRouting(init:Boolean = true) | ChannelBasedPathRouting | ||
cleanup():void
Resets all channel information and the reference to the PathSearchConfiguration. | ChannelBasedPathRouting | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | ChannelBasedPathRouting | ||
hashCode():int | YObject | ||
initialize(configuration:PathSearchConfiguration):void
Initializes this class for routing paths that were found with the given configuration. | ChannelBasedPathRouting | ||
[static] | ChannelBasedPathRouting | ||
Routes the given edges. | ChannelBasedPathRouting |
Method | Defined By | ||
---|---|---|---|
adjustSegmentLocations(channel:Channel):void
Tries to adjust the location set for a segment info in the channel to consider the preferred alignment of the segment. | ChannelBasedPathRouting | ||
calculateSegmentLocations(channel:Channel):void
Calculates locations for the segment infos in the given channel. | ChannelBasedPathRouting | ||
createSegmentInfoComparator(channels:YList, pathSearchResult:PathSearchResult, configuration:PathSearchConfiguration):Comparator
Creates a comparator for com.yworks.yfiles.layout.router.polyline.SegmentInfo s that can be used to sort the segment infos in a com.yworks.yfiles.layout.router.polyline.Channel from left to right (for vertical segments) or top to bottom (for horizontal segments), respectively. | ChannelBasedPathRouting | ||
initChannelBasedPathRouting():void | ChannelBasedPathRouting | ||
optimizeSegmentOrder(channel:Channel):void
Optimizes the order of the segments in the given channel. | ChannelBasedPathRouting | ||
Sorts the given list of SegmentInfos using the given comparator. | ChannelBasedPathRouting |
configuration | property |
configuration:PathSearchConfiguration
[read-only] Returns the configuration this class was initialized with.
protected function get configuration():PathSearchConfiguration
See also
ChannelBasedPathRouting | () | Constructor |
public function ChannelBasedPathRouting(init:Boolean = true)
init:Boolean (default = true )
|
adjustSegmentLocations | () | method |
protected function adjustSegmentLocations(channel:Channel):void
Tries to adjust the location set for a segment info in the channel to consider the preferred alignment of the segment. This method is called after the segments have been distributed in the channel but before the final locations of the segments are assigned to the segment infos.
Parameters
channel:Channel — The channel of the segment infos to consider the alignments for.
|
See also
calculateSegmentLocations | () | method |
protected function calculateSegmentLocations(channel:Channel):void
Calculates locations for the segment infos in the given channel.
Precondition: The locations of the segments are stored (com.yworks.yfiles.layout.router.polyline.Channel.setCurrentLocation()) in the Channel. They should respect minimal edge to edge distances and grid constraints and must lie in the respective location range (com.yworks.yfiles.layout.router.polyline.SegmentInfo.locationRange) s.
Parameters
channel:Channel — The channel to calculate locations for the segment infos for.
|
See also
cleanup | () | method |
public function cleanup():void
Resets all channel information and the reference to the PathSearchConfiguration.
So, ChannelBasedPathRouting
is ready to calculate paths for a new layout.
createSegmentInfoComparator | () | method |
protected function createSegmentInfoComparator(channels:YList, pathSearchResult:PathSearchResult, configuration:PathSearchConfiguration):Comparator
Creates a comparator for com.yworks.yfiles.layout.router.polyline.SegmentInfo s that can be used to sort the segment infos in a com.yworks.yfiles.layout.router.polyline.Channel from left to right (for vertical segments) or top to bottom (for horizontal segments), respectively.
Parameters
channels:YList — The channels this comparator will be used for later.
| |
pathSearchResult:PathSearchResult — The path search result containing the com.yworks.yfiles.layout.router.polyline.EdgeInfo s with the SegmentInfo s this comparator that will be used for later.
| |
configuration:PathSearchConfiguration — The configuration used during this path search.
|
Comparator — A comparator for SegmentInfo s that can be used to sort the segment infos in a Channel .
|
See also
getClass | () | method |
override public function getClass():Class
ReturnsClass |
initChannelBasedPathRouting | () | method |
protected final function initChannelBasedPathRouting():void
initialize | () | method |
public function initialize(configuration:PathSearchConfiguration):void
Initializes this class for routing paths that were found with the given configuration
.
Must be called before route().
Parameters
configuration:PathSearchConfiguration — The configuration to use for the following path routings.
|
See also
newChannelBasedPathRouting | () | method |
public static function newChannelBasedPathRouting():ChannelBasedPathRouting
ReturnsChannelBasedPathRouting |
optimizeSegmentOrder | () | method |
protected function optimizeSegmentOrder(channel:Channel):void
Optimizes the order of the segments in the given channel.
After the segments in the channel have been sorted using the segment info comparator (createSegmentInfoComparator()), segment infos having a common com.yworks.yfiles.layout.router.polyline.SegmentGroup are replaced by their common representative segment info (com.yworks.yfiles.layout.router.polyline.SegmentGroup.commonSegmentInfo).
This method further improves the order of the resulting segment info list is to make sure that the subsequent location calculation (calculateSegmentLocations()) is able to respect the segment infos location ranges (com.yworks.yfiles.layout.router.polyline.SegmentInfo.locationRange) and if possible the minimal edge to edge distances and possible grid constraints for the segments.Parameters
channel:Channel — The channel to optimize the segment info order for.
|
See also
route | () | method |
public function route(edges:EdgeList, pathSearchResult:PathSearchResult):void
Routes the given edges. initialize() must be called first.
As a first step, the com.yworks.yfiles.layout.router.polyline.SegmentInfo s of all edge paths are distributed to com.yworks.yfiles.layout.router.polyline.Channel s. After that, the segments in each of these Channel
s are sorted and locations are assigned respecting the segment's location ranges by calling the subsequent methods:
Finally the control points for the paths are calculated.
Parameters
edges:EdgeList — The edges to route.
| |
pathSearchResult:PathSearchResult — The path search results containing the Path objects for the edges.
|
Error — If the locations are not inside of the segment's location range.
|
See also
sortSegmentInfos | () | method |
protected function sortSegmentInfos(segmentInfos:List, segmentInfoComparator:Comparator):void
Sorts the given list of SegmentInfos using the given comparator.
Parameters
segmentInfos:List — The list of SegmentInfos to sort.
| |
segmentInfoComparator:Comparator — The comparator to use for the sorting.
|