org.openstreetmap.josm.data.osm
Class BBox

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.BBox

public class BBox
extends java.lang.Object


Field Summary
private  double xmax
           
private  double xmin
           
private  double ymax
           
private  double ymin
           
 
Constructor Summary
BBox(BBox copy)
           
BBox(Bounds bounds)
           
BBox(double a_x, double a_y, double b_x, double b_y)
           
BBox(LatLon a, LatLon b)
           
BBox(Node n)
           
BBox(Way w)
           
 
Method Summary
 void add(BBox box)
           
 void add(double x, double y)
          Extends this bbox to include the point (x, y)
 void add(LatLon c)
           
 void addPrimitive(OsmPrimitive primitive, double extraSpace)
           
 boolean bounds(BBox b)
          Tests, weather the bbox b lies completely inside this bbox.
 boolean bounds(LatLon c)
          Tests, weather the Point c lies within the bbox.
 boolean equals(java.lang.Object o)
           
 LatLon getBottomRight()
           
 LatLon getCenter()
           
 LatLon getTopLeft()
           
 int hashCode()
           
 double height()
           
 boolean intersects(BBox b)
          Tests, weather two BBoxes intersect as an area.
 java.util.List<LatLon> points()
          Returns a list of all 4 corners of the bbox rectangle.
private  void sanity()
           
 java.lang.String toString()
           
 java.lang.String toStringCSV(java.lang.String separator)
           
 double width()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

xmin

private double xmin

xmax

private double xmax

ymin

private double ymin

ymax

private double ymax
Constructor Detail

BBox

public BBox(Bounds bounds)

BBox

public BBox(LatLon a,
            LatLon b)

BBox

public BBox(BBox copy)

BBox

public BBox(double a_x,
            double a_y,
            double b_x,
            double b_y)

BBox

public BBox(Way w)

BBox

public BBox(Node n)
Method Detail

sanity

private void sanity()

add

public void add(LatLon c)

add

public void add(double x,
                double y)
Extends this bbox to include the point (x, y)


add

public void add(BBox box)

addPrimitive

public void addPrimitive(OsmPrimitive primitive,
                         double extraSpace)

height

public double height()

width

public double width()

bounds

public boolean bounds(BBox b)
Tests, weather the bbox b lies completely inside this bbox.


bounds

public boolean bounds(LatLon c)
Tests, weather the Point c lies within the bbox.


intersects

public boolean intersects(BBox b)
Tests, weather two BBoxes intersect as an area. I.e. whether there exists a point that lies in both of them.


points

public java.util.List<LatLon> points()
Returns a list of all 4 corners of the bbox rectangle.


getTopLeft

public LatLon getTopLeft()

getBottomRight

public LatLon getBottomRight()

getCenter

public LatLon getCenter()

hashCode

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

equals

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

toString

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

toStringCSV

public java.lang.String toStringCSV(java.lang.String separator)


JOSM