Class Box

java.lang.Object
org.oscim.core.Box

public class Box extends Object
The Classic Box.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
     
    double
     
    double
     
    double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Box()
    Instantiates a new Box with all values being 0.
    Box(double x, double y)
    Simple box instantiation (for adding extents).
    Box(double xmin, double ymin, double xmax, double ymax)
    Instantiates a new Box.
    Box(Box bbox)
    Copy constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(double x, double y)
     
    void
    add(Box bbox)
     
    boolean
    contains(double x, double y)
    Check if Box contains point defined by coordinates x and y.
    boolean
    Check if Box contains Point.
    static Box
    createSafe(double x1, double y1, double x2, double y2)
     
    double
     
    double
     
    boolean
    inside(Box box)
    Check if this Box is inside box.
    void
    Convert map coordinates to lat/lon.
    boolean
    overlap(Box other)
     
    void
    scale(double d)
     
    void
    setExtents(float[] points)
    Init or overwrite extents of box.
    void
    setExtents(float[] points, int length)
    Init or overwrite extents of box.
     
    void
    translate(double dx, double dy)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • xmin

      public double xmin
    • xmax

      public double xmax
    • ymin

      public double ymin
    • ymax

      public double ymax
  • Constructor Details

    • Box

      public Box()
      Instantiates a new Box with all values being 0.
    • Box

      public Box(double x, double y)
      Simple box instantiation (for adding extents).
      Parameters:
      x - the initial x value
      y - the initial y value
    • Box

      public Box(double xmin, double ymin, double xmax, double ymax)
      Instantiates a new Box.
      Parameters:
      xmin - the min x
      ymin - the min y
      xmax - the max x
      ymax - the max y
    • Box

      public Box(Box bbox)
      Copy constructor.
  • Method Details

    • add

      public void add(double x, double y)
    • add

      public void add(Box bbox)
    • contains

      public boolean contains(double x, double y)
      Check if Box contains point defined by coordinates x and y.
      Parameters:
      x - the x ordinate
      y - the y ordinate
      Returns:
      true, if point is inside box.
    • contains

      public boolean contains(Point p)
      Check if Box contains Point.
    • createSafe

      public static Box createSafe(double x1, double y1, double x2, double y2)
    • getHeight

      public double getHeight()
    • getWidth

      public double getWidth()
    • inside

      public boolean inside(Box box)
      Check if this Box is inside box.
    • map2mercator

      public void map2mercator()
      Convert map coordinates to lat/lon.
    • overlap

      public boolean overlap(Box other)
    • scale

      public void scale(double d)
    • setExtents

      public void setExtents(float[] points)
      Init or overwrite extents of box.
      Parameters:
      points - the points to extend to
    • setExtents

      public void setExtents(float[] points, int length)
      Init or overwrite extents of box.
      Parameters:
      points - the points to extend to
      length - the number of considered points
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • translate

      public void translate(double dx, double dy)