Class PickIndex
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
A grid over the items of one display list that answers, without looking at every item, which of them lie near a point or in a box. Picking and window selection never use the pixels: they ask this index in drawing coordinates.
public sealed class PickIndex
- Inheritance
-
PickIndex
- Inherited Members
Constructors
- PickIndex(DisplayList2)
Indexes a display list.
Properties
- List
Gets the display list this index was made from.
Methods
- Crossing(DisplayBox)
Gets the entities that cross or lie in a box, as a crossing selection takes them.
- CrossingPolygon(IReadOnlyList<GeoPoint2>)
Gets the entities a polygon touches, as AutoCAD's CPolygon takes them, and a lasso drawn counter-clockwise: those an item of which lies inside it or crosses its edges, and a fill it lies inside.
- Fence(IReadOnlyList<GeoPoint2>)
Gets the entities a fence crosses, as AutoCAD's Fence takes them: those an item of which meets one of the fence's segments, touching it counted. A fence from (0, 5) to (30, 5) takes a line from (10, 0) to (10, 10), not one from (10, 6) to (20, 6). A fence of fewer than two points takes nothing.
- IndicesIn(DisplayBox)
Gets the items whose box meets a box, by their place in List, in the order they are drawn, items with no handle among them: what the canvas draws of a view. A view of a tenth of a drawing of 100 000 items looks at about a tenth of them.
- IndicesOf(string)
Gets the items an entity is drawn as, by their place in List, in the order they are drawn: a block of 40 lines inserted once gives 40 places. The canvas draws a hovered or selected entity again over the drawing from them, without looking at the other items.
- ItemsNear(DisplayBox)
Gets the items whose box meets a box, in the order they are drawn, as object snaps ask for what lies under the cursor's aperture. Items with no handle are left out, and so is a line without end (XLINE, RAY) that passes the box by further than the box's own size, unless it is drawn for a block reference, whose insertion point a snap takes from any of its items: an XLINE level through (0, 300) comes for the box from (5000, 299) to (5002, 301), not for the one from (5000, 310) to (5002, 312).
- Pick(double, double, double)
Gets the entities whose drawing lies within a distance of a point, in the order AutoCAD picks them. The distance is in drawing units, so a caller working in pixels divides by the zoom first. While the drawing's SORTENTS holds its bit 1 for object selection, as AutoCAD's default 127 does, the one drawn on top (last in the draw order) comes first, however much nearer the others lie; else the one drawn first. AutoCAD 2021's
(ssget pt)on two level lines, the one drawn later 0.9 of the pickbox off the point and the other through it, picks the later one, and under SORTENTS 0 the one drawn first. A line through the point and one drawn on top of it 2.7 off, with a tolerance of 3, come back the one on top first.
- Window(DisplayBox)
Gets the entities drawn wholly inside a box, as a window selection takes them.
- WindowPolygon(IReadOnlyList<GeoPoint2>)
Gets the entities drawn wholly inside a polygon, as AutoCAD's WPolygon takes them, and a lasso drawn clockwise: every item of the entity inside it and none crossing its edges. A line from (10, 10) to (20, 10) lies in the square from (0, 0) to (30, 30); a line without end never does.