Package com.google.common.geometry
Class S2Loop.CompareBoundaryRelation
- java.lang.Object
-
- com.google.common.geometry.S2Loop.CompareBoundaryRelation
-
- All Implemented Interfaces:
S2Loop.LoopRelation
- Enclosing class:
- S2Loop
private static final class S2Loop.CompareBoundaryRelation extends java.lang.Object implements S2Loop.LoopRelation
Loop relation for compareBoundary().
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
bReversed
True if loop B should be reversed.private boolean
containsEdge
True if any edge of B is contained by A.private boolean
excludesEdge
True if any edge of B is excluded by A.private boolean
foundSharedVertex
True if any wedge was processed.
-
Constructor Summary
Constructors Constructor Description CompareBoundaryRelation(boolean reverseB)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
aCrossingTarget()
The CompareBoundaryRelation does not have a useful early-exit condition, so we return -1 for both crossing targets.int
bCrossingTarget()
boolean
containsEdge()
boolean
foundSharedVertex()
boolean
wedgesCross(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2)
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.
-
-
-
Field Detail
-
bReversed
private final boolean bReversed
True if loop B should be reversed.
-
foundSharedVertex
private boolean foundSharedVertex
True if any wedge was processed.
-
containsEdge
private boolean containsEdge
True if any edge of B is contained by A.
-
excludesEdge
private boolean excludesEdge
True if any edge of B is excluded by A.
-
-
Method Detail
-
foundSharedVertex
public boolean foundSharedVertex()
-
containsEdge
public boolean containsEdge()
-
aCrossingTarget
public int aCrossingTarget()
The CompareBoundaryRelation does not have a useful early-exit condition, so we return -1 for both crossing targets.Aside: A possible early exit condition could be based on the following:
- If A contains a point of both B and ~B, then A intersects Boundary(B).
- If ~A contains a point of both B and ~B, then ~A intersects Boundary(B).
- So if the intersections of {A, ~A} with {B, ~B} are all non-empty, the return value is 0, i.e., Boundary(A) intersects Boundary(B).
- Specified by:
aCrossingTarget
in interfaceS2Loop.LoopRelation
-
bCrossingTarget
public int bCrossingTarget()
- Specified by:
bCrossingTarget
in interfaceS2Loop.LoopRelation
-
wedgesCross
public boolean wedgesCross(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2)
Description copied from interface:S2Loop.LoopRelation
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.- Specified by:
wedgesCross
in interfaceS2Loop.LoopRelation
-
-