Package com.google.common.geometry
Class S2ShapeUtil.AreaCentroidMeasure
- java.lang.Object
-
- com.google.common.geometry.S2ShapeUtil.AreaCentroidMeasure
-
- All Implemented Interfaces:
S2ShapeUtil.TriangleConsumer
- Enclosing class:
- S2ShapeUtil
public static final class S2ShapeUtil.AreaCentroidMeasure extends java.lang.Object implements S2ShapeUtil.TriangleConsumer
A collector of both combined area and centroid values.
-
-
Field Summary
Fields Modifier and Type Field Description private S2ShapeUtil.AreaMeasure
area
private S2ShapeUtil.CentroidMeasure
centroid
-
Constructor Summary
Constructors Constructor Description AreaCentroidMeasure()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(S2Point a, S2Point b, S2Point c)
S2AreaCentroid
value(int numVertices, com.google.common.base.Supplier<java.lang.Boolean> isNormalized)
Returns the area and centroid.
-
-
-
Field Detail
-
area
private final S2ShapeUtil.AreaMeasure area
-
centroid
private final S2ShapeUtil.CentroidMeasure centroid
-
-
Method Detail
-
accept
public void accept(S2Point a, S2Point b, S2Point c)
- Specified by:
accept
in interfaceS2ShapeUtil.TriangleConsumer
-
value
public S2AreaCentroid value(int numVertices, com.google.common.base.Supplier<java.lang.Boolean> isNormalized)
Returns the area and centroid. Only call after all triangles have been consumed.
-
-