Package com.google.common.geometry
Class S2ShapeIndex.FaceEdge
java.lang.Object
com.google.common.geometry.S2ShapeIndex.FaceEdge
- Enclosing class:
S2ShapeIndex
FaceEdge stores temporary edge data while the index is being updated. FaceEdge represents an
edge in the UV coordinates of a specific face, without any clipping. ClippedEdge, by
comparison, contains the UV bound of the portion of the edge that intersects each cell.
While it would be possible to combine all the edge information into ClippedEdge, there will be many clipped edges for each original face edge, and only the UV bound is different. Keeping the shared fields on this separate class provides two advantages:
- Memory usage. Separating the two classes means that we only need to store one copy of the per-face data no matter how many times an edge is subdivided, and it also lets us delay computing bounding boxes until they are needed for processing each face (when the dataset spans multiple faces).
- Performance. UpdateEdges is significantly faster on large polygons when the data is separated, because it often only needs to access the data in ClippedEdge and this data is cached more successfully.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final double
The edge endpoints, clipped to a given face.private final double
private final double
private final double
private final int
Edge id within that shape.private final int
Not desirable to subdivide this edge beyond this level.private final int
The shape that this edge belongs to.private final S2Point
The corresponding S2Points, cached here to avoid repeated calls toS2Shape.getEdge(int, com.google.common.geometry.S2Shape.MutableEdge)
.private final S2Point
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
shapeId
private final int shapeIdThe shape that this edge belongs to. -
edgeId
private final int edgeIdEdge id within that shape. -
maxLevel
private final int maxLevelNot desirable to subdivide this edge beyond this level. -
ax
private final double axThe edge endpoints, clipped to a given face. . -
ay
private final double ay -
bx
private final double bx -
by
private final double by -
va
The corresponding S2Points, cached here to avoid repeated calls toS2Shape.getEdge(int, com.google.common.geometry.S2Shape.MutableEdge)
. -
vb
-
-
Constructor Details
-
FaceEdge
-
-
Method Details