Class Characterization<S extends Space>
- java.lang.Object
-
- org.apache.commons.math3.geometry.partitioning.Characterization<S>
-
- Type Parameters:
S
- Type of the space.
class Characterization<S extends Space> extends java.lang.Object
Cut sub-hyperplanes characterization with respect to inside/outside cells.- Since:
- 3.4
- See Also:
BoundaryBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private NodesSet<S>
insideSplitters
Nodes that were used to split the outside touching part.private SubHyperplane<S>
insideTouching
Part of the cut sub-hyperplane that touch inside cells.private NodesSet<S>
outsideSplitters
Nodes that were used to split the outside touching part.private SubHyperplane<S>
outsideTouching
Part of the cut sub-hyperplane that touch outside cells.
-
Constructor Summary
Constructors Constructor Description Characterization(BSPTree<S> node, SubHyperplane<S> sub)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addInsideTouching(SubHyperplane<S> sub, java.util.List<BSPTree<S>> splitters)
Add a part of the cut sub-hyperplane known to touch an inside cell.private void
addOutsideTouching(SubHyperplane<S> sub, java.util.List<BSPTree<S>> splitters)
Add a part of the cut sub-hyperplane known to touch an outside cell.private void
characterize(BSPTree<S> node, SubHyperplane<S> sub, java.util.List<BSPTree<S>> splitters)
Filter the parts of an hyperplane belonging to the boundary.NodesSet<S>
getInsideSplitters()
Get the nodes that were used to split the inside touching part.NodesSet<S>
getOutsideSplitters()
Get the nodes that were used to split the outside touching part.SubHyperplane<S>
insideTouching()
Get all the parts of the cut sub-hyperplane known to touch inside cells.SubHyperplane<S>
outsideTouching()
Get all the parts of the cut sub-hyperplane known to touch outside cells.boolean
touchInside()
Check if the cut sub-hyperplane touches inside cells.boolean
touchOutside()
Check if the cut sub-hyperplane touches outside cells.
-
-
-
Field Detail
-
outsideTouching
private SubHyperplane<S extends Space> outsideTouching
Part of the cut sub-hyperplane that touch outside cells.
-
insideTouching
private SubHyperplane<S extends Space> insideTouching
Part of the cut sub-hyperplane that touch inside cells.
-
outsideSplitters
private final NodesSet<S extends Space> outsideSplitters
Nodes that were used to split the outside touching part.
-
-
Constructor Detail
-
Characterization
Characterization(BSPTree<S> node, SubHyperplane<S> sub)
Simple constructor.Characterization consists in splitting the specified sub-hyperplane into several parts lying in inside and outside cells of the tree. The principle is to compute characterization twice for each cut sub-hyperplane in the tree, once on the plus node and once on the minus node. The parts that have the same flag (inside/inside or outside/outside) do not belong to the boundary while parts that have different flags (inside/outside or outside/inside) do belong to the boundary.
- Parameters:
node
- current BSP tree nodesub
- sub-hyperplane to characterize
-
-
Method Detail
-
characterize
private void characterize(BSPTree<S> node, SubHyperplane<S> sub, java.util.List<BSPTree<S>> splitters)
Filter the parts of an hyperplane belonging to the boundary.The filtering consist in splitting the specified sub-hyperplane into several parts lying in inside and outside cells of the tree. The principle is to call this method twice for each cut sub-hyperplane in the tree, once on the plus node and once on the minus node. The parts that have the same flag (inside/inside or outside/outside) do not belong to the boundary while parts that have different flags (inside/outside or outside/inside) do belong to the boundary.
- Parameters:
node
- current BSP tree nodesub
- sub-hyperplane to characterizesplitters
- nodes that did split the current one
-
addOutsideTouching
private void addOutsideTouching(SubHyperplane<S> sub, java.util.List<BSPTree<S>> splitters)
Add a part of the cut sub-hyperplane known to touch an outside cell.- Parameters:
sub
- part of the cut sub-hyperplane known to touch an outside cellsplitters
- sub-hyperplanes that did split the current one
-
addInsideTouching
private void addInsideTouching(SubHyperplane<S> sub, java.util.List<BSPTree<S>> splitters)
Add a part of the cut sub-hyperplane known to touch an inside cell.- Parameters:
sub
- part of the cut sub-hyperplane known to touch an inside cellsplitters
- sub-hyperplanes that did split the current one
-
touchOutside
public boolean touchOutside()
Check if the cut sub-hyperplane touches outside cells.- Returns:
- true if the cut sub-hyperplane touches outside cells
-
outsideTouching
public SubHyperplane<S> outsideTouching()
Get all the parts of the cut sub-hyperplane known to touch outside cells.- Returns:
- parts of the cut sub-hyperplane known to touch outside cells (may be null or empty)
-
getOutsideSplitters
public NodesSet<S> getOutsideSplitters()
Get the nodes that were used to split the outside touching part.Splitting nodes are internal nodes (i.e. they have a non-null cut sub-hyperplane).
- Returns:
- nodes that were used to split the outside touching part
-
touchInside
public boolean touchInside()
Check if the cut sub-hyperplane touches inside cells.- Returns:
- true if the cut sub-hyperplane touches inside cells
-
insideTouching
public SubHyperplane<S> insideTouching()
Get all the parts of the cut sub-hyperplane known to touch inside cells.- Returns:
- parts of the cut sub-hyperplane known to touch inside cells (may be null or empty)
-
-