LoopCrosser

LoopCrosser is a helper class for determining whether two loops cross. It is instantiated twice for each pair of loops to be tested, once for the pair (A,B) and once for the pair (B,A), in order to be able to process edges in either loop nesting order.

Constructors

this
this(S2Loop a, S2Loop b, LoopRelation relation, bool swapped)

If "swapped" is true, the loops A and B have been swapped. This affects how arguments are passed to the given loop relation, since for example A.Contains(B) is not the same as B.Contains(A).

Members

Functions

aCrossingTarget
int aCrossingTarget()

Returns the crossing targets for the loop relation, taking into account whether the loops have been swapped.

bCrossingTarget
int bCrossingTarget()
Undocumented in source. Be warned that the author may not have intended to support it.
cellCrossesCell
bool cellCrossesCell(S2ClippedShape a_clipped, S2ClippedShape b_clipped)

Given two index cells, return true if there are any edge crossings or wedge crossings within those cells.

hasCrossingRelation
bool hasCrossingRelation(RangeIterator ai, RangeIterator bi)

Given two iterators positioned such that ai->id().Contains(bi->id()), return true if there is a crossing relationship anywhere within ai->id(). Specifically, this method returns true if there is an edge crossing, a wedge crossing, or a point P that matches both "crossing targets". Advances both iterators past ai->id().

Meta