Otclient  14/8/2020
TRect< T > Class Template Reference

#include <rect.h>

Public Member Functions

 TRect ()
 
 TRect (T x, T y, T width, T height)
 
 TRect (const TPoint< T > &topLeft, const TPoint< T > &bottomRight)
 
 TRect (const TRect< T > &other)
 
 TRect (T x, T y, const TSize< T > &size)
 
 TRect (const TPoint< T > &topLeft, const TSize< T > &size)
 
 TRect (const TPoint< T > &topLeft, int width, int height)
 
bool isNull () const
 
bool isEmpty () const
 
bool isValid () const
 
left () const
 
top () const
 
right () const
 
bottom () const
 
horizontalCenter () const
 
verticalCenter () const
 
x () const
 
y () const
 
TPoint< T > topLeft () const
 
TPoint< T > bottomRight () const
 
TPoint< T > topRight () const
 
TPoint< T > bottomLeft () const
 
TPoint< T > topCenter () const
 
TPoint< T > bottomCenter () const
 
TPoint< T > centerLeft () const
 
TPoint< T > centerRight () const
 
TPoint< T > center () const
 
width () const
 
height () const
 
TSize< T > size () const
 
void reset ()
 
void clear ()
 
void setLeft (T pos)
 
void setTop (T pos)
 
void setRight (T pos)
 
void setBottom (T pos)
 
void setX (T x)
 
void setY (T y)
 
void setTopLeft (const TPoint< T > &p)
 
void setBottomRight (const TPoint< T > &p)
 
void setTopRight (const TPoint< T > &p)
 
void setBottomLeft (const TPoint< T > &p)
 
void setWidth (T width)
 
void setHeight (T height)
 
void setSize (const TSize< T > &size)
 
void setRect (T x, T y, T width, T height)
 
void setCoords (int left, int top, int right, int bottom)
 
void expandLeft (T add)
 
void expandTop (T add)
 
void expandRight (T add)
 
void expandBottom (T add)
 
void expand (T top, T right, T bottom, T left)
 
void expand (T add)
 
void translate (T x, T y)
 
void translate (const TPoint< T > &p)
 
void resize (const TSize< T > &size)
 
void resize (T width, T height)
 
void move (T x, T y)
 
void move (const TPoint< T > &p)
 
void moveLeft (T pos)
 
void moveTop (T pos)
 
void moveRight (T pos)
 
void moveBottom (T pos)
 
void moveTopLeft (const TPoint< T > &p)
 
void moveBottomRight (const TPoint< T > &p)
 
void moveTopRight (const TPoint< T > &p)
 
void moveBottomLeft (const TPoint< T > &p)
 
void moveTopCenter (const TPoint< T > &p)
 
void moveBottomCenter (const TPoint< T > &p)
 
void moveCenterLeft (const TPoint< T > &p)
 
void moveCenterRight (const TPoint< T > &p)
 
TRect< T > translated (int x, int y) const
 
TRect< T > translated (const TPoint< T > &p) const
 
TRect< T > expanded (T add) const
 
void moveCenter (const TPoint< T > &p)
 
void moveHorizontalCenter (T x)
 
void moveVerticalCenter (T y)
 
bool contains (const TPoint< T > &p, bool insideOnly=false) const
 
bool contains (const TRect< T > &r, bool insideOnly=false) const
 
bool intersects (const TRect< T > &r) const
 
TRect< T > united (const TRect< T > &r) const
 
TRect< T > intersection (const TRect< T > &r) const
 
void bind (const TRect< T > &r)
 
void alignIn (const TRect< T > &r, Fw::AlignmentFlag align)
 
TRect< T > & operator= (const TRect< T > &other)
 
bool operator== (const TRect< T > &other) const
 
bool operator!= (const TRect< T > &other) const
 
TRect< T > & operator|= (const TRect< T > &other)
 
TRect< T > & operator&= (const TRect< T > &other)
 

Detailed Description

template<class T>
class TRect< T >

Definition at line 37 of file rect.h.

Constructor & Destructor Documentation

◆ TRect() [1/7]

template<class T >
TRect< T >::TRect ( )
inline

Definition at line 40 of file rect.h.

◆ TRect() [2/7]

template<class T >
TRect< T >::TRect ( x,
y,
width,
height 
)
inline

Definition at line 41 of file rect.h.

◆ TRect() [3/7]

template<class T >
TRect< T >::TRect ( const TPoint< T > &  topLeft,
const TPoint< T > &  bottomRight 
)
inline

Definition at line 42 of file rect.h.

◆ TRect() [4/7]

template<class T >
TRect< T >::TRect ( const TRect< T > &  other)
inline

Definition at line 43 of file rect.h.

◆ TRect() [5/7]

template<class T >
TRect< T >::TRect ( x,
y,
const TSize< T > &  size 
)
inline

