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.ReferencePoint
Nested classes/interfaces inherited from interface com.google.common.geometry.S2ShapeAspect.ChainAspect
S2ShapeAspect.ChainAspect.Multi, S2ShapeAspect.ChainAspect.Simple
Nested classes/interfaces inherited from interface com.google.common.geometry.S2ShapeAspect.EdgeAspect
S2ShapeAspect.EdgeAspect.Closed, S2ShapeAspect.EdgeAspect.Open
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
adjustChains
(int... chainStarts) Converts the given array of 'vertexId' values in place, yielding an array of 'edgeId' values that start each chain.default void
getChainEdge
(int chainId, int edgeOffset, S2Shape.MutableEdge result) Returns the edge for the given chain id and offset inresult
.default S2Point
getChainVertex
(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 void
getEdge
(int edgeId, S2Shape.MutableEdge result) Returns the edge for the given index inresult
.default int
numEdges()
Returns the number of edges in this shape.default int
vertexId
(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, numChains
Methods inherited from interface com.google.common.geometry.S2ShapeAspect.ChainAspect
chainId, edgeId, getChainLength, getChainStart, numChains
Methods inherited from interface com.google.common.geometry.S2ShapeAspect.TopoAspect
containsOrigin, dimension, hasInterior
Methods 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.EdgeAspect
Converts 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:
adjustChains
in interfaceS2ShapeAspect.EdgeAspect
-
numEdges
default int numEdges()Description copied from interface:S2Shape
Returns the number of edges in this shape.- Specified by:
numEdges
in interfaceS2Shape
- Specified by:
numEdges
in interfaceS2ShapeAspect.EdgeAspect
-
getEdge
Description copied from interface:S2Shape
Returns the edge for the given index inresult
. Must not return zero-length edges.- Specified by:
getEdge
in interfaceS2Shape
- Specified by:
getEdge
in interfaceS2ShapeAspect.EdgeAspect
- Parameters:
edgeId
- which edge to set intoresult
, from 0 toS2Shape.numEdges()
- 1
-
getChainEdge
Description copied from interface:S2Shape
Returns the edge for the given chain id and offset inresult
. Must not return zero-length edges.- Specified by:
getChainEdge
in interfaceS2Shape
- Specified by:
getChainEdge
in 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:S2Shape
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)
.- Specified by:
getChainVertex
in interfaceS2Shape
- Specified by:
getChainVertex
in interfaceS2ShapeAspect.EdgeAspect
-
vertexId
default int vertexId(int chainId, int edgeId) Description copied from interface:S2ShapeAspect.EdgeAspect
Returns the vertexId that starts 'edgeId', assumingedgeId(chainId) <= edgeId && edgeId < edgeId(chainId + 1)
.- Specified by:
vertexId
in interfaceS2ShapeAspect.EdgeAspect
-