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 Object
implements S2Loop.LoopRelation
Loop relation for compareBoundary().
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanTrue if loop B should be reversed.private booleanTrue if any edge of B is contained by A.private booleanTrue if any edge of B is excluded by A.private booleanTrue if any wedge was processed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe CompareBoundaryRelation does not have a useful early-exit condition, so we return -1 for both crossing targets.intbooleanbooleanbooleanGiven a vertexab1that 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 Details
-
bReversed
private final boolean bReversedTrue if loop B should be reversed. -
containsEdge
private boolean containsEdgeTrue if any edge of B is contained by A. -
excludesEdge
private boolean excludesEdgeTrue if any edge of B is excluded by A.
-
-
Constructor Details
-
CompareBoundaryRelation
public CompareBoundaryRelation(boolean reverseB)
-
-
Method Details
-
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:
aCrossingTargetin interfaceS2Loop.LoopRelation
-
bCrossingTarget
public int bCrossingTarget()- Specified by:
bCrossingTargetin interfaceS2Loop.LoopRelation
-
wedgesCross
Description copied from interface:S2Loop.LoopRelationGiven a vertexab1that 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:
wedgesCrossin interfaceS2Loop.LoopRelation