com.esri.core.geometry
Class Envelope2D

java.lang.Object
  extended by com.esri.core.geometry.Envelope2D

public final class Envelope2D
extends Object

An axis parallel 2-dimensional rectangle.


Constructor Summary
Envelope2D()
           
Envelope2D(double _xmin, double _ymin, double _xmax, double _ymax)
           
 
Method Summary
 void centerAt(double x, double y)
           
 void centerAt(Point c)
           
 int clipLine(com.esri.core.geometry.Point2D p1, com.esri.core.geometry.Point2D p2)
           
static Envelope2D construct(double _xmin, double _ymin, double _xmax, double _ymax)
           
 boolean contains(double x, double y)
           
 boolean contains(Envelope2D other)
          Returns True if the envelope contains the other envelope (boundary inclusive).
 boolean contains(Point p)
           
 boolean contains(com.esri.core.geometry.Point2D p)
           
 boolean equals(Object _other)
           
 double getArea()
           
 com.esri.core.geometry.Point2D getCenter()
          Gets the center point of the envelope.
 double getCenterX()
           
 double getCenterY()
           
 double getHeight()
           
 Envelope2D getInflated(double dx, double dy)
           
 double getLength()
           
 Point getLowerLeft()
           
 Point getLowerRight()
           
 Point getUpperLeft()
           
 Point getUpperRight()
           
 double getWidth()
           
 int hashCode()
           
 void inflate(double dx, double dy)
           
 boolean intersect(Envelope2D other)
          Checks if this envelope intersects the other.
 boolean isEmpty()
           
 boolean isIntersecting(Envelope2D other)
          Checks if this envelope intersects the other.
 boolean isIntersectingNE(Envelope2D other)
          Checks if this envelope intersects the other assuming neither one is empty.
 boolean isValid()
          Returns True if this envelope is valid (empty, or has xmin less or equal to xmax, or ymin less or equal to ymax).
 void merge(double x, double y)
           
 void merge(Envelope2D other)
           
 void merge(com.esri.core.geometry.Point2D pt)
           
 void merge(com.esri.core.geometry.Point3D pt)
           
 void mergeNE(double x, double y)
          Merges a point with this envelope without checking if the envelope is empty.
 void move(double dx, double dy)
          Moves the Envelope by given distance.
 void normalize()
           
 void offset(double dx, double dy)
           
 void queryCenter(com.esri.core.geometry.Point2D center)
           
 com.esri.core.geometry.Point2D queryCorner(int index)
          Queries a corner of the envelope.
 void queryCorners(com.esri.core.geometry.Point2D[] corners)
          Queries corners into a given array.
 void queryCornersReversed(com.esri.core.geometry.Point2D[] corners)
          Queries corners into a given array in reversed order.
 void queryLowerLeft(com.esri.core.geometry.Point2D pt)
           
 void queryLowerRight(com.esri.core.geometry.Point2D pt)
           
 void queryUpperLeft(com.esri.core.geometry.Point2D pt)
           
 void queryUpperRight(com.esri.core.geometry.Point2D pt)
           
 void reaspect(double arWidth, double arHeight)
           
 void scale(double f)
           
 void setCoords(double _x, double _y)
           
 void setCoords(double _xmin, double _ymin, double _xmax, double _ymax)
           
 void setCoords(Envelope1D xinterval, Envelope1D yinterval)
           
 void setCoords(Envelope2D envSrc)
           
 void setCoords(com.esri.core.geometry.Point2D pt)
           
 void setCoords(com.esri.core.geometry.Point2D center, double width, double height)
           
 void setEmpty()
           
 void setFromPoints(com.esri.core.geometry.Point2D[] points)
          Sets the envelope from the array of points.
 void setFromPoints(com.esri.core.geometry.Point2D[] points, int count)
           
 void setInfinite()
           
 void zoom(double factorX, double factorY)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Envelope2D

public Envelope2D()

Envelope2D

public Envelope2D(double _xmin,
                  double _ymin,
                  double _xmax,
                  double _ymax)
Method Detail

construct

public static Envelope2D construct(double _xmin,
                                   double _ymin,
                                   double _xmax,
                                   double _ymax)

setCoords

public void setCoords(double _x,
                      double _y)

setCoords

public void setCoords(double _xmin,
                      double _ymin,
                      double _xmax,
                      double _ymax)

setCoords

public void setCoords(com.esri.core.geometry.Point2D center,
                      double width,
                      double height)

setCoords

