org.scijava.util
Class RealRect

java.lang.Object
  extended by org.scijava.util.RealRect

public class RealRect
extends Object

A class for representing a rectangular region, in real coordinates.

Author:
Barry DeZonia, Curtis Rueden

Field Summary
 double height
           
 double width
           
 double x
           
 double y
           
 
Constructor Summary
RealRect()
           
RealRect(double x, double y, double width, double height)
           
 
Method Summary
 boolean contains(RealCoords coords)
          Tests whether the given coordinates lie within the rectangle.
 boolean equals(Object o)
           
 RealCoords getBottomRight()
          Gets the bottom right coordinate of the rectangle.
 RealCoords getTopLeft()
          Gets the top left coordinate of the rectangle.
 int hashCode()
           
 RealRect intersection(RealRect r)
          Returns a Rect representing the intersection of this Rect with the given Rect.
 boolean intersects(RealRect r)
          Returns true if this rect intersects the given rect.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x

y

public double y

width

public double width

height

public double height
Constructor Detail

RealRect

public RealRect()

RealRect

public RealRect(double x,
                double y,
                double width,
                double height)
Method Detail

intersects

public boolean intersects(RealRect r)
Returns true if this rect intersects the given rect.


intersection

public RealRect intersection(RealRect r)
Returns a Rect representing the intersection of this Rect with the given Rect. If the two Rects do not intersect, the result is an empty Rect.


contains

public boolean contains(RealCoords coords)
Tests whether the given coordinates lie within the rectangle.


getTopLeft

public RealCoords getTopLeft()
Gets the top left coordinate of the rectangle.


getBottomRight

public RealCoords getBottomRight()
Gets the bottom right coordinate of the rectangle.


toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009–2015 SciJava. All rights reserved.