Click or drag to resize
Ab4d.SharpEngine logo

LineSelectorDataCheckBoundingBox Property

Gets or sets Boolean that specifies if performance is optimized by first checking the bounding box before calculating screen positions. See remarks for more info. Default value is true when the original positions count is more or equal to 30.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public bool CheckBoundingBox { get; set; }

Property Value

Boolean
Remarks

Gets or sets Boolean that specifies if performance is optimized by first checking the bounding box before calculating screen positions.

When true and when number of positions is more than 30, then the CalculateViewPositions method calculates screen positions only for the 8 corners of the positions bounding box. This is much faster than calculating screen positions for all positions.

Then the GetClosestDistance(Vector2, Single) method first checks if the mouse position is outside of the screen bounding box. In this case the methods immediately returns with float.MaxValue (and not an actual distance of the line). If the mouse position is inside the bounding box, then screen positions are calculated for all the positions and then a new bounding box is calculated from actual screen positions. If mouse is stil inside the new bounding box, then the actual distance to the line is calculated by checking all line segments.

When CheckBoundingBox is false, then CalculateViewPositions always calculates screen positions for all positions and the GetClosestDistance(Vector2, Single) method always returns an actual distance to the line (and not float.MaxValue in case the mouse is outside the bounding box).

Default value is true when the original positions count is more or equal to 30.

See Also