C

RemoveCollinearBendsStage

The RemoveCollinearBendsStage removes all collinear bends found in a graph.

Remarks

The algorithm traverses each edge path from source to target and removes for each triple of consecutive collinear bends the middle one.

A collinear bend forms a straight line with its preceding bend and its subsequent bend. The angle between the connecting edge segments is either 0 or 180 degrees.

Default Values of Properties

NameDefaultDescription
coreLayoutnull
removeStraightOnlyfalse
All collinear bends are removed from the edges.
scale2
Bend coordinates are rounded to the second decimal position before comparing.

Members

Show:

Constructors

Creates a new RemoveCollinearBendsStage instance with default settings.

Parameters

Properties

Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
final

Property Value

the core layout routine

Default Value

The default value is: null
Gets or sets a value that determines whether this stage should do anything but execute the coreLayout.

By default, when constructed, stages should be enabled. Users may disable a stage's functionality by setting this property to false.

Stages that can guarantee that the graph will not change can choose to not even execute the coreLayout when disabled.

final
Gets or sets whether the algorithm removes only collinear bends which lie in the middle of their neighbors or all collinear bends.
In the first case, the angle at the middle bend must be 180 degrees, while in the second case, the angle can be either 180 degrees or 0 degrees.
final

Property Value

true if only bends with 180 degrees are removed, false otherwise

Default Value

The default value is: false
All collinear bends are removed from the edges.
Gets or sets the scale that defines how accurate the algorithm is when it comes to comparing the coordinates of two bends.
This value determines how the values of the coordinates are rounded. If rounded coordinates lead to a collinear bend, this bend will be removed. The larger the value, the higher the precision is.
  • Positive scale values: the value denotes the number of decimal positions that are considered (e.g. 10.2345 becomes 10.23 for a scale factor of 2).
  • Scale value zero: coordinates are rounded to the next integer coordinates (e.g. 10.2345 becomes 10).
  • Negative scale values: the coordinates are rounded to the next multiple of 10, 100 and so on (e.g. 10.2345 becomes 0 for a scale factor of -2).
final

Property Value

the scale

Default Value

The default value is: 2
Bend coordinates are rounded to the second decimal position before comparing.

Methods

Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
This implementation checks the enabled state and when it's not enabled, will delegate to the coreLayout, directly. When the stage is enabled, all the work will be delegated to applyLayoutImpl, instead.
final

Parameters

graph: LayoutGraph
The graph to apply the layout to.
Removes collinear bends of the edges in the given graph.
protected

Parameters

graph: LayoutGraph
the input graph