Definition at line 44 of file rect.h.

◆ TRect() [6/7]

template<class T >
TRect< T >::TRect ( const TPoint< T > &  topLeft,
const TSize< T > &  size 
)
inline

Definition at line 45 of file rect.h.

◆ TRect() [7/7]

template<class T >
TRect< T >::TRect ( const TPoint< T > &  topLeft,
int  width,
int  height 
)
inline

Definition at line 46 of file rect.h.

Member Function Documentation

◆ alignIn()

template<class T >
void TRect< T >::alignIn ( const TRect< T > &  r,
Fw::AlignmentFlag  align 
)
inline

Definition at line 287 of file rect.h.

Here is the caller graph for this function:

◆ bind()

template<class T >
void TRect< T >::bind ( const TRect< T > &  r)
inline

Definition at line 273 of file rect.h.

Here is the caller graph for this function:

◆ bottom()

template<class T >
T TRect< T >::bottom ( ) const
inline

Definition at line 55 of file rect.h.

Here is the caller graph for this function:

◆ bottomCenter()

template<class T >
TPoint<T> TRect< T >::bottomCenter ( ) const
inline

Definition at line 65 of file rect.h.

Here is the caller graph for this function:

◆ bottomLeft()

template<class T >
TPoint<T> TRect< T >::bottomLeft ( ) const
inline

Definition at line 63 of file rect.h.

Here is the caller graph for this function:

◆ bottomRight()

template<class T >
TPoint<T> TRect< T >::bottomRight ( ) const
inline

Definition at line 61 of file rect.h.

Here is the caller graph for this function:

◆ center()

template<class T >
TPoint<T> TRect< T >::center ( ) const
inline

Definition at line 68 of file rect.h.

Here is the caller graph for this function:

◆ centerLeft()

template<class T >
TPoint<T> TRect< T >::centerLeft ( ) const
inline

Definition at line 66 of file rect.h.

Here is the caller graph for this function:

◆ centerRight()

template<class T >
TPoint<T> TRect< T >::centerRight ( ) const
inline

Definition at line 67 of file rect.h.

Here is the caller graph for this function:

◆ clear()

template<class T >
void TRect< T >::clear ( )
inline

Definition at line 73 of file rect.h.

◆ contains() [1/2]

template<class T >
bool TRect< T >::contains ( const TPoint< T > &  p,
bool  insideOnly = false 
) const
inline

Definition at line 141 of file rect.h.

Here is the caller graph for this function:

◆ contains() [2/2]

template<class T >
bool TRect< T >::contains ( const TRect< T > &  r,
bool  insideOnly = false 
) const
inline

Definition at line 175 of file rect.h.

◆ expand() [1/2]

template<class T >
void TRect< T >::expand ( add)
inline

Definition at line 96 of file rect.h.

◆ expand() [2/2]

template<class T >
void TRect< T >::expand ( top,
right,
bottom,
left 
)
inline

Definition at line 95 of file rect.h.

Here is the caller graph for this function:

◆ expandBottom()

template<class T >
void TRect< T >::expandBottom ( add)
inline

Definition at line 94 of file rect.h.

◆ expanded()

template<class T >
TRect<T> TRect< T >::expanded ( add) const
inline

Definition at line 120 of file rect.h.

Here is the caller graph for this function:

◆ expandLeft()

template<class T >
void TRect< T >::expandLeft ( add)
inline

Definition at line 91 of file rect.h.

Here is the caller graph for this function:

◆ expandRight()

template<class T >
void TRect< T >::expandRight ( add)
inline

Definition at line 93 of file rect.h.

◆ expandTop()

template<class T >
void TRect< T >::expandTop ( add)
inline

Definition at line 92 of file rect.h.

Here is the caller graph for this function:

◆ height()

template<class T >
T TRect< T >::height ( ) const
inline

Definition at line 70 of file rect.h.

Here is the caller graph for this function:

◆ horizontalCenter()

template<class T >
T TRect< T >::horizontalCenter ( ) const
inline

Definition at line 56 of file rect.h.

Here is the caller graph for this function:

◆ intersection()

template<class T >
TRect<T> TRect< T >::intersection ( const TRect< T > &  r) const
inline

Definition at line 231 of file rect.h.

Here is the caller graph for this function:

◆ intersects()

template<class T >
bool TRect< T >::intersects ( const TRect< T > &  r) const
inline

Definition at line 181 of file rect.h.

Here is the caller graph for this function:

◆ isEmpty()

template<class T >
bool TRect< T >::isEmpty ( ) const
inline

Definition at line 49 of file rect.h.

Here is the caller graph for this function:

◆ isNull()

template<class T >
bool TRect< T >::isNull ( ) const
inline

Definition at line 48 of file rect.h.

Here is the caller graph for this function:

◆ isValid()

