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)
 Constructs 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 Rectangle Parse (string text)
 Parses a string for a rectangle.
static bool TryParse (string text, out Rectangle value)
 Parses a string for a rectangle.
static bool FindValue (string text, string name, out int value)
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

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

Constructs a rectangle.

Parameters:
x 
y 
width 
height 

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

Constructs a rectangle.

Parameters:
pt 
sz 

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 AgateLib.Geometry.Rectangle.Ceiling ( RectangleF  a  )  [static]

Rounds the coordinates in the rectangle up.

Parameters:
a 
Returns:

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

Returns true if the rectangle entirely contains the specified rectangle.

Parameters:
rect 
Returns:

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

Returns true if the rectangle contains the specified point.

Parameters:
pt 
Returns:

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

Returns true if the rectangle contains the specified point.

Parameters:
x 
y 
Returns:

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

Equality test.

Parameters:
obj 
Returns:

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

Equality test.

Parameters:
obj 
Returns:

static Rectangle 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:

override int AgateLib.Geometry.Rectangle.GetHashCode (  ) 

Gets a hash code.

Returns:

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

Static method returning the intersection of two rectangles.

Parameters:
a 
b 
Returns:

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

Returns true if this intersects another rectangle.

Parameters:
rect 
Returns:

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

For inter-op with System.Drawing.

Parameters:
rect 
Returns:

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

Inequality comparison test.

Parameters:
a 
b 
Returns:

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

Equality comparison test.

Parameters:
a 
b 
Returns:

static Rectangle AgateLib.Geometry.Rectangle.Parse ( string  text  )  [static]

Parses a string for a rectangle.

Parameters:
text 
Returns:

override string AgateLib.Geometry.Rectangle.ToString (  ) 

Creates a string representing this rectangle.

Returns:

static bool AgateLib.Geometry.Rectangle.TryParse ( string  text,
out Rectangle  value 
) [static]

Parses a string for a rectangle.

Parameters:
text 
value 
Returns:

static Rectangle 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:


Member Data Documentation

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

Empty rectangle.


Property Documentation

int AgateLib.Geometry.Rectangle.Bottom [get]

Gets bottom.

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

Height.

bool AgateLib.Geometry.Rectangle.IsEmpty [get]

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

int AgateLib.Geometry.Rectangle.Left [get]

Gets left.

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

Gets or sets top-left point.

int AgateLib.Geometry.Rectangle.Right [get]

Gets right.

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

Gets or sets size.

int AgateLib.Geometry.Rectangle.Top [get]

Gets top.

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

Width.

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

X value.

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

Y value.


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