C# Class Volante.Rectangle

Rectangle with integer coordinates. This class is used in spatial index.
Mostra file Open project: kjk/volante Class Usage Examples

Public Methods

Method Description
Area ( ) : long

Rectangle area

Contains ( Rectangle r ) : bool

Checks if this rectangle contains the specified rectangle

EqualsTo ( Rectangle other ) : bool
Intersects ( Rectangle r ) : bool

Checks if this rectangle intersects with specified rectangle

IsEmpty ( ) : bool

Check if rectanlge is empty

Join ( Rectangle a, Rectangle b ) : Rectangle

Non destructive join of two rectangles.

Join ( Rectangle r ) : void

Join two rectangles. This rectangle is updates to contain cover of this and specified rectangle.

JoinArea ( Rectangle a, Rectangle b ) : long

Area of covered rectangle for two sepcified rectangles

Rectangle ( Rectangle r ) : System

Create copy of the rectangle

Rectangle ( int top, int left, int bottom, int right ) : System

Construct rectangle with specified coordinates

Method Details

Area() public method

Rectangle area
public Area ( ) : long
return long

Contains() public method

Checks if this rectangle contains the specified rectangle
public Contains ( Rectangle r ) : bool
r Rectangle
return bool

EqualsTo() public method

public EqualsTo ( Rectangle other ) : bool
other Rectangle
return bool

Intersects() public method

Checks if this rectangle intersects with specified rectangle
public Intersects ( Rectangle r ) : bool
r Rectangle
return bool

IsEmpty() public method

Check if rectanlge is empty
public IsEmpty ( ) : bool
return bool

Join() public static method

Non destructive join of two rectangles.
public static Join ( Rectangle a, Rectangle b ) : Rectangle
a Rectangle first joined rectangle ///
b Rectangle second joined rectangle ///
return Rectangle

Join() public method

Join two rectangles. This rectangle is updates to contain cover of this and specified rectangle.
public Join ( Rectangle r ) : void
r Rectangle rectangle to be joined with this rectangle ///
return void

JoinArea() public static method

Area of covered rectangle for two sepcified rectangles
public static JoinArea ( Rectangle a, Rectangle b ) : long
a Rectangle
b Rectangle
return long

Rectangle() public method

Create copy of the rectangle
public Rectangle ( Rectangle r ) : System
r Rectangle
return System

Rectangle() public method

Construct rectangle with specified coordinates
public Rectangle ( int top, int left, int bottom, int right ) : System
top int
left int
bottom int
right int
return System