Click or drag to resize
AB4D logo

LineSelectorDataLastLinePositionIndex Property

Gets an index of the first position of the line segment that is closest to the specified position. This value is calculated in GetClosestDistance method.

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public int LastLinePositionIndex { get; }

Property Value

Int32
Remarks

Gets an index of the first position of the line segment that is closest to the specified position. This value is calculated in GetClosestDistance method.

When CheckBoundingBox is true and when the screenPosition was outside the bounding box, then this value is set to -1.

Example

This value allows getting the actual line segment that is closest to the specified position. In the following example the closes line segment is defined between the firstSegmentPosition and secondSegmentPosition:

C#
var closestPolyLine = (PolyLineVisual3D)closestLineSelector.LineVisual;
Point3D firstSegmentPosition = closestPolyLine.Positions[closestLineSelector.LastLinePositionIndex];
Point3D secondSegmentPosition = closestPolyLine.Positions[closestLineSelector.LastLinePositionIndex + 1];
See Also