Northwoods.Go.Layout Assembly > Northwoods.Go.Layout Namespace > GoLayoutLayeredDigraph Class : AdjacentExchangeCrossingReductionBendStraighten Method |
direction == 0 -- use unfixedLayer - 1 and unfixedLayer + 1 direction > 0 -- use unfixedLayer - 1 (sweeping away from layer 0) direction < 0 -- use unfixedLayer + 1 (sweepeing towards layer 0)
The directionBS argument indicates which of the adjacent layers should be taken into consideration when reducing the number of bends. direction == 0 -- use unfixedLayer - 1 and unfixedLayer + 1 direction > 0 -- use unfixedLayer - 1 (sweeping away from layer 0) direction < 0 -- use unfixedLayer + 1 (sweepeing towards layer 0)
The "weighted bend" between a node U and a node V connected by link L is calculated by abs((U.column + L.portFromColOffset) - (V.column + L.portToColOffset)) * LinkStraightenWeight(L)
The LinkStraightenWeight attempts to give higher priority to links between "artificial" nodes; i.e., long links in the final layout will be straighter. The idea is to use a bubble-sort technique to exchange adjacent nodes whenever doing so reduces the number of link crossings or the number of bends. This function is used in both crossing reduction and bend straightening. Returns true if some change was made to the layer.'Declaration Protected Overridable Function AdjacentExchangeCrossingReductionBendStraighten( _ ByVal unfixedLayer As Integer, _ ByVal directionCR As Integer, _ ByVal straighten As Boolean, _ ByVal directionBS As Integer _ ) As Boolean
protected virtual bool AdjacentExchangeCrossingReductionBendStraighten( int unfixedLayer, int directionCR, bool straighten, int directionBS )
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2