Class PropertiesComputer
- java.lang.Object
-
- org.apache.commons.math3.geometry.spherical.twod.PropertiesComputer
-
- All Implemented Interfaces:
BSPTreeVisitor<Sphere2D>
class PropertiesComputer extends java.lang.Object implements BSPTreeVisitor<Sphere2D>
Visitor computing geometrical properties.- Since:
- 3.3
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor
BSPTreeVisitor.Order
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Vector3D>
convexCellsInsidePoints
List of points strictly inside convex cells.private double
summedArea
Summed area.private Vector3D
summedBarycenter
Summed barycenter.private double
tolerance
Tolerance below which points are consider to be identical.
-
Constructor Summary
Constructors Constructor Description PropertiesComputer(double tolerance)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double
convexCellArea(Vertex start)
Compute convex cell area.private Vector3D
convexCellBarycenter(Vertex start)
Compute convex cell barycenter.double
getArea()
Get the area.S2Point
getBarycenter()
Get the barycenter.java.util.List<Vector3D>
getConvexCellsInsidePoints()
Get the points strictly inside convex cells.void
visitInternalNode(BSPTree<Sphere2D> node)
Visit a BSP tree node node having a non-null sub-hyperplane.void
visitLeafNode(BSPTree<Sphere2D> node)
Visit a leaf BSP tree node node having a null sub-hyperplane.BSPTreeVisitor.Order
visitOrder(BSPTree<Sphere2D> node)
Determine the visit order for this node.
-
-
-
Field Detail
-
tolerance
private final double tolerance
Tolerance below which points are consider to be identical.
-
summedArea
private double summedArea
Summed area.
-
summedBarycenter
private Vector3D summedBarycenter
Summed barycenter.
-
convexCellsInsidePoints
private final java.util.List<Vector3D> convexCellsInsidePoints
List of points strictly inside convex cells.
-
-
Method Detail
-
visitOrder
public BSPTreeVisitor.Order visitOrder(BSPTree<Sphere2D> node)
Determine the visit order for this node.Before attempting to visit an internal node, this method is called to determine the desired ordering of the visit. It is guaranteed that this method will be called before
visitInternalNode
for a given node, it will be called exactly once for each internal node.- Specified by:
visitOrder
in interfaceBSPTreeVisitor<Sphere2D>
- Parameters:
node
- BSP node guaranteed to have a non null cut sub-hyperplane- Returns:
- desired visit order, must be one of
BSPTreeVisitor.Order.PLUS_MINUS_SUB
,BSPTreeVisitor.Order.PLUS_SUB_MINUS
,BSPTreeVisitor.Order.MINUS_PLUS_SUB
,BSPTreeVisitor.Order.MINUS_SUB_PLUS
,BSPTreeVisitor.Order.SUB_PLUS_MINUS
,BSPTreeVisitor.Order.SUB_MINUS_PLUS
-
visitInternalNode
public void visitInternalNode(BSPTree<Sphere2D> node)
Visit a BSP tree node node having a non-null sub-hyperplane.It is guaranteed that this method will be called after
visitOrder
has been called for a given node, it wil be called exactly once for each internal node.- Specified by:
visitInternalNode
in interfaceBSPTreeVisitor<Sphere2D>
- Parameters:
node
- BSP node guaranteed to have a non null cut sub-hyperplane- See Also:
BSPTreeVisitor.visitLeafNode(org.apache.commons.math3.geometry.partitioning.BSPTree<S>)
-
visitLeafNode
public void visitLeafNode(BSPTree<Sphere2D> node)
Visit a leaf BSP tree node node having a null sub-hyperplane.- Specified by:
visitLeafNode
in interfaceBSPTreeVisitor<Sphere2D>
- Parameters:
node
- leaf BSP node having a null sub-hyperplane- See Also:
BSPTreeVisitor.visitInternalNode(org.apache.commons.math3.geometry.partitioning.BSPTree<S>)
-
convexCellArea
private double convexCellArea(Vertex start)
Compute convex cell area.- Parameters:
start
- start vertex of the convex cell boundary- Returns:
- area
-
convexCellBarycenter
private Vector3D convexCellBarycenter(Vertex start)
Compute convex cell barycenter.- Parameters:
start
- start vertex of the convex cell boundary- Returns:
- barycenter
-
getArea
public double getArea()
Get the area.- Returns:
- area
-
getBarycenter
public S2Point getBarycenter()
Get the barycenter.- Returns:
- barycenter
-
getConvexCellsInsidePoints
public java.util.List<Vector3D> getConvexCellsInsidePoints()
Get the points strictly inside convex cells.- Returns:
- points strictly inside convex cells
-
-