Package snap.gfx3d

Class Bounds3D

java.lang.Object
snap.gfx3d.Bounds3D
All Implemented Interfaces:
Cloneable

public class Bounds3D extends Object implements Cloneable
This class represents bounds for 3D shapes (XYZ min/max).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
    Bounds3D(double aMinX, double aMinY, double aMinZ, double aMaxX, double aMaxY, double aMaxZ)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Expands this Box3D to include given point.
    void
    addXYZ(double aX, double aY, double aZ)
    Expands this Box3D to include given point.
    Override to support Cloneable.
    Returns a copy of the bounds for given transform.
    Returns the center point of this box.
    Returns the corner points.
    double
    Returns the box depth.
    double
    Returns the box height.
    double
    Returns the max X value.
    Returns the max XYZ point.
    double
    Returns the max Y value.
    double
    Returns the max Z value.
    double
    Returns the mid X for the path.
    double
    Returns the mid Y for the path.
    double
    Returns the mid Z for the path.
    double
    Returns the min X value.
    Returns the min XYZ point.
    double
    Returns the min Y value.
    double
    Returns the min Z value.
    double
    Returns the box width.
    void
    setMaxX(double aValue)
    Sets the max X value.
    void
    setMaxXYZ(double aX, double aY, double aZ)
    Sets the max XYZ.
    void
    setMaxY(double aValue)
    Sets the max Y value.
    void
    setMaxZ(double aValue)
    Sets the max Z value.
    void
    setMinX(double aValue)
    Sets the min X value.
    void
    setMinXYZ(double aX, double aY, double aZ)
    Sets the min XYZ.
    void
    setMinY(double aValue)
    Sets the min Y value.
    void
    setMinZ(double aValue)
    Sets the min Z value.
    Standard toString implementation.
    Standard toStringProps implementation.
    void
    Transforms the path by the given transform3d.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Bounds3D

      public Bounds3D()
      Constructor.
    • Bounds3D

      public Bounds3D(double aMinX, double aMinY, double aMinZ, double aMaxX, double aMaxY, double aMaxZ)
      Constructor.
  • Method Details

    • getWidth

      public double getWidth()
      Returns the box width.
    • getHeight

      public double getHeight()
      Returns the box height.
    • getDepth

      public double getDepth()
      Returns the box depth.
    • getMinX

      public double getMinX()
      Returns the min X value.
    • setMinX

      public void setMinX(double aValue)
      Sets the min X value.
    • getMinY

      public double getMinY()
      Returns the min Y value.
    • setMinY

      public void setMinY(double aValue)
      Sets the min Y value.
    • getMinZ

      public double getMinZ()
      Returns the min Z value.
    • setMinZ

      public void setMinZ(double aValue)
      Sets the min Z value.
    • getMaxX

      public double getMaxX()
      Returns the max X value.
    • setMaxX

      public void setMaxX(double aValue)
      Sets the max X value.
    • getMaxY

      public double getMaxY()
      Returns the max Y value.
    • setMaxY

      public void setMaxY(double aValue)
      Sets the max Y value.
    • getMaxZ

      public double getMaxZ()
      Returns the max Z value.
    • setMaxZ

      public void setMaxZ(double aValue)
      Sets the max Z value.
    • getMidX

      public double getMidX()
      Returns the mid X for the path.
    • getMidY

      public double getMidY()
      Returns the mid Y for the path.
    • getMidZ

      public double getMidZ()
      Returns the mid Z for the path.
    • getMinXYZ

      public Point3D getMinXYZ()
      Returns the min XYZ point.
    • setMinXYZ

      public void setMinXYZ(double aX, double aY, double aZ)
      Sets the min XYZ.
    • getMaxXYZ

      public Point3D getMaxXYZ()
      Returns the max XYZ point.
    • setMaxXYZ

      public void setMaxXYZ(double aX, double aY, double aZ)
      Sets the max XYZ.
    • getCenter

      public Point3D getCenter()
      Returns the center point of this box.
    • addXYZ

      public void addXYZ(double aX, double aY, double aZ)
      Expands this Box3D to include given point.
    • addBox

      public void addBox(Bounds3D aBox)
      Expands this Box3D to include given point.
    • getCornerPoints

      public Point3D[] getCornerPoints()
      Returns the corner points.
    • transform

      public void transform(Matrix3D aMatrix)
      Transforms the path by the given transform3d.
    • copyForMatrix

      public Bounds3D copyForMatrix(Matrix3D aMatrix)
      Returns a copy of the bounds for given transform.
    • clone

      public Bounds3D clone()
      Override to support Cloneable.
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object
    • toStringProps

      public String toStringProps()
      Standard toStringProps implementation.