Package com.google.common.geometry
Interface S2ShapeAspect.EdgeAspect.Closed
- All Superinterfaces:
S2Shape,S2ShapeAspect.ChainAspect,S2ShapeAspect.EdgeAspect,S2ShapeAspect.Mixed,S2ShapeAspect.TopoAspect,S2ShapeAspect.VertexAspect
- All Known Subinterfaces:
S2LaxPolygonShape
- All Known Implementing Classes:
S2LaxPolygonShape.MultiArray,S2LaxPolygonShape.MultiList,S2LaxPolygonShape.MultiPacked,S2LaxPolygonShape.MultiSnapped,S2LaxPolygonShape.SimpleArray,S2LaxPolygonShape.SimpleList,S2LaxPolygonShape.SimplePacked,S2LaxPolygonShape.SimpleSnapped
- Enclosing interface:
S2ShapeAspect.EdgeAspect
Chains are closed, that is, there is an implicit edge between the ends of each chain.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.geometry.S2Shape
S2Shape.MutableEdge, S2Shape.ReferencePointNested classes/interfaces inherited from interface com.google.common.geometry.S2ShapeAspect.ChainAspect
S2ShapeAspect.ChainAspect.Multi, S2ShapeAspect.ChainAspect.SimpleNested classes/interfaces inherited from interface com.google.common.geometry.S2ShapeAspect.EdgeAspect
S2ShapeAspect.EdgeAspect.Closed, S2ShapeAspect.EdgeAspect.Open -
Method Summary
Modifier and TypeMethodDescriptiondefault voidadjustChains(int... chainStarts) Converts the given array of 'vertexId' values in place, yielding an array of 'edgeId' values that start each chain.default voidgetChainEdge(int chainId, int edgeOffset, S2Shape.MutableEdge result) Returns the edge for the given chain id and offset inresult.default S2PointgetChainVertex(int chainId, int edgeOffset) Returns the start point of the edge that would be returned byS2Shape.getChainEdge(int, int, com.google.common.geometry.S2Shape.MutableEdge), or the endpoint of the last edge ifedgeOffset==getChainLength(chainId).default voidgetEdge(int edgeId, S2Shape.MutableEdge result) Returns the edge for the given index inresult.default intnumEdges()Returns the number of edges in this shape.default intvertexId(int chainId, int edgeId) Returns the vertexId that starts 'edgeId', assumingedgeId(chainId) <= edgeId && edgeId < edgeId(chainId + 1).Methods inherited from interface com.google.common.geometry.S2Shape
chain, chains, containsOrigin, dimension, getChainLength, getChainStart, getReferencePoint, hasInterior, numChainsMethods inherited from interface com.google.common.geometry.S2ShapeAspect.ChainAspect
chainId, edgeId, getChainLength, getChainStart, numChainsMethods inherited from interface com.google.common.geometry.S2ShapeAspect.TopoAspect
containsOrigin, dimension, hasInteriorMethods inherited from interface com.google.common.geometry.S2ShapeAspect.VertexAspect
numVertices, vertex, vertices
-
Method Details
-
adjustChains
default void adjustChains(int... chainStarts) Description copied from interface:S2ShapeAspect.EdgeAspectConverts the given array of 'vertexId' values in place, yielding an array of 'edgeId' values that start each chain. This requires knowledge of the edge/vertex mapping, and hence this aspect of S2Shape construction is delegated here.- Specified by:
adjustChainsin interfaceS2ShapeAspect.EdgeAspect
-
numEdges
default int numEdges()Description copied from interface:S2ShapeReturns the number of edges in this shape.- Specified by:
numEdgesin interfaceS2Shape- Specified by:
numEdgesin interfaceS2ShapeAspect.EdgeAspect
-
getEdge
Description copied from interface:S2ShapeReturns the edge for the given index inresult. Must not return zero-length edges.- Specified by:
getEdgein interfaceS2Shape- Specified by:
getEdgein interfaceS2ShapeAspect.EdgeAspect- Parameters:
edgeId- which edge to set intoresult, from 0 toS2Shape.numEdges()- 1
-
getChainEdge
Description copied from interface:S2ShapeReturns the edge for the given chain id and offset inresult. Must not return zero-length edges.- Specified by:
getChainEdgein interfaceS2Shape- Specified by:
getChainEdgein interfaceS2ShapeAspect.EdgeAspect- Parameters:
chainId- which chain contains the edge to return, from 0 toS2Shape.numChains()- 1edgeOffset- position from chain start for the edge to return, from 0 toS2Shape.getChainLength(int)- 1
-
getChainVertex
Description copied from interface:S2ShapeReturns the start point of the edge that would be returned byS2Shape.getChainEdge(int, int, com.google.common.geometry.S2Shape.MutableEdge), or the endpoint of the last edge ifedgeOffset==getChainLength(chainId).- Specified by:
getChainVertexin interfaceS2Shape- Specified by:
getChainVertexin interfaceS2ShapeAspect.EdgeAspect
-
vertexId
default int vertexId(int chainId, int edgeId) Description copied from interface:S2ShapeAspect.EdgeAspectReturns the vertexId that starts 'edgeId', assumingedgeId(chainId) <= edgeId && edgeId < edgeId(chainId + 1).- Specified by:
vertexIdin interfaceS2ShapeAspect.EdgeAspect
-