C# Class VelocityDb.Collection.Spatial.Rectangle

Show file Open project: VelocityDB/VelocityDB Class Usage Examples

Public Methods

Method Description
Add ( Rectangle r ) : void

Computes the union of this rectangle and the passed rectangle, storing the result in this rectangle.

CompareTo ( object o ) : int
Contains ( Rectangle r ) : bool

Determine whether this rectangle contains the passed rectangle

Distance ( System.Point p ) : double

Return the distance between this rectangle and the passed point. If the rectangle contains the point, the distance is zero.

Distance ( Rectangle r ) : double

Return the distance between this rectangle and the passed rectangle. If the rectangles overlap, the distance is zero.

Enlargement ( Rectangle &r ) : double

Calculate the area by which this rectangle would be enlarged if added to the passed rectangle. Neither rectangle is altered.

Equals ( Rectangle r ) : bool
GetHashCode ( ) : int

Customized hash code using the coordinates of the rectangle 37 * minX * minY * maxX * maxY

Intersects ( Rectangle &r ) : bool

Determine whether this rectangle intersects the passed rectangle

Rectangle ( double x1, double y1, double x2, double y2 ) : System

ToString ( ) : string

Return a string representation of this rectangle, in the form: (1.2, 3.4), (5.6, 7.8)

add ( System.Point p ) : void

Computes the union of this rectangle and the passed point, storing the result in this rectangle.

containedBy ( Rectangle r ) : bool

Determine whether this rectangle is contained by the passed rectangle

distance ( double pX, double pY ) : double

Return the distance between a rectangle and a point. If the rectangle contains the point, the distance is zero.

distanceSq ( double pX, double pY ) : double

Get the square of the distance between two points.

edgeOverlaps ( Rectangle r ) : bool

Determine whether an edge of this rectangle overlies the equivalent edge of the passed rectangle

enlargement ( Rectangle r1, Rectangle r2 ) : double

Calculate the area by which a rectangle would be enlarged if added to the passed rectangle

sameObject ( object o ) : bool

Determine whether this rectangle is the same as another object. Note that two rectangles can be equal but not the same object, if they both have the same bounds.

set ( Rectangle r ) : void

Sets the size of this rectangle to equal the passed rectangle.

union ( Rectangle r ) : Rectangle

Find the the union of this rectangle and the passed rectangle.Neither rectangle is altered

Private Methods

Method Description
Rectangle ( bool s ) : System

Method Details

Add() public method

Computes the union of this rectangle and the passed rectangle, storing the result in this rectangle.
public Add ( Rectangle r ) : void
r Rectangle Rectangle to add to this rectangle
return void

CompareTo() public method

public CompareTo ( object o ) : int
o object
return int

Contains() public method

Determine whether this rectangle contains the passed rectangle
public Contains ( Rectangle r ) : bool
r Rectangle The rectangle that might be contained by this rectangle
return bool

Distance() public method

Return the distance between this rectangle and the passed point. If the rectangle contains the point, the distance is zero.
public Distance ( System.Point p ) : double
p System.Point Point to find the distance to
return double

Distance() public method

Return the distance between this rectangle and the passed rectangle. If the rectangles overlap, the distance is zero.
public Distance ( Rectangle r ) : double
r Rectangle Rectangle to find the distance to
return double

Enlargement() public method

Calculate the area by which this rectangle would be enlarged if added to the passed rectangle. Neither rectangle is altered.
public Enlargement ( Rectangle &r ) : double
r Rectangle Rectangle to union with this rectangle, in order to compute the difference in area of the union and the original rectangle
return double

Equals() public method

public Equals ( Rectangle r ) : bool
r Rectangle
return bool

GetHashCode() public method

Customized hash code using the coordinates of the rectangle 37 * minX * minY * maxX * maxY
public GetHashCode ( ) : int
return int

Intersects() public method

Determine whether this rectangle intersects the passed rectangle
public Intersects ( Rectangle &r ) : bool
r Rectangle The rectangle that might intersect this rectangle
return bool

Rectangle() public method

public Rectangle ( double x1, double y1, double x2, double y2 ) : System
x1 double coordinate of any corner of the rectangle
y1 double (see x1)
x2 double coordinate of the opposite corner
y2 double (see x2)
return System

ToString() public method

Return a string representation of this rectangle, in the form: (1.2, 3.4), (5.6, 7.8)
public ToString ( ) : string
return string

add() public method

Computes the union of this rectangle and the passed point, storing the result in this rectangle.
public add ( System.Point p ) : void
p System.Point Point to add to this rectangle
return void

containedBy() public method

Determine whether this rectangle is contained by the passed rectangle
public containedBy ( Rectangle r ) : bool
r Rectangle The rectangle that might contain this rectangle
return bool

distance() public method

Return the distance between a rectangle and a point. If the rectangle contains the point, the distance is zero.
public distance ( double pX, double pY ) : double
pX double X coordinate of point
pY double Y coordinate of point
return double

distanceSq() public method

Get the square of the distance between two points.
public distanceSq ( double pX, double pY ) : double
pX double the x coordinate of point
pY double the y coordinate of point
return double

edgeOverlaps() public method

Determine whether an edge of this rectangle overlies the equivalent edge of the passed rectangle
public edgeOverlaps ( Rectangle r ) : bool
r Rectangle
return bool

enlargement() public static method

Calculate the area by which a rectangle would be enlarged if added to the passed rectangle
public static enlargement ( Rectangle r1, Rectangle r2 ) : double
r1 Rectangle minimum X coordinate of rectangle 1
r2 Rectangle minimum X coordinate of rectangle 2
return double

sameObject() public method

Determine whether this rectangle is the same as another object. Note that two rectangles can be equal but not the same object, if they both have the same bounds.
public sameObject ( object o ) : bool
o object The object to compare with this rectangle
return bool

set() public method

Sets the size of this rectangle to equal the passed rectangle.
public set ( Rectangle r ) : void
r Rectangle
return void

union() public method

Find the the union of this rectangle and the passed rectangle.Neither rectangle is altered
public union ( Rectangle r ) : Rectangle
r Rectangle The rectangle to union with this rectangle
return Rectangle