Table of Contents

Class DisplayRay2

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

A line without end: an XLINE, running both ways through its base point, or a RAY, running on from it. Its box reaches without end the ways it runs, so that every view it crosses draws it and a pick anywhere along it finds it; the box of its DisplayList2 holds its base point alone, as AutoCAD's ZOOM Extents does. The canvas draws the part the view shows (TryClip(DisplayBox, out double, out double, out double, out double)).

public sealed class DisplayRay2 : DisplayItem2
Inheritance
DisplayRay2
Inherited Members

Constructors

DisplayRay2(double, double, double, double, bool, DisplayStyle, string, string)

Makes a line without end.

Properties

Bounds

Gets the box the line reaches: without end along each axis it runs along, its base point's along one it runs across. An XLINE level through (200, 300) has the box from minus to plus infinity in X and from 300 to 300 in Y.

Dx

Gets the X of the way it runs, of unit length.

Dy

Gets the Y of the way it runs, of unit length.

IsBothWays

Gets whether it runs both ways, as an XLINE; false for a RAY.

X

Gets the X of the base point.

Y

Gets the Y of the base point.

Methods

DistanceTo(double, double)

Gets the distance from a point to the item, the shortest to any part that is drawn; the distance to the nearest edge for a fill, nought inside it.

Touches(DisplayBox)

Gets whether any part of the item touches a box, as a crossing selection asks.

TryClip(DisplayBox, out double, out double, out double, out double)

Gets the part of the line inside a box, as the canvas draws it in the view: an XLINE level through (200, 300) in the box from (500, 290) to (510, 310) is the segment from (500, 300) to (510, 300). The ends run the way the line does.