AdjacentExchangeCrossingReductionBendStraighten Method
In This Topic
Adjusts the columns of nodes within the unfixedLayer to simultaneously reduce the number of link crossings and the number of "bends" between the unfixedLayer and its adjacent layers between the unfixedLayer and its adjacent layers. The directionCR argument indicates which of the adjacent layers should be taken into consideration when reducing the number of link crossings. 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.
Syntax
protected virtual bool AdjacentExchangeCrossingReductionBendStraighten(
int ,
int ,
bool ,
int
)
Parameters
- unfixedLayer
- the layer to be reordered
- directionCR
- indicates which adjacent layers should be taken into consideration when calculating the crossing matrix
- straighten
- indicates whether or not to reorder to nodes to straighten links
- directionBS
- indicates which adjacent layers should be taken into consideration when calculating the bends of a link
Return Value
Returns true if some change was made to the layer and false otherwise.
See Also