SnapSpace

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

Properties

Empty

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

IsEmpty

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

Methods

Create

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

Create

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

Create

#
Create a snap space from multiple x and y snapping rules.
x (IEnumerable<SnapNumeric>)Optional X snapping rules.
y (IEnumerable<SnapNumeric>)Optional Y snapping rules.

Create

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

Create

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

CreateOrthogonal

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

CreateOrthogonal

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

Merge

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

Snap

#
public void Snap(double x, double y, double cutoff, out double xʹ, out double yʹ, out string description)
Snap a coordinate to this space.
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

#
public void Snap(double x, double y, out double xʹ, out double yʹ, out string description)
Snap a coordinate to this space.
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.