The RemoveCollinearBendsStage removes all collinear bends found in a graph.
Implements
- I
- I
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
| Name | Default | Description |
|---|---|---|
| coreLayout | null | |
| removeStraightOnly | false | All collinear bends are removed from the edges. |
| scale | 2 | Bend coordinates are rounded to the second decimal position before comparing. |
Members
Show:
Constructors
Creates a new RemoveCollinearBendsStage instance with default settings.
Creates a new RemoveCollinearBendsStage instance with default settings.
Parameters
Properties
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
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
Defined in
LayoutStageBase.coreLayoutGets or sets a value that determines whether this stage should do anything but execute the coreLayout.
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
Defined in
LayoutStageBase.enabledIn 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 otherwiseDefault Value
The default value is: false
All collinear bends are removed from the edges.
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.2345becomes10.23for a scale factor of2). - Scale value zero: coordinates are rounded to the next integer coordinates (e.g.
10.2345becomes10). - Negative scale values: the coordinates are rounded to the next multiple of
10,100and so on (e.g.10.2345becomes0for 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.
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.
Defined in
LayoutStageBase.applyLayoutRemoves collinear bends of the edges in the given graph.
Removes collinear bends of the edges in the given graph.