Class V3D_Envelope

java.lang.Object
uk.ac.leeds.ccg.v3d.core.V3D_Object
uk.ac.leeds.ccg.v3d.geometry.V3D_Geometry
uk.ac.leeds.ccg.v3d.geometry.envelope.V3D_Envelope
All Implemented Interfaces:
java.io.Serializable, V3D_FiniteGeometry

public class V3D_Envelope
extends V3D_Geometry
implements V3D_FiniteGeometry
An envelope contains all the extreme values with respect to the X, Y and Z axes. It is an axis aligned bounding box, which may have length of zero in any direction. For a point the envelope is essentially the point.
Version:
1.0
Author:
Andy Turner
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • V3D_Envelope

      public V3D_Envelope​(V3D_Envelope e)
      Parameters:
      e - An envelop.
    • V3D_Envelope

      public V3D_Envelope​(V3D_Environment e, V3D_Point... points)
      Parameters:
      e - An envelop.
      points - The points used to form the envelop.
    • V3D_Envelope

      public V3D_Envelope​(V3D_Environment e, ch.obermuhlner.math.big.BigRational x, ch.obermuhlner.math.big.BigRational y, ch.obermuhlner.math.big.BigRational z)
      Parameters:
      e - The vector environment.
      x - The x-coordinate of a point.
      y - The y-coordinate of a point.
      z - The z-coordinate of a point.
    • V3D_Envelope

      public V3D_Envelope​(V3D_Environment e, ch.obermuhlner.math.big.BigRational xMin, ch.obermuhlner.math.big.BigRational xMax, ch.obermuhlner.math.big.BigRational yMin, ch.obermuhlner.math.big.BigRational yMax, ch.obermuhlner.math.big.BigRational zMin, ch.obermuhlner.math.big.BigRational zMax)
      Parameters:
      e - The vector environment.
      xMin - What xMin is set to.
      xMax - What xMax is set to.
      yMin - What yMin is set to.
      yMax - What yMax is set to.
      zMin - What zMin is set to.
      zMax - What zMax is set to.
  • Method Details

    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • union

      public V3D_Envelope union​(V3D_Envelope e)
      Parameters:
      e - The V3D_Envelope to union with this.
      Returns:
      an Envelope which is this union e.
    • isIntersectedBy

      public boolean isIntersectedBy​(V3D_Envelope e)
      If e touches, or overlaps then it intersects.
      Parameters:
      e - The Vector_Envelope2D to test for intersection.
      Returns:
      true if this intersects with e.
    • isContainedBy

      public boolean isContainedBy​(V3D_Envelope e)
      Containment includes the boundary. So anything in or on the boundary is contained.
      Parameters:
      e - V3D_Envelope
      Returns:
      if this is contained by e
    • getIntersection

      public V3D_Geometry getIntersection​(V3D_LineSegment l, boolean flag)
      Parameters:
      l - Line segment to intersect with this.
      flag - For distinguishing between this method and getIntersection(uk.ac.leeds.ccg.v3d.geometry.V3D_Line).
      Returns:
      either a point or line segment which is the intersection of l and this.
    • isIntersectedBy

      public boolean isIntersectedBy​(V3D_Point p)
      Parameters:
      p - The point to test for intersection.
      Returns:
      true if this intersects with p
    • isIntersectedBy

      public boolean isIntersectedBy​(ch.obermuhlner.math.big.BigRational x, ch.obermuhlner.math.big.BigRational y, ch.obermuhlner.math.big.BigRational z)
      Parameters:
      x - The x-coordinate of the point to test for intersection.
      y - The y-coordinate of the point to test for intersection.
      z - The z-coordinate of the point to test for intersection.
      Returns:
      true if this intersects with p
    • getIntersection

      public V3D_Envelope getIntersection​(V3D_Envelope en)
      Parameters:
      en - The envelop to intersect.
      Returns:
      null if there is no intersection; en if this.equals(en); otherwise returns the intersection.
    • getIntersection

      public V3D_Geometry getIntersection​(V3D_Line li)
      Returns null if this does not intersect l; otherwise returns the intersection which is either a point or a line segment.
      Parameters:
      li - The line to intersect.
      Returns:
      null if there is no intersection; otherwise returns the intersection.
    • getEnvelope

      public V3D_Envelope getEnvelope()
      Specified by:
      getEnvelope in interface V3D_FiniteGeometry
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • getxMin

      public ch.obermuhlner.math.big.BigRational getxMin()
      Returns:
      the xMin
    • getxMax

      public ch.obermuhlner.math.big.BigRational getxMax()
      Returns:
      the xMax
    • getyMin

      public ch.obermuhlner.math.big.BigRational getyMin()
      Returns:
      the yMin
    • getyMax

      public ch.obermuhlner.math.big.BigRational getyMax()
      Returns:
      the yMax
    • getzMin

      public ch.obermuhlner.math.big.BigRational getzMin()
      Returns:
      the zMin
    • getzMax

      public ch.obermuhlner.math.big.BigRational getzMax()
      Returns:
      the zMax