Class RegionBSPTree1D.RegionSizePropertiesVisitor
- java.lang.Object
-
- org.apache.commons.geometry.euclidean.oned.RegionBSPTree1D.RegionSizePropertiesVisitor
-
- All Implemented Interfaces:
java.util.function.BiConsumer<OrientedPoint,OrientedPoint>
- Enclosing class:
- RegionBSPTree1D
private static final class RegionBSPTree1D.RegionSizePropertiesVisitor extends java.lang.Object implements java.util.function.BiConsumer<OrientedPoint,OrientedPoint>
Internal class for calculating size-related properties for aRegionBSPTree1D
.
-
-
Field Summary
Fields Modifier and Type Field Description private int
count
Number of inside intervals visited.private double
rawCentroidSum
Raw sum of the centroids of each inside interval.private double
scaledCentroidSum
The sum of the centroids of each inside interval, scaled by the size of the interval.private double
size
Total computed size of all inside regions.
-
Constructor Summary
Constructors Modifier Constructor Description private
RegionSizePropertiesVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(OrientedPoint min, OrientedPoint max)
AbstractRegionBSPTree.RegionSizeProperties<Vector1D>
getRegionSizeProperties()
Get the computed properties for the region.
-
-
-
Field Detail
-
count
private int count
Number of inside intervals visited.
-
size
private double size
Total computed size of all inside regions.
-
rawCentroidSum
private double rawCentroidSum
Raw sum of the centroids of each inside interval.
-
scaledCentroidSum
private double scaledCentroidSum
The sum of the centroids of each inside interval, scaled by the size of the interval.
-
-
Method Detail
-
accept
public void accept(OrientedPoint min, OrientedPoint max)
- Specified by:
accept
in interfacejava.util.function.BiConsumer<OrientedPoint,OrientedPoint>
-
getRegionSizeProperties
public AbstractRegionBSPTree.RegionSizeProperties<Vector1D> getRegionSizeProperties()
Get the computed properties for the region. This must only be called after every inside interval has been visited.- Returns:
- properties for the region
-
-