S2DistanceTarget.ShapeVisitor

Finds all polygons in the given "query_index" that completely contain a connected component of the target geometry. (For example, if the target consists of 10 points, this method finds polygons that contain any of those 10 points.) For each such polygon, "visitor" is called with the S2Shape of the polygon along with a point of the target geometry that is contained by that polygon.

Optionally, any polygon that intersects the target geometry may also be returned. In other words, this method returns all polygons that contain any connected component of the target, along with an arbitrary subset of the polygons that intersect the target.

For example, suppose that "query_index" contains two abutting polygons A and B. If the target consists of two points "a" contained by A and "b" contained by B, then both A and B are returned. But if the target consists of the edge "ab", then any subset of {A, B} could be returned (because both polygons intersect the target but neither one contains the edge "ab").

If "visitor" returns false, this method terminates early and returns false as well. Otherwise returns true.

NOTE(ericv): This method exists only for the purpose of implementing S2ClosestEdgeQuery::Options::include_interiors() efficiently. Its API is unlikely to be useful for other purposes.

class S2DistanceTarget(DistanceT)
alias ShapeVisitor = bool delegate

Meta