Class VolumesBI
public final class VolumesBI
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
Modifier and Type Method Description static VolumeBIcontaining(VolumeBI a, VolumeBI b)Construct a volume that will contain bothaandb.static booleancontains(VolumeBI a, VolumeBI b)Determine whether or not one volume contains another.static booleancontainsPoint(VolumeBI a, java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z)Determine whether or not a volume contains a given point.static booleancouldFitInside(VolumeBI a, VolumeBI b)Determine whether or not one volume could fit inside another.static VolumeBIcreate(java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z, java.math.BigInteger size_x, java.math.BigInteger size_y, java.math.BigInteger size_z)Create a volume of size (size_x,size_y,size_z) placing the minimum corner at(x, y, z).static VolumeBImoveAbsolute(VolumeBI volume, java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z)Move the given volume to(x, y, z).static VolumeBImoveRelative(VolumeBI volume, java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z)Move the given volume by(x, y, z).static VolumeBImoveRelativeClamped(VolumeBI container, VolumeBI volume, java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z)Move the given volume by(x, y, z), without allowingvolumeto leavecontainer.static VolumeBImoveRelativeClampedX(VolumeBI container, VolumeBI volume, java.math.BigInteger x)Move the given volume byx, without allowingvolumeto leavecontainer.static VolumeBImoveRelativeClampedY(VolumeBI container, VolumeBI volume, java.math.BigInteger y)Move the given volume byy, without allowingvolumeto leavecontainer.static VolumeBImoveRelativeClampedZ(VolumeBI container, VolumeBI volume, java.math.BigInteger z)Move the given volume byz, without allowingvolumeto leavecontainer.static VolumeBImoveToOrigin(VolumeBI volume)Move the given volume to(0, 0, 0).static booleanoverlaps(VolumeBI a, VolumeBI b)Determine whether or not two volumes overlap.static java.lang.Stringshow(VolumeBI volume)static java.lang.StringshowToBuilder(VolumeBI volume, java.lang.StringBuilder sb)static VolumeSizeBIsize(VolumeBI volume)static VolumeXYZSplitBI<VolumeBI>splitAtXYZ(VolumeBI v, java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z)Split the given volume at point(x, y, z).
-
Method Details
-
create
public static VolumeBI create(java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z, java.math.BigInteger size_x, java.math.BigInteger size_y, java.math.BigInteger 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 cornery- The Y value of the minimum cornerz- The Z value of the minimum cornersize_x- The size of the volume on the X axissize_y- The size of the volume on the Y axissize_z- The size of the volume on the Z axis- Returns:
- A volume
-
contains
Determine whether or not one volume contains another.
Containing is reflexive:
contains(a, a) == true.Containing is transitive:
contains(a, b) → contains(b, c) → contains(a, c).Containing is not necessarily symmetric.
- Parameters:
a- Volume Ab- Volume B- Returns:
trueiffacontainsb
-
moveRelative
public static VolumeBI moveRelative(VolumeBI volume, java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z)Move the given volume by(x, y, z).- Parameters:
volume- The volumex- The amount to move on the X axisy- The amount to move on the Y axisz- The amount to move on the Z axis- Returns:
- A moved volume
-
moveRelativeClampedX
public static VolumeBI moveRelativeClampedX(VolumeBI container, VolumeBI volume, java.math.BigInteger x)Move the given volume byx, without allowingvolumeto leavecontainer.- Parameters:
container- The container volumevolume- The volumex- The amount to move on the X axis- Returns:
- A moved volume
- Since:
- 3.0.0
-
moveRelativeClampedY
public static VolumeBI moveRelativeClampedY(VolumeBI container, VolumeBI volume, java.math.BigInteger y)Move the given volume byy, without allowingvolumeto leavecontainer.- Parameters:
container- The container volumevolume- The volumey- The amount to move on the Y axis- Returns:
- A moved volume
- Since:
- 3.0.0
-
moveRelativeClampedZ
public static VolumeBI moveRelativeClampedZ(VolumeBI container, VolumeBI volume, java.math.BigInteger z)Move the given volume byz, without allowingvolumeto leavecontainer.- Parameters:
container- The container volumevolume- The volumez- The amount to move on the Z axis- Returns:
- A moved volume
- Since:
- 3.0.0
-
moveRelativeClamped
public static VolumeBI moveRelativeClamped(VolumeBI container, VolumeBI volume, java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z)Move the given volume by(x, y, z), without allowingvolumeto leavecontainer.- Parameters:
container- The container volumevolume- The volumex- The amount to move on the X axisy- The amount to move on the Y axisz- The amount to move on the Z axis- Returns:
- A moved volume
- Since:
- 3.0.0
-
moveAbsolute
public static VolumeBI moveAbsolute(VolumeBI volume, java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z)Move the given volume to(x, y, z).- Parameters:
volume- The volumex- The position to which to move on the X axisy- The position to which to move on the Y axisz- The position to which to move on the Z axis- Returns:
- A moved volume
-
moveToOrigin
Move the given volume to(0, 0, 0).- Parameters:
volume- The volume- Returns:
- A moved volume
-
overlaps
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 volumeb- A volume- Returns:
trueiffaoverlapsb
-
couldFitInside
Determine whether or not one volume could fit inside another.
Fitting is reflexive:
couldFitInside(a, a) == true.Fitting is transitive:
couldFitInside(a, b) → couldFitInside(b, c) → couldFitInside(a, c).Fitting is not necessarily symmetric.
- Parameters:
a- A volumeb- A volume- Returns:
trueiffacould fit insideb
-
containing
Construct a volume that will contain bothaandb.- Parameters:
a- A volumeb- A volume- Returns:
- A volume containing
aandb
-
containsPoint
public static boolean containsPoint(VolumeBI a, java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z)Determine whether or not a volume contains a given point.
- Parameters:
a- A volumex- The X coordinate of the pointy- The Y coordinate of the pointz- The Z coordinate of the point- Returns:
trueiffacontains(x, y, z)
-
splitAtXYZ
public static VolumeXYZSplitBI<VolumeBI> splitAtXYZ(VolumeBI v, java.math.BigInteger x, java.math.BigInteger y, java.math.BigInteger z)Split the given volume at point
(x, y, z).- Parameters:
v- A volumex- The X coordinate of the pointy- The Y coordinate of the pointz- The Z coordinate of the point- Returns:
trueiffacontains(x, y, z)
-
show
- Parameters:
volume- The volume- Returns:
- A terse string describing the position and size of the volume
-
size
- Parameters:
volume- The volume- Returns:
- The size of the volume
-
showToBuilder
- Parameters:
volume- The volumesb- A string builder- Returns:
- A terse string describing the position and size of the volume
-