Uses of Class
com.google.common.geometry.S2Loop
-
-
Uses of S2Loop in com.google.common.geometry
Fields in com.google.common.geometry declared as S2Loop Modifier and Type Field Description private S2Loop
S2Loop.LoopCrosser. a
private S2Loop
S2Loop.LoopCrosser. b
Fields in com.google.common.geometry with type parameters of type S2Loop Modifier and Type Field Description private java.util.List<S2Loop>
S2Polygon. loops
The loops of this polygon.Methods in com.google.common.geometry that return S2Loop Modifier and Type Method Description private S2Loop
S2PolygonBuilder. assembleLoop(S2Point v0, S2Point v1, java.util.List<S2Edge> unusedEdges)
We start at the given edge and assemble a loop taking left turns whenever possible.(package private) static S2Loop
S2Loop. decode(LittleEndianInput decoder)
Returns a loop decoded from the given stream.(package private) static S2Loop
S2Loop. decodeCompressed(int level, LittleEndianInput decoder)
private static S2Loop
S2Loop. decodeInternal(LittleEndianInput decoder)
static S2Loop
S2Loop. empty()
Returns a new loop with one vertex that defines an empty loop (i.e., a loop with no edges that contains no points.)static S2Loop
S2Loop. full()
Returns a new loop with one vertex that creates a full loop (i.e., a loop with no edges that contains all points).S2Loop
S2ConvexHullQuery. getConvexHull()
Computes the convex hull of the input geometry provided.private static S2Loop
S2ConvexHullQuery. getSingleEdgeLoop(S2Point a, S2Point b)
Construct a loop consisting of the two vertices and their midpoint.private static S2Loop
S2ConvexHullQuery. getSinglePointLoop(S2Point p)
Constructs a 3-vertex polygon consisting of "p" and two nearby vertices.S2Loop
S2Polygon. loop(int k)
Returns the loop at the given index.S2Loop
S2FractalBuilder. makeLoop(Matrix3x3 frame, S1Angle nominalRadius)
Returns a fractal loop centered around the a-axis of the given coordinate frame, with the first vertex in the direction of the positive x-axis, and the given nominal radius.static S2Loop
S2TextFormat. makeLoop(java.lang.String str)
As above, but does not CHECK-fail on invalid input.static S2Loop
S2TextFormat. makeLoopOrDie(java.lang.String str)
Given a string of latitude-longitude coordinates in degrees, returns a newly allocated loop.static S2Loop
S2Loop. makeRegularLoop(S2Point center, S1Angle radius, int numVertices)
Create a circle of points with a given center, radius, and number of vertices.static S2Loop
S2Loop. newLoopWithTrustedDetails(java.util.List<S2Point> vertices, boolean originInside, S2LatLngRect bound)
Fast/unsafe loop initialization.S2Loop
S2Loop. simplify(S1Angle tolerance, com.google.common.base.Predicate<S2Point> vertexFilter)
Returns a simplified loop, which may be self-intersecting, or null if the entire loop was within the tolerance.private S2Loop
S2PolygonBuilder. snapLoopToLevel(S2Loop loop, int level)
Returns a new loop where the vertices of the given loop have been snapped to the centers of cells at the specified level.S2Loop
S2CellId. toLoop(int level)
Returns a loop along the boundary of this cell, with vertices at intersections with the cell grid atlevel
.Methods in com.google.common.geometry that return types with arguments of type S2Loop Modifier and Type Method Description java.util.List<S2Loop>
S2Polygon. getLoops()
Returns a view of the list ofS2Loop
s that make up this S2Polygon.Methods in com.google.common.geometry with parameters of type S2Loop Modifier and Type Method Description void
S2ConvexHullQuery. addLoop(S2Loop loop)
Adds a loop to the input geometry.void
S2PolygonBuilder. addLoop(S2Loop loop)
Adds all edges in the given loop.private boolean
S2Polygon. anyLoopContains(S2Loop b)
Returns true if any loop contains the given loop.private boolean
S2Polygon. anyLoopIntersects(S2Loop b)
Returns true if any loop intersects the given loop.(package private) boolean
S2Loop. boundaryApproxEquals(S2Loop loop)
(package private) boolean
S2Loop. boundaryApproxEquals(S2Loop b, double maxError)
Returns true if two loops have the same boundary except for vertex perturbations.(package private) boolean
S2Loop. boundaryEquals(S2Loop b)
Returns true if two loops have the same boundary.(package private) boolean
S2Loop. boundaryNear(S2Loop loop)
(package private) boolean
S2Loop. boundaryNear(S2Loop b, double maxError)
Returns true if the two loop boundaries are withinmaxError
of each other along their entire lengths.int
S2Loop. compareBoundary(S2Loop b)
Returns +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.(package private) int
S2Polygon. compareBoundary(S2Loop b)
Returns +1 if this polygon (A) contains the boundary of B, -1 if A excludes the boundary of B, and 0 if the boundaries of A and B cross.int
S2Loop. compareTo(S2Loop other)
Comparator (needed by Comparable interface)boolean
S2Loop. contains(S2Loop b)
Return true if the region contained by this loop is a superset of the region contained by the given other loop.boolean
S2Loop. containsNested(S2Loop b)
Given two loops of a polygon, return true if A contains B.private boolean
S2Polygon. containsNonCrossingBoundary(S2Loop b, boolean bReverse)
Given a polygon A and a loop B whose boundaries do not cross, returns true if A contains the boundary of B.private boolean
S2Polygon. containsNonCrossingBoundary(S2Loop a, S2Loop b, boolean bReverse)
Given two loops whose boundaries do not cross (seeS2Polygon.compareBoundary(S2Loop)
, returns true if A contains the boundary of B.private void
S2PolygonBuilder. eraseLoop(S2Loop v, int n)
(package private) static boolean
S2ShapeUtil. findSelfIntersection(S2ShapeIndex.S2ClippedShape aClipped, S2Loop aLoop, S2Error error)
Test for crossings between all edge pairs that do not share a vertex.(package private) static boolean
S2ShapeUtil. findSelfIntersection(S2ShapeIndex index, S2Loop loop, S2Error error)
Given an S2ShapeIndex containing a single loop, return true if the loop has a self-intersection (including duplicate vertices) and set "error" to a human-readable error message.(package private) static boolean
S2ShapeUtil. getCrossingError(java.util.List<S2Loop> loops, S2Loop aLoop, int ai, S2Loop bLoop, int bj, int crossing, S2Error error)
Given two loop edges for which RobustCrossing returned a non-negative result "crossing", returns true if there is a crossing and sets "error" to a human-readable error message, otherwise returns false.private static boolean
S2Loop. hasCrossingRelation(S2Loop a, S2Loop b, S2Loop.LoopRelation relation)
This method checks all edges of loop A for intersection against all edges of loop B.private void
S2Polygon. initLoop(S2Loop loop, int depth, java.util.Map<S2Loop,java.util.List<S2Loop>> loopMap)
private static void
S2Polygon. insertLoop(S2Loop newLoop, S2Loop parent, java.util.Map<S2Loop,java.util.List<S2Loop>> loopMap)
boolean
S2Loop. intersects(S2Loop b)
Return true if the region contained by this loop intersects the region contained by the given other loop.(package private) boolean
S2Loop. matchBoundaries(S2Loop b, int aOffset, double maxError)
Helper method called byboundaryNear()
to determine if this loop and loopb
remain withinmaxError
of each other, starting the comparison with this loop at vertexa_offset
and loopb
at vertex 0.private void
S2PolygonBuilder. rejectLoop(S2Loop v, int n, java.util.List<S2Edge> unusedEdges)
Erases all edges of the given loop and marks them as unused.private S2Loop
S2PolygonBuilder. snapLoopToLevel(S2Loop loop, int level)
Returns a new loop where the vertices of the given loop have been snapped to the centers of cells at the specified level.static java.lang.String
S2TextFormat. toString(S2Loop loop)
Convert an S2Loop to the S2TextFormat string representation documented above.Method parameters in com.google.common.geometry with type arguments of type S2Loop Modifier and Type Method Description boolean
S2PolygonBuilder. assembleLoops(java.util.List<S2Loop> loops, java.util.List<S2Edge> unusedEdges)
Assembles the given edges into as many non-crossing loops as possible.(package private) static boolean
S2ShapeUtil. findAnyCrossing(S2ShapeIndex index, java.util.List<S2Loop> loops, S2Error error)
Given an S2ShapeIndex containing a set of loops, return true if any loop has a self-intersection (including duplicate vertices) or crosses any other loop (including vertex crossings and duplicate edges) and set "error" to a human-readable error message.(package private) static boolean
S2ShapeUtil. findLoopCrossing(java.util.List<S2Loop> loops, S2ShapeIndex.Cell cell, S2Error error)
Returns true if any of the given loops crosses a different loop (including vertex crossings) or two loops share a common edge, and sets "error" to a human-readable error message.(package private) static boolean
S2ShapeUtil. findSelfIntersection(java.util.List<S2Loop> loops, S2ShapeIndex.Cell cell, S2Error error)
Returns true if any of the given loops has a self-intersection (including a duplicate vertex), and set "error" to a human-readable error message.(package private) static boolean
S2ShapeUtil. getCrossingError(java.util.List<S2Loop> loops, S2Loop aLoop, int ai, S2Loop bLoop, int bj, int crossing, S2Error error)
Given two loop edges for which RobustCrossing returned a non-negative result "crossing", returns true if there is a crossing and sets "error" to a human-readable error message, otherwise returns false.void
S2Polygon. init(java.util.List<S2Loop> loops)
Initializes a polygon by callingS2Polygon.initNested(List)
.private void
S2Polygon. initLoop(S2Loop loop, int depth, java.util.Map<S2Loop,java.util.List<S2Loop>> loopMap)
private void
S2Polygon. initLoop(S2Loop loop, int depth, java.util.Map<S2Loop,java.util.List<S2Loop>> loopMap)
void
S2Polygon. initNested(java.util.List<S2Loop> loops)
Initializes this polygon from a set of hierarchically nested loops.void
S2Polygon. initOriented(java.util.List<S2Loop> loops)
LikeS2Polygon.initNested(List)
, but expects loops to be oriented such that the polygon interior is on the left-hand side of all loops.void
S2Polygon. initWithNestedLoops(java.util.Map<S2Loop,java.util.List<S2Loop>> nestedLoops)
Initializes a polygon from a set ofS2Loop
s.void
S2Polygon. initWithNestedLoops(java.util.Map<S2Loop,java.util.List<S2Loop>> nestedLoops)
Initializes a polygon from a set ofS2Loop
s.private static void
S2Polygon. insertLoop(S2Loop newLoop, S2Loop parent, java.util.Map<S2Loop,java.util.List<S2Loop>> loopMap)
private static void
S2Polygon. insertLoop(S2Loop newLoop, S2Loop parent, java.util.Map<S2Loop,java.util.List<S2Loop>> loopMap)
static boolean
S2Polygon. isValid(java.util.List<S2Loop> loops)
Returns true if the given loops form a valid polygon, including checking whether the loops themselves are valid.void
S2Polygon. release(java.util.List<S2Loop> loops)
Appends the loops of this polygon to the given list and resets this polygon to be empty.private static void
S2Polygon. sortValueLoops(java.util.Map<S2Loop,java.util.List<S2Loop>> loopMap)
For each map entry, sorts the value list.private static void
S2Polygon. sortValueLoops(java.util.Map<S2Loop,java.util.List<S2Loop>> loopMap)
For each map entry, sorts the value list.Constructors in com.google.common.geometry with parameters of type S2Loop Constructor Description CompressedEncodingProperties(S2Loop loop)
LoopCrosser(S2Loop a, S2Loop b, S2Loop.LoopRelation relation, boolean swapped)
Ifswapped
is true, the loops A and B have been swapped.S2Loop(S2Loop src)
Copy constructor.S2Polygon(S2Loop loop)
Copy constructor.Constructor parameters in com.google.common.geometry with type arguments of type S2Loop Constructor Description S2Polygon(java.util.List<S2Loop> loops)
Creates an empty polygon and then callsS2Polygon.initNested(List)
with the given loops.
-