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 Summary
Fields Modifier and Type Field Description protected V3D_EnvelopeFaceAftaThe aft face.protected V3D_EnvelopeFaceBottombThe bottom face.protected V3D_EnvelopeFaceForefThe fore face.protected V3D_EnvelopeFaceLeftlThe left face.protected V3D_EnvelopeFaceRightrThe right face.protected V3D_EnvelopeFaceToptThe top face. -
Constructor Summary
Constructors Constructor Description V3D_Envelope(V3D_Environment e, ch.obermuhlner.math.big.BigRational x, ch.obermuhlner.math.big.BigRational y, ch.obermuhlner.math.big.BigRational z)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)V3D_Envelope(V3D_Environment e, V3D_Point... points)V3D_Envelope(V3D_Envelope e) -
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object o)V3D_EnvelopegetEnvelope()V3D_EnvelopegetIntersection(V3D_Envelope en)V3D_GeometrygetIntersection(V3D_Line li)Returnsnullifthisdoes not intersectl; otherwise returns the intersection which is either a point or a line segment.V3D_GeometrygetIntersection(V3D_LineSegment l, boolean flag)ch.obermuhlner.math.big.BigRationalgetxMax()ch.obermuhlner.math.big.BigRationalgetxMin()ch.obermuhlner.math.big.BigRationalgetyMax()ch.obermuhlner.math.big.BigRationalgetyMin()ch.obermuhlner.math.big.BigRationalgetzMax()ch.obermuhlner.math.big.BigRationalgetzMin()inthashCode()booleanisContainedBy(V3D_Envelope e)Containment includes the boundary.booleanisIntersectedBy(ch.obermuhlner.math.big.BigRational x, ch.obermuhlner.math.big.BigRational y, ch.obermuhlner.math.big.BigRational z)booleanisIntersectedBy(V3D_Envelope e)Ifetouches, or overlaps then it intersects.booleanisIntersectedBy(V3D_Point p)java.lang.StringtoString()V3D_Envelopeunion(V3D_Envelope e)
-
Field Details
-
Constructor Details
-
V3D_Envelope
- Parameters:
e- An envelop.
-
V3D_Envelope
- 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- WhatxMinis set to.xMax- WhatxMaxis set to.yMin- WhatyMinis set to.yMax- WhatyMaxis set to.zMin- WhatzMinis set to.zMax- WhatzMaxis set to.
-
-
Method Details
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
union
- Parameters:
e- The V3D_Envelope to union with this.- Returns:
- an Envelope which is
thisunione.
-
isIntersectedBy
Ifetouches, or overlaps then it intersects.- Parameters:
e- The Vector_Envelope2D to test for intersection.- Returns:
trueif this intersects withe.
-
isContainedBy
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
- Parameters:
l- Line segment to intersect withthis.flag- For distinguishing between this method andgetIntersection(uk.ac.leeds.ccg.v3d.geometry.V3D_Line).- Returns:
- either a point or line segment which is the intersection of
landthis.
-
isIntersectedBy
- Parameters:
p- The point to test for intersection.- Returns:
trueif this intersects withp
-
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:
trueif this intersects withp
-
getIntersection
- Parameters:
en- The envelop to intersect.- Returns:
nullif there is no intersection;enifthis.equals(en); otherwise returns the intersection.
-
getIntersection
Returnsnullifthisdoes not intersectl; otherwise returns the intersection which is either a point or a line segment.- Parameters:
li- The line to intersect.- Returns:
nullif there is no intersection; otherwise returns the intersection.
-
getEnvelope
- Specified by:
getEnvelopein interfaceV3D_FiniteGeometry
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.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
-