class PropertiesComputer extends java.lang.Object implements BSPTreeVisitor<Sphere2D>
BSPTreeVisitor.Order
Modifier and Type | Field and 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 and Description |
---|
PropertiesComputer(double tolerance)
Simple constructor.
|
Modifier and Type | Method and 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.
|
private final double tolerance
private double summedArea
private Vector3D summedBarycenter
private final java.util.List<Vector3D> convexCellsInsidePoints
public PropertiesComputer(double tolerance)
tolerance
- below which points are consider to be identicalpublic BSPTreeVisitor.Order visitOrder(BSPTree<Sphere2D> 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.
visitOrder
in interface BSPTreeVisitor<Sphere2D>
node
- BSP node guaranteed to have a non null cut sub-hyperplaneBSPTreeVisitor.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
public void visitInternalNode(BSPTree<Sphere2D> node)
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.
visitInternalNode
in interface BSPTreeVisitor<Sphere2D>
node
- BSP node guaranteed to have a non null cut sub-hyperplaneBSPTreeVisitor.visitLeafNode(org.apache.commons.math3.geometry.partitioning.BSPTree<S>)
public void visitLeafNode(BSPTree<Sphere2D> node)
visitLeafNode
in interface BSPTreeVisitor<Sphere2D>
node
- leaf BSP node having a null sub-hyperplaneBSPTreeVisitor.visitInternalNode(org.apache.commons.math3.geometry.partitioning.BSPTree<S>)
private double convexCellArea(Vertex start)
start
- start vertex of the convex cell boundaryprivate Vector3D convexCellBarycenter(Vertex start)
start
- start vertex of the convex cell boundarypublic double getArea()
public S2Point getBarycenter()
public java.util.List<Vector3D> getConvexCellsInsidePoints()
Copyright (c) 2003-2014 Apache Software Foundation