S
- Type of the space.T
- Type of the sub-space.class BoundaryProjector<S extends Space,T extends Space> extends java.lang.Object implements BSPTreeVisitor<S>
BSPTreeVisitor.Order
Modifier and Type | Field and Description |
---|---|
private BSPTree<S> |
leaf
Leaf node closest to the test point.
|
private double |
offset
Current offset.
|
private Point<S> |
original
Original point.
|
private Point<S> |
projected
Current best projected point.
|
Constructor and Description |
---|
BoundaryProjector(Point<S> original)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
addRegion(SubHyperplane<S> sub,
java.util.List<Region<T>> list)
Add a boundary region to a list.
|
private boolean |
belongsToPart(Point<S> point,
Hyperplane<S> hyperplane,
Region<T> part)
Check if a projected point lies on a boundary part.
|
private java.util.List<Region<T>> |
boundaryRegions(BSPTree<S> node)
Extract the regions of the boundary on an internal node.
|
BoundaryProjection<S> |
getProjection()
Get the projection.
|
private Point<S> |
singularProjection(Point<S> point,
Hyperplane<S> hyperplane,
Region<T> part)
Get the projection to the closest boundary singular point.
|
void |
visitInternalNode(BSPTree<S> node)
Visit a BSP tree node node having a non-null sub-hyperplane.
|
void |
visitLeafNode(BSPTree<S> node)
Visit a leaf BSP tree node node having a null sub-hyperplane.
|
BSPTreeVisitor.Order |
visitOrder(BSPTree<S> node)
Determine the visit order for this node.
|
public BSPTreeVisitor.Order visitOrder(BSPTree<S> 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<S extends Space>
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<S> 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<S extends Space>
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<S> node)
visitLeafNode
in interface BSPTreeVisitor<S extends Space>
node
- leaf BSP node having a null sub-hyperplaneBSPTreeVisitor.visitInternalNode(org.apache.commons.math3.geometry.partitioning.BSPTree<S>)
public BoundaryProjection<S> getProjection()
private java.util.List<Region<T>> boundaryRegions(BSPTree<S> node)
node
- internal nodeprivate void addRegion(SubHyperplane<S> sub, java.util.List<Region<T>> list)
sub
- sub-hyperplane defining the regionlist
- to fill upprivate boolean belongsToPart(Point<S> point, Hyperplane<S> hyperplane, Region<T> part)
point
- projected point to checkhyperplane
- hyperplane into which the point was projectedpart
- boundary partprivate Point<S> singularProjection(Point<S> point, Hyperplane<S> hyperplane, Region<T> part)
point
- projected point to checkhyperplane
- hyperplane into which the point was projectedpart
- boundary partCopyright (c) 2003-2014 Apache Software Foundation