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 Object
Cut sub-hyperplanes characterization with respect to inside/outside cells.
Since:
3.4
See Also:
  • Field Details

    • 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.
    • insideSplitters

      private final NodesSet<S extends Space> insideSplitters
      Nodes that were used to split the outside touching part.
  • Constructor Details

    • 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 node
      sub - sub-hyperplane to characterize
  • Method Details

    • characterize

      private void characterize(BSPTree<S> node, SubHyperplane<S> sub, 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 node
      sub - sub-hyperplane to characterize
      splitters - nodes that did split the current one
    • addOutsideTouching

      private void addOutsideTouching(SubHyperplane<S> sub, 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 cell
      splitters - sub-hyperplanes that did split the current one
    • addInsideTouching

      private void addInsideTouching(SubHyperplane<S> sub, 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 cell
      splitters - 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)
    • getInsideSplitters

      public NodesSet<S> getInsideSplitters()
      Get the nodes that were used to split the inside 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 inside touching part