java.lang.Object
org.apache.commons.math3.geometry.partitioning.BoundaryProjector<S,T>
- Type Parameters:
S
- Type of the space.T
- Type of the sub-space.
- All Implemented Interfaces:
BSPTreeVisitor<S>
class BoundaryProjector<S extends Space,T extends Space>
extends Object
implements BSPTreeVisitor<S>
Local tree visitor to compute projection on boundary.
- Since:
- 3.3
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor
BSPTreeVisitor.Order
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
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.boundaryRegions
(BSPTree<S> node) Extract the regions of the boundary on an internal node.Get the projection.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.visitOrder
(BSPTree<S> node) Determine the visit order for this node.
-
Field Details
-
original
Original point. -
projected
Current best projected point. -
leaf
Leaf node closest to the test point. -
offset
private double offsetCurrent offset.
-
-
Constructor Details
-
BoundaryProjector
Simple constructor.- Parameters:
original
- original point
-
-
Method Details
-
visitOrder
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<S extends Space>
- 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
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<S extends Space>
- Parameters:
node
- BSP node guaranteed to have a non null cut sub-hyperplane- See Also:
-
visitLeafNode
Visit a leaf BSP tree node node having a null sub-hyperplane.- Specified by:
visitLeafNode
in interfaceBSPTreeVisitor<S extends Space>
- Parameters:
node
- leaf BSP node having a null sub-hyperplane- See Also:
-
getProjection
Get the projection.- Returns:
- projection
-
boundaryRegions
Extract the regions of the boundary on an internal node.- Parameters:
node
- internal node- Returns:
- regions in the node sub-hyperplane
-
addRegion
Add a boundary region to a list.- Parameters:
sub
- sub-hyperplane defining the regionlist
- to fill up
-
belongsToPart
Check if a projected point lies on a boundary part.- Parameters:
point
- projected point to checkhyperplane
- hyperplane into which the point was projectedpart
- boundary part- Returns:
- true if point lies on the boundary part
-
singularProjection
Get the projection to the closest boundary singular point.- Parameters:
point
- projected point to checkhyperplane
- hyperplane into which the point was projectedpart
- boundary part- Returns:
- projection to a singular point of boundary part (may be null)
-