Module com.io7m.jregions.core
Package com.io7m.jregions.core.unparameterized.volumes

## Class VolumesI

- java.lang.Object
- - com.io7m.jregions.core.unparameterized.volumes.VolumesI

-     public final class VolumesI
      extends java.lang.Object

  Functions over volumes.

  These functions operate using the concepts of minimum-x, maximum-x, minimum-y, maximum-y, minimum-z, maximum-z, edges. It is up to individual applications to assign meaning to these edges such as "left" for minimum-x, "top" for minimum-y, or "far" for minimum-z.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static VolumeI` | `containing​(VolumeI a, VolumeI b)` | Construct a volume that will contain both `a` and `b`.
    `static boolean` | `contains​(VolumeI a, VolumeI b)` | Determine whether or not one volume contains another.
    `static boolean` | `containsPoint​(VolumeI a, int x, int y, int z)` | Determine whether or not a volume contains a given point.
    `static boolean` | `couldFitInside​(VolumeI a, VolumeI b)` | Determine whether or not one volume could fit inside another.
    `static VolumeI` | `create​(int x, int y, int z, int size_x, int size_y, int size_z)` | Create a volume of size (`size_x`, `size_y`, `size_z`) placing the minimum corner at `(x, y, z)`.
    `static VolumeI` | `moveAbsolute​(VolumeI volume, int x, int y, int z)` | Move the given volume to `(x, y, z)`.
    `static VolumeI` | `moveRelative​(VolumeI volume, int x, int y, int z)` | Move the given volume by `(x, y, z)`.
    `static VolumeI` | `moveToOrigin​(VolumeI volume)` | Move the given volume to `(0, 0, 0)`.
    `static boolean` | `overlaps​(VolumeI a, VolumeI b)` | Determine whether or not two volumes overlap.
    `static java.lang.String` | `show​(VolumeI volume)` |
    `static java.lang.String` | `showToBuilder​(VolumeI volume, java.lang.StringBuilder sb)` |
    `static VolumeSizeI` | `size​(VolumeI volume)` |
    `static VolumeXYZSplitI<VolumeI>` | `splitAtXYZ​(VolumeI v, int x, int y, int z)` | Split the given volume at point `(x, y, z)`.

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

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

- - ### Method Detail

    - #### create

          public static VolumeI create​(int x,
                                       int y,
                                       int z,
                                       int size_x,
                                       int size_y,
                                       int size_z)

      Create a volume of size (`size_x`, `size_y`, `size_z`) placing the minimum corner at `(x, y, z)`.
      Parameters:
        `x` - The X value of the minimum corner
        `y` - The Y value of the minimum corner
        `z` - The Z value of the minimum corner
        `size_x` - The size of the volume on the X axis
        `size_y` - The size of the volume on the Y axis
        `size_z` - The size of the volume on the Z axis
      Returns:
        A volume

    - #### contains

          public static boolean contains​(VolumeI a,
                                         VolumeI b)

      Determine whether or not one volume contains another.

      Containing is reflexive: `contains(a, a) == true`.

      Containing is transitive: `contains(a, b) \u2192 contains(b, c) \u2192 contains(a, c)`.

      Containing is not necessarily symmetric.

      Parameters:
        `a` - Volume A
        `b` - Volume B
      Returns:
        `true` iff `a` contains `b`

    - #### moveRelative

          public static VolumeI moveRelative​(VolumeI volume,
                                             int x,
                                             int y,
                                             int z)

      Move the given volume by `(x, y, z)`.
      Parameters:
        `volume` - The volume
        `x` - The amount to move on the X axis
        `y` - The amount to move on the Y axis
        `z` - The amount to move on the Z axis
      Returns:
        A moved volume

    - #### moveAbsolute

          public static VolumeI moveAbsolute​(VolumeI volume,
                                             int x,
                                             int y,
                                             int z)

      Move the given volume to `(x, y, z)`.
      Parameters:
        `volume` - The volume
        `x` - The position to which to move on the X axis
        `y` - The position to which to move on the Y axis
        `z` - The position to which to move on the Z axis
      Returns:
        A moved volume

    - #### moveToOrigin

          public static VolumeI moveToOrigin​(VolumeI volume)

      Move the given volume to `(0, 0, 0)`.
      Parameters:
        `volume` - The volume
      Returns:
        A moved volume

    - #### overlaps

          public static boolean overlaps​(VolumeI a,
                                         VolumeI b)

      Determine whether or not two volumes overlap.

      Overlapping is reflexive: `overlaps(a, a) == true`.

      Overlapping is symmetric: `overlaps(a, b) == overlaps(b, a)`.

      Overlapping is not necessarily transitive.

      Parameters:
        `a` - A volume
        `b` - A volume
      Returns:
        `true` iff `a` overlaps `b`

    - #### couldFitInside

          public static boolean couldFitInside​(VolumeI a,
                                               VolumeI b)

      Determine whether or not one volume could fit inside another.

      Fitting is reflexive: `couldFitInside(a, a) == true`.

      Fitting is transitive: `couldFitInside(a, b) \u2192 couldFitInside(b, c) \u2192 couldFitInside(a, c)`.

      Fitting is not necessarily symmetric.

      Parameters:
        `a` - A volume
        `b` - A volume
      Returns:
        `true` iff `a` could fit inside `b`

    - #### containing

          public static VolumeI containing​(VolumeI a,
                                           VolumeI b)

      Construct a volume that will contain both `a` and `b`.
      Parameters:
        `a` - A volume
        `b` - A volume
      Returns:
        A volume containing `a` and `b`

    - #### containsPoint

          public static boolean containsPoint​(VolumeI a,
                                              int x,
                                              int y,
                                              int z)

      Determine whether or not a volume contains a given point.

      Parameters:
        `a` - A volume
        `x` - The X coordinate of the point
        `y` - The Y coordinate of the point
        `z` - The Z coordinate of the point
      Returns:
        `true` iff `a` contains `(x, y, z)`

    - #### splitAtXYZ

          public static VolumeXYZSplitI<VolumeI> splitAtXYZ​(VolumeI v,
                                                            int x,
                                                            int y,
                                                            int z)

      Split the given volume at point `(x, y, z)`.

      Parameters:
        `v` - A volume
        `x` - The X coordinate of the point
        `y` - The Y coordinate of the point
        `z` - The Z coordinate of the point
      Returns:
        `true` iff `a` contains `(x, y, z)`

    - #### show

          public static java.lang.String show​(VolumeI volume)

      Parameters:
        `volume` - The volume
      Returns:
        A terse string describing the position and size of the volume

    - #### size

          public static VolumeSizeI size​(VolumeI volume)

      Parameters:
        `volume` - The volume
      Returns:
        The size of the volume

    - #### showToBuilder

          public static java.lang.String showToBuilder​(VolumeI volume,
                                                       java.lang.StringBuilder sb)

      Parameters:
        `volume` - The volume
        `sb` - A string builder
      Returns:
        A terse string describing the position and size of the volume

Copyright © 2017 <code@io7m.com> http://io7m.com