Class Bounds3D.Builder

  • Enclosing class:
    Bounds3D

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

      Fields 
      Modifier and Type Field Description
      private double maxX
      Maximum x coordinate.
      private double maxY
      Maximum y coordinate.
      private double maxZ
      Maximum z coordinate.
      private double minX
      Minimum x coordinate.
      private double minY
      Minimum y coordinate.
      private double minZ
      Minimum z coordinate.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Builder()
      Private constructor; instantiate through factory method.
    • Field Detail

      • 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 Detail

      • Builder

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

      • 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​(java.lang.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:
        java.lang.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:
        hasBounds()