2013-05-18 17:44:15 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* Rectangle.h *
|
|
|
|
* *
|
2013-07-12 21:30:13 +02:00
|
|
|
* XFX::Rectangle structure definition file *
|
2013-05-18 17:44:15 +02:00
|
|
|
* Copyright (c) XFX Team. All Rights Reserved *
|
|
|
|
*****************************************************************************/
|
2013-05-05 18:18:41 +02:00
|
|
|
#ifndef _XFX_RECTANGLE_
|
|
|
|
#define _XFX_RECTANGLE_
|
|
|
|
|
|
|
|
#include <System/Interfaces.h>
|
|
|
|
#include <System/Types.h>
|
|
|
|
|
|
|
|
using namespace System;
|
|
|
|
|
|
|
|
namespace XFX
|
|
|
|
{
|
|
|
|
struct Point;
|
|
|
|
|
2013-07-12 21:30:13 +02:00
|
|
|
/**
|
|
|
|
* Defines a rectangle.
|
|
|
|
*/
|
2013-05-05 18:18:41 +02:00
|
|
|
struct Rectangle : IEquatable<Rectangle>, Object
|
|
|
|
{
|
2013-07-12 21:30:13 +02:00
|
|
|
/**
|
|
|
|
* Returns the y-coordinate of the bottom of the rectangle.
|
|
|
|
*/
|
|
|
|
int Bottom();
|
|
|
|
/**
|
|
|
|
* Returns a Rectangle with all of its values set to zero.
|
|
|
|
*/
|
|
|
|
static const Rectangle Empty;
|
|
|
|
/**
|
|
|
|
* Returns the x-coordinate of the left side of the rectangle.
|
|
|
|
*/
|
|
|
|
int Left();
|
|
|
|
/**
|
|
|
|
* Returns the x-coordinate of the right side of the rectangle.
|
|
|
|
*/
|
|
|
|
int Right();
|
|
|
|
/**
|
|
|
|
* Returns the y-coordinate of the top of the rectangle.
|
|
|
|
*/
|
|
|
|
int Top();
|
|
|
|
/**
|
|
|
|
* Specifies the height of the rectangle.
|
|
|
|
*/
|
|
|
|
int Height;
|
|
|
|
/**
|
|
|
|
* Specifies the width of the rectangle.
|
|
|
|
*/
|
|
|
|
int Width;
|
|
|
|
/**
|
|
|
|
* Specifies the x-coordinate of the rectangle.
|
|
|
|
*/
|
|
|
|
int X;
|
|
|
|
/**
|
|
|
|
* Specifies the y-coordinate of the rectangle.
|
|
|
|
*/
|
|
|
|
int Y;
|
2013-05-05 18:18:41 +02:00
|
|
|
|
|
|
|
Rectangle(const int x, const int y, const int width, const int height);
|
|
|
|
Rectangle(const Rectangle &obj);
|
|
|
|
Rectangle();
|
|
|
|
|
|
|
|
bool Contains(int x, int y);
|
|
|
|
bool Contains(Point pt);
|
2013-05-18 17:44:15 +02:00
|
|
|
void Contains(Point pt, out bool& result);
|
2013-05-05 18:18:41 +02:00
|
|
|
bool Contains(Rectangle other);
|
2013-05-18 17:44:15 +02:00
|
|
|
void Contains(Rectangle other, out bool& result);
|
|
|
|
bool Equals(Object const * const obj) const;
|
2013-05-05 18:18:41 +02:00
|
|
|
bool Equals(const Rectangle obj) const;
|
2013-05-18 17:44:15 +02:00
|
|
|
int GetHashCode() const;
|
2013-07-12 21:30:13 +02:00
|
|
|
static const Type& GetType();
|
2013-05-05 18:18:41 +02:00
|
|
|
void Inflate(int horizontalAmount, int verticalAmount);
|
|
|
|
bool Intersects(Rectangle other);
|
2013-05-18 17:44:15 +02:00
|
|
|
void Intersects(Rectangle other, out bool& result);
|
2013-05-05 18:18:41 +02:00
|
|
|
void Offset(int x, int y);
|
|
|
|
void Offset(Point pt);
|
2013-05-18 17:44:15 +02:00
|
|
|
const char* ToString();
|
2013-05-05 18:18:41 +02:00
|
|
|
|
|
|
|
bool operator==(const Rectangle& other) const;
|
|
|
|
bool operator!=(const Rectangle& other) const;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-07-12 21:30:13 +02:00
|
|
|
#endif //_XFX_RECTANGLE_
|