LabelCoverage

public class LabelCoverage
Provides methods for populating a region with non-overlapping labels.

Constructors

LabelCoverage

#
public LabelCoverage()
Create a new empty coverage set.

Properties

Boxes

#
public IEnumerable<RectangleF> Boxes { get; }
Enumerate over all boxes.

Count

#
public int Count { get; }
Gets the number of labels in this coverage.

FadeEnd

#
public float FadeEnd { get; set; }
Gets or sets the spacing between labels at which point they become completely transparent.

FadeStart

#
public float FadeStart { get; set; }
Gets or sets the spacing at which labels begin to fade to transparency.

Methods

CoincidentLabel

#
public int CoincidentLabel(PointF point)
Test whether a point is on top of one of the labels.
point (PointF)Point to test.
Index of first label which is coincident with the point.

Draw

#
public void Draw(Context context, RectangleF frame)
Render all labels in this coverage to a graphics context.
context (Context)Graphics context.
frame (RectangleF)Visible limiting frame.

Inject

#
public bool Inject(Label label)
Try to inject an existing label into the coverage.
label (Label)Label to inject.
True if label was included in the coverage, false if it collided and was rejected.

LocalSpacing

#
public float LocalSpacing(PointF point)
Compute the local spacing, ie. the distance to the nearest object.
point (PointF)

LocalSpacing

#
public float LocalSpacing(RectangleF box)
Compute the local spacing, ie. the distance to the nearest object.
box (RectangleF)
Spacing between the specified box and all existing labels.

NearestLabel

#
public int NearestLabel(PointF point, out float distance)
Find the nearest label to a point.
point (PointF)Search point.
distance (out float)Distance to nearest label will be returned here.
Index of nearest label.

ToBoxArray

#
public RectangleF[] ToBoxArray()
Create an array containing all the boxes in this coverage.
Array of boxes.