public void setCoords(com.esri.core.geometry.Point2D pt)

setCoords

public void setCoords(Envelope2D envSrc)

getInflated

public Envelope2D getInflated(double dx,
                              double dy)

setFromPoints

public void setFromPoints(com.esri.core.geometry.Point2D[] points)
Sets the envelope from the array of points. The envelope will be set to empty if the array is null.


setEmpty

public void setEmpty()

setInfinite

public void setInfinite()

isEmpty

public boolean isEmpty()

setCoords

public void setCoords(Envelope1D xinterval,
                      Envelope1D yinterval)

merge

public void merge(double x,
                  double y)

mergeNE

public void mergeNE(double x,
                    double y)
Merges a point with this envelope without checking if the envelope is empty. Use with care.


merge

public void merge(com.esri.core.geometry.Point2D pt)

merge

public void merge(com.esri.core.geometry.Point3D pt)

merge

public void merge(Envelope2D other)

inflate

public void inflate(double dx,
                    double dy)

scale

public void scale(double f)

zoom

public void zoom(double factorX,
                 double factorY)

isIntersecting

public boolean isIntersecting(Envelope2D other)
Checks if this envelope intersects the other.

Returns:
True if this envelope intersects the other.

isIntersectingNE

public boolean isIntersectingNE(Envelope2D other)
Checks if this envelope intersects the other assuming neither one is empty.

Returns:
True if this envelope intersects the other. Assumes this and other envelopes are not empty.

intersect

public boolean intersect(Envelope2D other)
Checks if this envelope intersects the other.

Returns:
True if this envelope intersects the other.

queryCorner

public com.esri.core.geometry.Point2D queryCorner(int index)
Queries a corner of the envelope.

Parameters:
index - Indicates a corner of the envelope.

0 => lower left or (xmin, ymin)

1 => upper left or (xmin, ymax)

2 => upper right or (xmax, ymax)

3 => lower right or (xmax, ymin)

Returns:
Point at a corner of the envelope.

queryCorners

public void queryCorners(com.esri.core.geometry.Point2D[] corners)
Queries corners into a given array. The array length must be at least 4. Starts from the lower left corner and goes clockwise.


queryCornersReversed

public void queryCornersReversed(com.esri.core.geometry.Point2D[] corners)
Queries corners into a given array in reversed order. The array length must be at least 4. Starts from the lower left corner and goes counterclockwise.


getArea

public double getArea()

getLength

public double getLength()

setFromPoints

public void setFromPoints(com.esri.core.geometry.Point2D[] points,
                          int count)

reaspect

public void reaspect(double arWidth,
                     double arHeight)

getCenterX

public double getCenterX()

getCenterY

public double getCenterY()

getWidth

public double getWidth()

getHeight

public double getHeight()

move

public void move(double dx,
                 double dy)
Moves the Envelope by given distance.


centerAt

public void centerAt(double x,
                     double y)

offset

public void offset(double dx,
                   double dy)

normalize

public void normalize()

queryLowerLeft

public void queryLowerLeft(com.esri.core.geometry.Point2D pt)

queryLowerRight

public void queryLowerRight(com.esri.core.geometry.Point2D pt)

queryUpperLeft

public void queryUpperLeft(com.esri.core.geometry.Point2D pt)

queryUpperRight

public void queryUpperRight(com.esri.core.geometry.Point2D pt)

isValid

public boolean isValid()
Returns True if this envelope is valid (empty, or has xmin less or equal to xmax, or ymin less or equal to ymax).


getCenter

public com.esri.core.geometry.Point2D getCenter()
Gets the center point of the envelope. The Center Point occurs at: ((XMin + XMax) / 2, (YMin + YMax) / 2).

Returns:
the center point

queryCenter

public void queryCenter(com.esri.core.geometry.Point2D center)

centerAt

public void centerAt(Point c)

getLowerLeft

public Point getLowerLeft()

getUpperLeft

public Point getUpperLeft()

getLowerRight

public Point getLowerRight()

getUpperRight

public Point getUpperRight()

contains

public boolean contains(Point p)

contains

public boolean contains(com.esri.core.geometry.Point2D p)

contains

public boolean contains(double x,
                        double y)

contains

public boolean contains(Envelope2D other)
Returns True if the envelope contains the other envelope (boundary inclusive).


equals

public boolean equals(Object _other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

clipLine

public int clipLine(com.esri.core.geometry.Point2D p1,
                    com.esri.core.geometry.Point2D p2)


Copyright © 2013. All Rights Reserved.