My Project
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
TriangleNet.Geometry.Rectangle Class Reference

A simple rectangle class. More...

Public Member Functions

 Rectangle ()
 Initializes a new instance of the Rectangle class.
 
 Rectangle (Rectangle other)
 
 Rectangle (float x, float y, float width, float height)
 Initializes a new instance of the Rectangle class with predefined bounds.
 
void Resize (float dx, float dy)
 Update bounds.
 
void Expand (Point p)
 Expand rectangle to include given point.
 
void Expand (IEnumerable< Point > points)
 Expand rectangle to include a list of points.
 
void Expand (Rectangle other)
 Expand rectangle to include given rectangle.
 
bool Contains (float x, float y)
 Check if given point is inside rectangle.
 
bool Contains (Point pt)
 Check if given point is inside rectangle.
 
bool Contains (Rectangle other)
 Check if this rectangle contains other rectangle.
 
bool Intersects (Rectangle other)
 Check if this rectangle intersects other rectangle.
 

Properties

float Left [get]
 Gets the minimum x value (left boundary).
 
float Right [get]
 Gets the maximum x value (right boundary).
 
float Bottom [get]
 Gets the minimum y value (bottom boundary).
 
float Top [get]
 Gets the maximum y value (top boundary).
 
float Width [get]
 Gets the width of the rectangle.
 
float Height [get]
 Gets the height of the rectangle.
 

Detailed Description

A simple rectangle class.

Constructor & Destructor Documentation

◆ Rectangle()

TriangleNet.Geometry.Rectangle.Rectangle ( float  x,
float  y,
float  width,
float  height 
)
inline

Initializes a new instance of the Rectangle class with predefined bounds.

Parameters
xMinimum x value (left).
yMinimum y value (bottom).
widthWidth of the rectangle.
heightHeight of the rectangle.

Member Function Documentation

◆ Contains() [1/3]

bool TriangleNet.Geometry.Rectangle.Contains ( float  x,
float  y 
)
inline

Check if given point is inside rectangle.

Parameters
xPoint to check.
yPoint to check.
Returns
Return true, if rectangle contains given point.

◆ Contains() [2/3]

bool TriangleNet.Geometry.Rectangle.Contains ( Point  pt)
inline

Check if given point is inside rectangle.

Parameters
ptPoint to check.
Returns
Return true, if rectangle contains given point.

◆ Contains() [3/3]

bool TriangleNet.Geometry.Rectangle.Contains ( Rectangle  other)
inline

Check if this rectangle contains other rectangle.

Parameters
otherRectangle to check.
Returns
Return true, if this rectangle contains given rectangle.

◆ Expand() [1/2]

void TriangleNet.Geometry.Rectangle.Expand ( Point  p)
inline

Expand rectangle to include given point.

Parameters
pPoint.

◆ Expand() [2/2]

void TriangleNet.Geometry.Rectangle.Expand ( Rectangle  other)
inline

Expand rectangle to include given rectangle.

Parameters
xX coordinate.
yY coordinate.

◆ Intersects()

bool TriangleNet.Geometry.Rectangle.Intersects ( Rectangle  other)
inline

Check if this rectangle intersects other rectangle.

Parameters
otherRectangle to check.
Returns
Return true, if given rectangle intersects this rectangle.

◆ Resize()

void TriangleNet.Geometry.Rectangle.Resize ( float  dx,
float  dy 
)
inline

Update bounds.

Parameters
dxAdd dx to left and right bounds.
dyAdd dy to top and bottom bounds.

The documentation for this class was generated from the following file: