Function S2Loop.compareBoundary

Return +1 if A contains the boundary of B, -1 if A excludes the boundary of B, and 0 if the boundaries of A and B cross. Shared edges are handled as follows: If XY is a shared edge, define Reversed(XY) to be true if XY appears in opposite directions in A and B. Then A contains XY if and only if Reversed(XY) == B->is_hole(). (Intuitively, this checks whether A contains a vanishingly small region extending from the boundary of B toward the interior of the polygon to which loop B belongs.)

int compareBoundary (
  S2Loop b
);

This method is used for testing containment and intersection of multi-loop polygons. Note that this method is not symmetric, since the result depends on the direction of loop A but not on the direction of loop B (in the absence of shared edges).

REQUIRES

neither loop is empty.

REQUIRES

if b->is_full(), then !b->is_hole().