Routes links by applying patterns of segment and turn sequences and accepting them when resulting paths do not cross nodes.
Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming
C# Copy Code |
---|
public class PatternRouter : ILinkRouter |
Visual Basic Copy Code |
---|
Public Class PatternRouter |
You can add custom patterns to the Patterns list, or replace the standard patterns altogether. Patterns are defined using RoutePattern and RouteStep objects.
The following code defines a Z-like link route that will be accepted if it does not cross Obstacle nodes, nor passes by them within MinimumDistance.
C# Copy Code |
---|
var rightZigzag = new RoutePattern(); rightZigzag.Steps.Add( new RouteStep(RouteStepKind.AdvanceRelative, 0.5f)); rightZigzag.Steps.Add( new RouteStep(RouteStepKind.TurnRight)); rightZigzag.Steps.Add( new RouteStep(RouteStepKind.AdvanceRelative, 1)); rightZigzag.Steps.Add( new RouteStep(RouteStepKind.TurnLeft)); rightZigzag.Steps.Add( new RouteStep(RouteStepKind.AdvanceRelative, 0.5f)); router.Patterns.Add(rightZigzag); // this can be defined in shorter form using a pattern string // var rightZigzag = new RoutePattern( // "ADR0.5 TRR ADR1 TRL ADR0.5"); |
System.Object
MindFusion.Diagramming.PatternRouter
MindFusion.Diagramming Developer's Guide | © 2024 MindFusion |