org.apache.commons.math3.geometry.partitioning

## Class AbstractRegion.BoundaryBuilder<S extends Space>

- java.lang.Object
- - org.apache.commons.math3.geometry.partitioning.AbstractRegion.BoundaryBuilder<S>

- All Implemented Interfaces:
    BSPTreeVisitor<S>
  Enclosing class:
    AbstractRegion<S extends Space,T extends Space>

      private static class AbstractRegion.BoundaryBuilder<S extends Space>
      extends java.lang.Object
      implements BSPTreeVisitor<S>

  Visitor building boundary shell tree.

  The boundary shell is represented as `boundary attributes` at each internal node.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor

      `BSPTreeVisitor.Order`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `private` | `AbstractRegion.BoundaryBuilder()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `characterize(BSPTree<S> node, SubHyperplane<S> sub, SubHyperplane<S>[] characterization)` Filter the parts of an hyperplane belonging to the boundary.
    `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractRegion.BoundaryBuilder

          private AbstractRegion.BoundaryBuilder()

  - ### Method Detail

    - #### visitOrder

          public BSPTreeVisitor.Order visitOrder(BSPTree<S> node)

      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 interface `BSPTreeVisitor<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

          public void visitInternalNode(BSPTree<S> node)

      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 interface `BSPTreeVisitor<S extends Space>`
      Parameters:
        `node` - BSP node guaranteed to have a non null cut sub-hyperplane
      See Also:
        `BSPTreeVisitor.visitLeafNode(org.apache.commons.math3.geometry.partitioning.BSPTree)`

    - #### visitLeafNode

          public void visitLeafNode(BSPTree<S> node)

      Visit a leaf BSP tree node node having a null sub-hyperplane.
      Specified by:
        `visitLeafNode` in interface `BSPTreeVisitor<S extends Space>`
      Parameters:
        `node` - leaf BSP node having a null sub-hyperplane
      See Also:
        `BSPTreeVisitor.visitInternalNode(org.apache.commons.math3.geometry.partitioning.BSPTree)`

    - #### characterize

          private void characterize(BSPTree<S> node,
                          SubHyperplane<S> sub,
                          SubHyperplane<S>[] characterization)

      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 one 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
        `characterization` - placeholder where to put the characterized parts

Copyright (c) 2003-2013 Apache Software Foundation