ERY.AgateLib.Geometry.Rectangle Struct Reference

Replacement for System.Drawing.Rectangle structure. More...

List of all members.

Public Member Functions

 Rectangle (int x, int y, int width, int height)
 Constructs a rectangle.
 Rectangle (Point pt, Size sz)
 Construts a rectangle.
 Rectangle (System.Drawing.Rectangle rect)
 Constructs a rectangle.
bool Contains (int x, int y)
 Returns true if the rectangle contains the specified point.
bool Contains (Point pt)
 Returns true if the rectangle contains the specified point.
bool Contains (Rectangle rect)
 Returns true if the rectangle entirely contains the specified rectangle.
bool IntersectsWith (Rectangle rect)
 Returns true if this intersects another rectangle.
override int GetHashCode ()
 Gets a hash code.
override string ToString ()
 Creates a string representing this rectangle.
override bool Equals (object obj)
 Equality test.
bool Equals (Rectangle obj)
 Equality test.

Static Public Member Functions

static Rectangle FromLTRB (int left, int top, int right, int bottom)
 Static method which returns a rectangle with specified left, top, right and bottom.
static bool operator== (Rectangle a, Rectangle b)
 Equality comparison test.
static bool operator!= (Rectangle a, Rectangle b)
 Inequality comparison test.
static Rectangle Intersect (Rectangle a, Rectangle b)
 Static method returning the intersection of two rectangles.
static Rectangle Ceiling (RectangleF a)
 Rounds the coordinates in the rectangle up.
static Rectangle Union (Rectangle a, Rectangle b)
 Creates a new rectangle which contains all the area of the two passed in rectangles.
static operator System.Drawing.Rectangle (Rectangle rect)
 For inter-op with System.Drawing.

Public Attributes

Point pt
Size sz

Static Public Attributes

static readonly Rectangle Empty = new Rectangle(0, 0, 0, 0)
 Empty rectangle.

Properties

int X [get, set]
 X value.
int Y [get, set]
 Y value.
int Width [get, set]
 Width.
int Height [get, set]
 Height.
int Bottom [get]
 Gets bottom.
int Left [get]
 Gets left.
int Top [get]
 Gets top.
int Right [get]
 Gets right.
Point Location [get, set]
 Gets or sets top-left point.
Size Size [get, set]
 Gets or sets size.
bool IsEmpty [get]
 True if this is (0,0,0,0).


Detailed Description

Replacement for System.Drawing.Rectangle structure.


Constructor & Destructor Documentation

ERY.AgateLib.Geometry.Rectangle.Rectangle ( int  x,
int  y,
int  width,
int  height 
)

Constructs a rectangle.

Parameters:
x 
y 
width 
height 

ERY.AgateLib.Geometry.Rectangle.Rectangle ( Point  pt,
Size  sz 
)

Construts a rectangle.

Parameters:
pt 
sz 

ERY.AgateLib.Geometry.Rectangle.Rectangle ( System.Drawing.Rectangle  rect  ) 

Constructs a rectangle.

[Experimental - The API is likely to change in the future.]

Parameters:
rect 


Member Function Documentation

static Rectangle ERY.AgateLib.Geometry.Rectangle.FromLTRB ( int  left,
int  top,
int  right,
int  bottom 
) [static]

Static method which returns a rectangle with specified left, top, right and bottom.

Parameters:
left 
top 
right 
bottom 
Returns:

bool ERY.AgateLib.Geometry.Rectangle.Contains ( int  x,
int  y 
)

Returns true if the rectangle contains the specified point.

Parameters:
x 
y 
Returns:

bool ERY.AgateLib.Geometry.Rectangle.Contains ( Point  pt  ) 

Returns true if the rectangle contains the specified point.

Parameters:
pt 
Returns:

bool ERY.AgateLib.Geometry.Rectangle.Contains ( Rectangle  rect  ) 

Returns true if the rectangle entirely contains the specified rectangle.

Parameters:
rect 
Returns:

bool ERY.AgateLib.Geometry.Rectangle.IntersectsWith ( Rectangle  rect  ) 

Returns true if this intersects another rectangle.

Parameters:
rect 
Returns:

static bool ERY.AgateLib.Geometry.Rectangle.operator== ( Rectangle  a,
Rectangle  b 
) [static]

Equality comparison test.

Parameters:
a 
b 
Returns:

static bool ERY.AgateLib.Geometry.Rectangle.operator!= ( Rectangle  a,
Rectangle  b 
) [static]

Inequality comparison test.

Parameters:
a 
b 
Returns:

override int ERY.AgateLib.Geometry.Rectangle.GetHashCode (  ) 

Gets a hash code.

Returns:

override string ERY.AgateLib.Geometry.Rectangle.ToString (  ) 

Creates a string representing this rectangle.

Returns:

override bool ERY.AgateLib.Geometry.Rectangle.Equals ( object  obj  ) 

Equality test.

Parameters:
obj 
Returns:

bool ERY.AgateLib.Geometry.Rectangle.Equals ( Rectangle  obj  ) 

Equality test.

Parameters:
obj 
Returns:

static Rectangle ERY.AgateLib.Geometry.Rectangle.Intersect ( Rectangle  a,
Rectangle  b 
) [static]

Static method returning the intersection of two rectangles.

Parameters:
a 
b 
Returns:

static Rectangle ERY.AgateLib.Geometry.Rectangle.Ceiling ( RectangleF  a  )  [static]

Rounds the coordinates in the rectangle up.

Parameters:
a 
Returns:

static Rectangle ERY.AgateLib.Geometry.Rectangle.Union ( Rectangle  a,
Rectangle  b 
) [static]

Creates a new rectangle which contains all the area of the two passed in rectangles.

Parameters:
a 
b 
Returns:

static ERY.AgateLib.Geometry.Rectangle.operator System.Drawing.Rectangle ( Rectangle  rect  )  [explicit, static]

For inter-op with System.Drawing.

Parameters:
rect 
Returns:


Member Data Documentation

Point ERY.AgateLib.Geometry.Rectangle.pt

Size ERY.AgateLib.Geometry.Rectangle.sz

readonly Rectangle ERY.AgateLib.Geometry.Rectangle.Empty = new Rectangle(0, 0, 0, 0) [static]

Empty rectangle.


Property Documentation

int ERY.AgateLib.Geometry.Rectangle.X [get, set]

X value.

int ERY.AgateLib.Geometry.Rectangle.Y [get, set]

Y value.

int ERY.AgateLib.Geometry.Rectangle.Width [get, set]

Width.

int ERY.AgateLib.Geometry.Rectangle.Height [get, set]

Height.

int ERY.AgateLib.Geometry.Rectangle.Bottom [get]

Gets bottom.

int ERY.AgateLib.Geometry.Rectangle.Left [get]

Gets left.

int ERY.AgateLib.Geometry.Rectangle.Top [get]

Gets top.

int ERY.AgateLib.Geometry.Rectangle.Right [get]

Gets right.

Point ERY.AgateLib.Geometry.Rectangle.Location [get, set]

Gets or sets top-left point.

Size ERY.AgateLib.Geometry.Rectangle.Size [get, set]

Gets or sets size.

bool ERY.AgateLib.Geometry.Rectangle.IsEmpty [get]

True if this is (0,0,0,0).


The documentation for this struct was generated from the following file:
AgateLib
Awesome Game and Tool Engine Library
SourceForge.net Logo