GUIDOLib
1.7.7
Guido Engine Internal Documentation
|
33 TRect( T inLeft, T inTop, T inRight, T inBottom )
36 void Set( T inLeft, T inTop, T inRight, T inBottom )
39 void SetValid( T inLeft, T inTop, T inRight, T inBottom )
41 if (inLeft > inRight) {
47 if (inTop > inBottom) {
95 template <
typename S>
bool operator == (
const S & inRect )
const 97 return ( (
left == inRect.left)
98 && (
right == inRect.right)
99 && (
top == inRect.top)
100 && (
bottom == inRect.bottom) );
105 template <
typename S>
bool operator < (
const S & inRect )
const 107 return ( (
left <= inRect.left)
108 && (
top < inRect.top) );
126 template <
typename S>
bool Contains(
const S & inVector )
const 128 return (inVector.x >=
left && inVector.x <
right &&
129 inVector.y >=
top && inVector.y <
bottom );
141 return (inX >=
left && inX < right && inY >=
top && inY <
bottom );
145 template <
typename S>
bool Collides(
const S & inRect )
const 147 return (( inRect.left <
right ) && ( inRect.right >
left )
148 && ( inRect.top <
bottom ) && ( inRect.bottom >
top ));
152 template <
typename S>
void Merge(
const S & inRect )
154 if( inRect.Width() <= 0 || inRect.Height() <= 0 )
return;
158 if( inRect.left <
left )
left = inRect.left;
159 if( inRect.right >
right )
right = inRect.right;
160 if( inRect.top <
top )
top = inRect.top;
166 template <
typename S>
void Intersect(
const S & inRect )
168 if( inRect.left >
left )
left = inRect.left;
169 if( inRect.right <
right )
right = inRect.right;
170 if( inRect.top >
top )
top = inRect.top;
187 if( y <
top ) deltaY =
top - y;
190 return ((deltaX * deltaX) + (deltaY * deltaY));
197 template<
typename T> std::ostream&
operator<< (std::ostream& os,
const TRect<T>& r) { r.
print(os);
return os; }
void Expand(T val)
Definition: TRect.h:79
void ShiftY(T inOffset)
Definition: TRect.h:76
void GetPos(T *x, T *y)
Definition: TRect.h:70
TRect< T > & operator+=(const S &inVector)
Definition: TRect.h:85
TRect(T inLeft, T inTop, T inRight, T inBottom)
Definition: TRect.h:33
bool Contains(T inX, T inY) const
Definition: TRect.h:139
TRect()
Definition: TRect.h:32
bool IsValid() const
Definition: TRect.h:58
bool Contains(const TRect< T > &in) const
Definition: TRect.h:133
void CalcMiddle(T *oX, T *oY)
Definition: TRect.h:119
T DistanceToPoint(T x, T y)
Definition: TRect.h:180
bool operator==(const S &inRect) const
Definition: TRect.h:95
void SetXPos(T inXPos)
Definition: TRect.h:67
void GetPos(T *x1, T *y1, T *x2, T *y2)
Definition: TRect.h:73
bool operator<(const S &inRect) const
Definition: TRect.h:105
void SetYPos(T inYPos)
Definition: TRect.h:68
void Scale(T x, T y)
Definition: TRect.h:78
void Merge(const S &inRect)
Definition: TRect.h:152
void Magnify(float ratio)
Definition: TRect.h:80
void Intersect(const S &inRect)
Definition: TRect.h:166
void Set(T inLeft, T inTop, T inRight, T inBottom)
Definition: TRect.h:36
void print(std::ostream &os) const
Definition: TRect.h:194
void SetPos(T x, T y)
Definition: TRect.h:66
void Zoom(T offset)
Definition: TRect.h:81
void SetValid(T inLeft, T inTop, T inRight, T inBottom)
Definition: TRect.h:39
void ShiftX(T inOffset)
Definition: TRect.h:75
void SetHeight(T in)
Definition: TRect.h:64
bool Collides(const S &inRect) const
Definition: TRect.h:145
void GetYPos(T *inYPos)
Definition: TRect.h:72
T left
Definition: TRect.h:27
bool Contains(const S &inVector) const
Definition: TRect.h:126
void SetDims(T inWidth, T inHeight)
Definition: TRect.h:62
void SetWidth(T in)
Definition: TRect.h:63
T Width() const
Definition: TRect.h:59
void Shift(T x, T y)
Definition: TRect.h:77
T right
Definition: TRect.h:29
T bottom
Definition: TRect.h:30
std::ostream & operator<<(std::ostream &os, const svgendl &eol)
T top
Definition: TRect.h:28
void Set(const TRect &in)
Definition: TRect.h:55
void GetXPos(T *inXPos)
Definition: TRect.h:71
T Height() const
Definition: TRect.h:60
void CalcMiddle(S *outVector)
Definition: TRect.h:112