Package com.google.common.geometry
Interface S2ShapeAspect
@GwtIncompatible("Insufficient support for generics")
interface S2ShapeAspect
A set of partial
shape implementations, effectively breaking down the S2Shape API
into several aspects, each focused on a subset of the overall API:
S2ShapeAspect.VertexAspectprovides 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.EdgeAspectprovides 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 lastclosededge wraps back to the first vertex of that chain.S2ShapeAspect.ChainAspectprovides 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.TopoAspectprovides 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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceA provider of the 'edgeId' ranges for each chain, allowing alternate chain representations.static interfaceA provider of the 'vertexId' for the start and end of each 'edgeId' or 'chainId'/'edgeOffset', allowing alternate edge/vertex mappings.static interfaceA full S2Shape that mixes together each aspect.static interfaceHow world positions are classified as exterior, interior, or on the boundary of the object.static interfaceA provider of S2Point given a 'vertexId', allowing alternate storage options.