template<class T >
bool TRect< T >::isValid ( ) const
inline

Definition at line 50 of file rect.h.

Here is the caller graph for this function:

◆ left()

template<class T >
T TRect< T >::left ( ) const
inline

Definition at line 52 of file rect.h.

Here is the caller graph for this function:

◆ move() [1/2]

template<class T >
void TRect< T >::move ( const TPoint< T > &  p)
inline

Definition at line 103 of file rect.h.

◆ move() [2/2]

template<class T >
void TRect< T >::move ( x,
y 
)
inline

Definition at line 102 of file rect.h.

Here is the caller graph for this function:

◆ moveBottom()

template<class T >
void TRect< T >::moveBottom ( pos)
inline

Definition at line 107 of file rect.h.

Here is the caller graph for this function:

◆ moveBottomCenter()

template<class T >
void TRect< T >::moveBottomCenter ( const TPoint< T > &  p)
inline

Definition at line 113 of file rect.h.

Here is the caller graph for this function:

◆ moveBottomLeft()

template<class T >
void TRect< T >::moveBottomLeft ( const TPoint< T > &  p)
inline

Definition at line 111 of file rect.h.

Here is the caller graph for this function:

◆ moveBottomRight()

template<class T >
void TRect< T >::moveBottomRight ( const TPoint< T > &  p)
inline

Definition at line 109 of file rect.h.

Here is the caller graph for this function:

◆ moveCenter()

template<class T >
void TRect< T >::moveCenter ( const TPoint< T > &  p)
inline

Definition at line 122 of file rect.h.

Here is the caller graph for this function:

◆ moveCenterLeft()

template<class T >
void TRect< T >::moveCenterLeft ( const TPoint< T > &  p)
inline

Definition at line 114 of file rect.h.

Here is the caller graph for this function:

◆ moveCenterRight()

template<class T >
void TRect< T >::moveCenterRight ( const TPoint< T > &  p)
inline

Definition at line 115 of file rect.h.

Here is the caller graph for this function:

◆ moveHorizontalCenter()

template<class T >
void TRect< T >::moveHorizontalCenter ( x)
inline

Definition at line 130 of file rect.h.

Here is the caller graph for this function:

◆ moveLeft()

template<class T >
void TRect< T >::moveLeft ( pos)
inline

Definition at line 104 of file rect.h.

Here is the caller graph for this function:

◆ moveRight()

template<class T >
void TRect< T >::moveRight ( pos)
inline

Definition at line 106 of file rect.h.

Here is the caller graph for this function:

◆ moveTop()

template<class T >
void TRect< T >::moveTop ( pos)
inline

Definition at line 105 of file rect.h.

Here is the caller graph for this function:

◆ moveTopCenter()

template<class T >
void TRect< T >::moveTopCenter ( const TPoint< T > &  p)
inline

Definition at line 112 of file rect.h.

Here is the caller graph for this function:

◆ moveTopLeft()

template<class T >
void TRect< T >::moveTopLeft ( const TPoint< T > &  p)
inline

Definition at line 108 of file rect.h.

Here is the caller graph for this function:

◆ moveTopRight()

template<class T >
void TRect< T >::moveTopRight ( const TPoint< T > &  p)
inline

Definition at line 110 of file rect.h.

Here is the caller graph for this function:

◆ moveVerticalCenter()

template<class T >
void TRect< T >::moveVerticalCenter ( y)
inline

Definition at line 135 of file rect.h.

Here is the caller graph for this function:

◆ operator!=()

template<class T >
bool TRect< T >::operator!= ( const TRect< T > &  other) const
inline

Definition at line 310 of file rect.h.

◆ operator&=()

template<class T >
TRect<T>& TRect< T >::operator&= ( const TRect< T > &  other)
inline

Definition at line 313 of file rect.h.

◆ operator=()

template<class T >
TRect<T>& TRect< T >::operator= ( const TRect< T > &  other)
inline

Definition at line 308 of file rect.h.

◆ operator==()

template<class T >
bool TRect< T >::operator== ( const TRect< T > &  other) const
inline

Definition at line 309 of file rect.h.

◆ operator|=()

template<class T >
TRect<T>& TRect< T >::operator|= ( const TRect< T > &  other)
inline

Definition at line 312 of file rect.h.

◆ reset()

template<class T >
void TRect< T >::reset ( )
inline

Definition at line 72 of file rect.h.

◆ resize() [1/2]

template<class T >
void TRect< T >::resize ( const TSize< T > &  size)
inline

Definition at line 100 of file rect.h.

Here is the caller graph for this function:

◆ resize() [2/2]

template<class T >
void TRect< T >::resize ( width,
height 
)
inline

Definition at line 101 of file rect.h.

◆ right()

template<class T >
T TRect< T >::right ( ) const
inline

Definition at line 54 of file rect.h.

Here is the caller graph for this function:

◆ setBottom()

template<class T >
void TRect< T >::setBottom ( pos)
inline

Definition at line 78 of file rect.h.

Here is the caller graph for this function:

◆ setBottomLeft()

template<class T >
void TRect< T >::setBottomLeft ( const TPoint< T > &  p)
inline

Definition at line 84 of file rect.h.

◆ setBottomRight()

template<class T >
void TRect< T >::setBottomRight ( const TPoint< T > &  p)
inline

Definition at line 82 of file rect.h.

◆ setCoords()

template<class T >
void TRect< T >::setCoords ( int  left,
int  top,
int  right,
int  bottom 
)
inline

Definition at line 89 of file rect.h.

◆ setHeight()

template<class T >
void TRect< T >::setHeight ( height)
inline

Definition at line 86 of file rect.h.

Here is the caller graph for this function:

◆ setLeft()

template<class T >
void TRect< T >::setLeft ( pos)
inline

Definition at line 75 of file rect.h.

Here is the caller graph for this function:

◆ setRect()

template<class T >
void TRect< T >::setRect ( x,
y,
width,
height 
)
inline

Definition at line 88 of file rect.h.

Here is the caller graph for this function:

◆ setRight()

template<class T >
void TRect< T >::setRight ( pos)
inline

Definition at line 77 of file rect.h.

Here is the caller graph for this function:

◆ setSize()

template<class T >
void TRect< T >::setSize ( const TSize< T > &  size)
inline

Definition at line 87 of file rect.h.

◆ setTop()

template<class T >
void TRect< T >::setTop ( pos)
inline

Definition at line 76 of file rect.h.

Here is the caller graph for this function:

◆ setTopLeft()

template<class T >
void TRect< T >::setTopLeft ( const TPoint< T > &  p)
inline

Definition at line 81 of file rect.h.

◆ setTopRight()

template<class T >
void TRect< T >::setTopRight ( const TPoint< T > &  p)
inline

Definition at line 83 of file rect.h.

◆ setWidth()

template<class T >
void TRect< T >::setWidth ( width)
inline

Definition at line 85 of file rect.h.

Here is the caller graph for this function:

◆ setX()

template<class T >
void TRect< T >::setX ( x)
inline

Definition at line 79 of file rect.h.

Here is the caller graph for this function:

◆ setY()

template<class T >
void TRect< T >::setY ( y)
inline

Definition at line 80 of file rect.h.

Here is the caller graph for this function:

◆ size()

template<class T >
TSize<T> TRect< T >::size ( ) const
inline

Definition at line 71 of file rect.h.

Here is the caller graph for this function:

◆ top()

template<class T >
T TRect< T >::top ( ) const
inline

Definition at line 53 of file rect.h.

Here is the caller graph for this function:

◆ topCenter()

template<class T >
TPoint<T> TRect< T >::topCenter ( ) const
inline

Definition at line 64 of file rect.h.

Here is the caller graph for this function:

◆ topLeft()

template<class T >
TPoint<T> TRect< T >::topLeft ( ) const
inline

Definition at line 60 of file rect.h.

Here is the caller graph for this function:

◆ topRight()

template<class T >
TPoint<T> TRect< T >::topRight ( ) const
inline

Definition at line 62 of file rect.h.

Here is the caller graph for this function:

◆ translate() [1/2]

template<class T >
void TRect< T >::translate ( const TPoint< T > &  p)
inline

Definition at line 99 of file rect.h.

◆ translate() [2/2]

template<class T >
void TRect< T >::translate ( x,
y 
)
inline

Definition at line 98 of file rect.h.

Here is the caller graph for this function:

◆ translated() [1/2]

template<class T >
TRect<T> TRect< T >::translated ( const TPoint< T > &  p) const
inline

Definition at line 118 of file rect.h.

◆ translated() [2/2]

template<class T >
TRect<T> TRect< T >::translated ( int  x,
int  y 
) const
inline

Definition at line 117 of file rect.h.

◆ united()

template<class T >
TRect<T> TRect< T >::united ( const TRect< T > &  r) const
inline

Definition at line 222 of file rect.h.

Here is the caller graph for this function:

◆ verticalCenter()

template<class T >
T TRect< T >::verticalCenter ( ) const
inline

Definition at line 57 of file rect.h.

Here is the caller graph for this function:

◆ width()

template<class T >
T TRect< T >::width ( ) const
inline

Definition at line 69 of file rect.h.

Here is the caller graph for this function:

◆ x()

template<class T >
T TRect< T >::x ( ) const
inline

Definition at line 58 of file rect.h.

Here is the caller graph for this function:

◆ y()

template<class T >
T TRect< T >::y ( ) const
inline

Definition at line 59 of file rect.h.

Here is the caller graph for this function:

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