Class Bounds3D.Builder

java.lang.Object
org.apache.commons.geometry.euclidean.threed.Bounds3D.Builder
Enclosing class:
Bounds3D

public static final class Bounds3D.Builder extends Object
Class used to construct Bounds3D instances.
  • Field Details

    • minX

      private double minX
      Minimum x coordinate.
    • minY

      private double minY
      Minimum y coordinate.
    • minZ

      private double minZ
      Minimum z coordinate.
    • maxX

      private double maxX
      Maximum x coordinate.
    • maxY

      private double maxY
      Maximum y coordinate.
    • maxZ

      private double maxZ
      Maximum z coordinate.
  • Constructor Details

    • Builder

      private Builder()
      Private constructor; instantiate through factory method.
  • Method Details

    • add

      public Bounds3D.Builder add(Vector3D pt)
      Add a point to this instance.
      Parameters:
      pt - point to add
      Returns:
      this instance
    • addAll

      public Bounds3D.Builder addAll(Iterable<? extends Vector3D> pts)
      Add a collection of points to this instance.
      Parameters:
      pts - points to add
      Returns:
      this instance
    • add

      public Bounds3D.Builder add(Bounds3D bounds)
      Add the min and max points from the given bounds to this instance.
      Parameters:
      bounds - bounds containing the min and max points to add
      Returns:
      this instance
    • hasBounds

      public boolean hasBounds()
      Return true if this builder contains valid min and max coordinate values.
      Returns:
      true if this builder contains valid min and max coordinate values
    • build

      public Bounds3D build()
      Create a new Bounds3D instance from the values in this builder. The builder can continue to be used to create other instances.
      Returns:
      a new bounds instance
      Throws:
      IllegalStateException - if no points were given to the builder or any of the computed min and max coordinate values are NaN or infinite
      See Also: