Package com.google.common.geometry
Interface S2ShapeAspect
-
@GwtIncompatible("Insufficient support for generics") interface S2ShapeAspect
A set of partialshape
implementations, effectively breaking down the S2Shape API into several aspects, each focused on a subset of the overall API:S2ShapeAspect.VertexAspect
provides a logical list of vertices, where the 'vertexId' is at least 0 and less thanS2ShapeAspect.VertexAspect.numVertices()
. Each implementation stores the list in a different way, for example apacked array
. This isn't part of the S2Shape API, but is provided for use by the other aspects.S2ShapeAspect.EdgeAspect
provides the 'vertexId' that starts and ends each edge or each chain/offset, where the 'edgeId' is at least 0 and less thanS2ShapeAspect.EdgeAspect.numEdges()
, the 'chainId' is at least 0 and less thanS2ShapeAspect.ChainAspect.numChains()
, and the 'edgeOffset' is at leastedgeId(chainId)
and less thanedgeId(chainid+1)
. For example, the endpoint of the lastclosed
edge wraps back to the first vertex of that chain.S2ShapeAspect.ChainAspect
provides a mapping between chains and edge ranges, where 'chainId' is at least 0 and less thanS2ShapeAspect.ChainAspect.numChains()
, and theS2ShapeAspect.ChainAspect.getChainStart(int)
andS2ShapeAspect.ChainAspect.getChainLength(int)
methods provide the 'edgeId' range of each chain.S2ShapeAspect.TopoAspect
provides the methods to relate a point in the world to the interior, exterior, or boundary of the shape.There may be fewer edges than vertices, e.g. 2 vertices can define 1 edge.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
S2ShapeAspect.ChainAspect
A provider of the 'edgeId' ranges for each chain, allowing alternate chain representations.static interface
S2ShapeAspect.EdgeAspect
A provider of the 'vertexId' for the start and end of each 'edgeId' or 'chainId'/'edgeOffset', allowing alternate edge/vertex mappings.static interface
S2ShapeAspect.Mixed
A full S2Shape that mixes together each aspect.static interface
S2ShapeAspect.TopoAspect
How world positions are classified as exterior, interior, or on the boundary of the object.static interface
S2ShapeAspect.VertexAspect
A provider of S2Point given a 'vertexId', allowing alternate storage options.
-