SnapSpace

References
public sealed class SnapSpace
Represents a collection of snapping elements.

Properties

Empty

#
Gets the empty snap space.
public static SnapSpace Empty { get; }

IsEmpty

#
Gets whether this snapping space of devoid of elements.
public bool IsEmpty { get; }

Methods

Create

#
Create a new snap-space from custom elements.
public static SnapSpace Create(
IEnumerable<ISnapElement>
elements
Snapping elements.
)
Snap space.

Create

#
Create a snap space from multiple x and y snapping rules.
public static SnapSpace Create(
x,
Optional X snapping rules.
y,
Optional Y snapping rules.
IEnumerable<ISnapElement>
elements
Snapping elements.
)

Create

#
Create a snap space from multiple x and y snapping rules.
public static SnapSpace Create(
x,
Optional X snapping rules.
y
Optional Y snapping rules.
)

Create

#
Create a new snap-space from custom elements.
public static SnapSpace Create(
params ISnapElement[]
elements
Snapping elements.
)
Snap space.

Create

#
Create a snap space from x and y snapping rules.
public static SnapSpace Create(
x = null,
Optional X snapping rule.
y = null
Optional Y snapping rule.
)

CreateOrthogonal

#
Create a snapping space for the vertices of a square grid.
public static SnapSpace CreateOrthogonal(
originX,
Origin x-coordinate.
originY,
Origin y-coordinate.
size
Size of grid cells.
)

CreateOrthogonal

#
Create a snapping space for the vertices of a rectangular grid.
public static SnapSpace CreateOrthogonal(
originX,
Origin x-coordinate.
originY,
Origin y-coordinate.
sizeX,
Width of grid cells.
sizeY
Height of grid cells.
)

Merge

#
Combine two snapping spaces.
public SnapSpace Merge(
other
)

Snap

#
Snap a coordinate to this space.
public void Snap(double x, double y, double cutoff, out double xʹ, out double yʹ, out string description)
x (double)X-coordinate.
y (double)Y-coordinate.
cutoff (double)Custom distance cutoff. The cutoff and the radius combine to limit snapping.
xʹ (out double)Snapped x-coordinate. If no snapping took place then xPrime will equal x.
yʹ (out double)Snapped y-coordinate. If no snapping took place then yPrime will equal y.
description (out string)May contain a textual descriptor for the specific snapping element involved.
True when the coordinate was snapped successfully.

Snap

#
Snap a coordinate to this space.
public void Snap(double x, double y, out double xʹ, out double yʹ, out string description)
x (double)X-coordinate.
y (double)Y-coordinate.
xʹ (out double)Snapped x-coordinate. If no snapping took place then xPrime will equal x.
yʹ (out double)Snapped y-coordinate. If no snapping took place then yPrime will equal y.
description (out string)May contain a textual descriptor for the specific snapping element involved.
True when the coordinate was snapped successfully.