Changeset 3209 in josm for trunk/src


Ignore:
Timestamp:
2010-04-26T14:52:40+02:00 (10 years ago)
Author:
bastiK
Message:

minor cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/BBox.java

    r3163 r3209  
    7878    }
    7979
     80    /**
     81     * Extends this bbox to include the point (x, y)
     82     */
    8083    public void add(double x, double y) {
    8184        xmin = Math.min(xmin, x);
     
    105108    }
    106109
     110    /**
     111     * Tests, weather the bbox b lies completely inside
     112     * this bbox.
     113     */
    107114    public boolean bounds(BBox b) {
    108115        if (!(xmin <= b.xmin) ||
     
    114121    }
    115122
     123    /**
     124     * Tests, weather the Point c lies within the bbox.
     125     */
    116126    public boolean bounds(LatLon c) {
    117127        if ((xmin <= c.lon()) &&
     
    123133    }
    124134
    125     public boolean inside(BBox b) {
     135    /**
     136     * Tests, weather two BBoxes intersect as an area.
     137     * I.e. weather there exists a point that lies in both of them.
     138     */
     139    public boolean intersects(BBox b) {
    126140        if (xmin > b.xmax)
    127141            return false;
     
    135149    }
    136150
    137     public boolean intersects(BBox b) {
    138         return this.inside(b) || b.inside(this);
    139     }
    140 
     151    /**
     152     * Returns a list of all 4 corners of the bbox rectangle.
     153     */
    141154    public List<LatLon> points()  {
    142155        LatLon p1 = new LatLon(ymin, xmin);
Note: See TracChangeset for help on using the changeset viewer.