Class Box<P extends Point<P>>

java.lang.Object
com.irurueta.geometry.Box<P>
Type Parameters:
P - a point implementation.
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Box2D, Box3D, KDTree.BoxNode

public abstract class Box<P extends Point<P>> extends Object implements Serializable
Abstract representation of a box for a point in an n-dimensional representation.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected P
    High coordinate values.
    protected P
    Low coordinate values.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Box()
    Empty constructor.
    protected
    Box(P lo, P hi)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    getDistance(P point)
    Gets distance of provided point to the boundaries of this box or zero if the point is inside this box.
    Gets high coordinate values.
    Gets low coordinate values.
    double
    Gets square distance of provided point to the boundaries of this box or zero if the point is inside this box.
    private void
    Internally sets boundaries.
    void
    setBounds(P lo, P hi)
    Sets boundaries.
    void
    setHi(P hi)
    Sets high coordinate values.
    void
    setLo(P lo)
    Sets low coordinate values.
    private double
    sqr(double value)
    Returns the squared value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • lo

      protected P extends Point<P> lo
      Low coordinate values.
    • hi

      protected P extends Point<P> hi
      High coordinate values.
  • Constructor Details

    • Box

      protected Box()
      Empty constructor.
    • Box

      protected Box(P lo, P hi)
      Constructor.
      Parameters:
      lo - low coordinate values.
      hi - high coordinate values.
  • Method Details

    • getLo

      public P getLo()
      Gets low coordinate values.
      Returns:
      low coordinate values.
    • setLo

      public void setLo(P lo)
      Sets low coordinate values.
      Parameters:
      lo - low coordinate values.
    • getHi

      public P getHi()
      Gets high coordinate values.
      Returns:
      high coordinate values.
    • setHi

      public void setHi(P hi)
      Sets high coordinate values.
      Parameters:
      hi - high coordinate values.
    • setBounds

      public void setBounds(P lo, P hi)
      Sets boundaries.
      Parameters:
      lo - low coordinate values.
      hi - high coordinate values.
    • getSqrDistance

      public double getSqrDistance(P point)
      Gets square distance of provided point to the boundaries of this box or zero if the point is inside this box.
      Parameters:
      point - point to be checked.
      Returns:
      distance of provided point.
    • getDistance

      public double getDistance(P point)
      Gets distance of provided point to the boundaries of this box or zero if the point is inside this box.
      Parameters:
      point - point to be checked.
      Returns:
      distance of provided point.
    • sqr

      private double sqr(double value)
      Returns the squared value.
      Parameters:
      value - value to be squared.
      Returns:
      squared value.
    • internalSetBounds

      private void internalSetBounds(P lo, P hi)
      Internally sets boundaries.
      Parameters:
      lo - low coordinate values.
      hi - high coordinate values.