49 template<
typename NumType>
86 RectBase(
const NumType RectLeft,
const NumType RectTop,
const NumType RectRight,
const NumType RectBottom) :
112 void SetValues(
const NumType RectLeft,
const NumType RectTop,
const NumType RectRight,
const NumType RectBottom)
114 this->Left = RectLeft;
116 this->Right = RectRight;
117 this->Bottom = RectBottom;
125 this->Left = std::max(NumType(0),this->Left);
126 this->Top = std::max(NumType(0),this->Top);
127 this->Right = std::min(Width,this->Right);
128 this->Bottom = std::min(Height,this->Bottom);
134 {
return this->Right - this->
Left; }
138 {
return this->Bottom - this->
Top; }
147 this->Left = Other.
Left;
148 this->Top = Other.
Top;
149 this->Right = Other.
Right;
150 this->Bottom = Other.
Bottom;
157 {
return ( this->Left == Other.
Left && this->Top == Other.
Top && this->Right == Other.
Right && this->Bottom == Other.
Bottom ); }
162 {
return ( this->Left != Other.
Left || this->Top != Other.
Top || this->Right != Other.
Right || this->Bottom != Other.
Bottom ); }
RectBase< Whole > WholeRect
Convenience type for a Rect using Whole numbers.
RectBase(const NumType RectLeft, const NumType RectTop, const NumType RectRight, const NumType RectBottom)
Descriptive constructor.
bool Boole
Generally acts a single bit, true or false.
void SetValues(const NumType RectLeft, const NumType RectTop, const NumType RectRight, const NumType RectBottom)
Sets the value of each member of this Rect.
void SetZero()
Sets all values of this Rect to zero.
RectBase()
Blank constructor.
All the definitions for datatypes as well as some basic conversion functions are defined here...
Boole operator==(const SelfType &Other)
Equality Operator.
NumType GetWidth() const
Gets the width of this Rect.
RectBase< Real > RealRect
Convenience type for a Rect using Real numbers.
Boole operator!=(const SelfType &Other)
Inequality Operator.
~RectBase()
Class destructor.
NumType Bottom
The Bottom edge of the rect.
void operator=(const SelfType &Other)
Assignment Operator.
NumType Right
The Right edge of the rect.
RectBase< NumType > SelfType
Convenience typedef for describing the type you are working with.
NumType Left
The Left edge of the rect.
A class for tracking a rectangle by tracking two corners Top, Left and Right, Bottom.
void ClampToSize(const NumType Width, const NumType Height)
Clamps the position and size of this Rect to the provided size.
The bulk of the engine components go in this namspace.
NumType Top
The Top edge of the rect.
NumType GetHeight() const
Gets the height of this Rect.