Package com.google.common.geometry
Interface S2Loop.LoopRelation
- All Known Implementing Classes:
S2Loop.CompareBoundaryRelation
,S2Loop.ContainsRelation
,S2Loop.IntersectsRelation
- Enclosing class:
S2Loop
private static interface S2Loop.LoopRelation
A relation between two loops (e.g. Contains, Intersects, or CompareBoundary.)
-
Method Summary
Modifier and TypeMethodDescriptionint
Optionally,aCrossingTarget
andbCrossingTarget
can specify an early-exit condition for the loop relation.int
boolean
Given a vertexab1
that is shared between the two loops, returns true if the two associated wedges (a0, ab1, b2) and (b0, ab1, b2) are equivalent to an edge crossing.
-
Method Details
-
aCrossingTarget
int aCrossingTarget()Optionally,aCrossingTarget
andbCrossingTarget
can specify an early-exit condition for the loop relation. If any point P is found such thataCrossingTarget == (a.contains(P) ? 1 : 0) && bCrossingTarget == (b.contains(P) ? 1 : 0)
then the loop relation is assumed to be the same as if a pair of crossing edges were found. For example, the contains() relation has
aCrossingTarget() == 0 bCrossingTarget() == 1
because if
!a.contains(P)
andb.contains(P)
for any point P, then it is equivalent to finding an edge crossing (i.e., since contains() returns false in both cases).Loop relations that do not have an early-exit condition of this form should return -1 for both crossing targets.
-
bCrossingTarget
int bCrossingTarget() -
wedgesCross
Given a vertexab1
that is shared between the two loops, returns true if the two associated wedges (a0, ab1, b2) and (b0, ab1, b2) are equivalent to an edge crossing. The loop relation is also allowed to maintain its own internal state, and can return true if it observes any sequence of wedges that are equivalent to an edge crossing.
-