Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cRectNT< TYPE > Class Template Reference

#include <cRectT.h>

Inheritance diagram for GrayLib::cRectNT< TYPE >:
GrayLib::cRectT< TYPE >

Public Member Functions

 cRectNT () noexcept
 
 cRectNT (TYPE x1, TYPE y1, TYPE x2, TYPE y2) noexcept
 
 cRectNT (const SUPER_t &rect) noexcept
 
TYPE get_X () const noexcept
 
TYPE X () const noexcept
 
TYPE get_Y () const noexcept
 
TYPE Y () const noexcept
 
TYPE get_Width () const noexcept
 
TYPE Width () const noexcept
 
TYPE get_Height () const noexcept
 
TYPE Height () const noexcept
 
TYPE get_Radius () const noexcept
 
bool IsRectEmpty () const noexcept
 
void SetLT (TYPE nLeft2, TYPE nTop2) noexcept
 
void SetWidth (TYPE cx) noexcept
 
void SetHeight (TYPE cy) noexcept
 
void SetWH (TYPE nWidth=0, TYPE nHeight=0) noexcept
 
void InflateRectX (TYPE dx) noexcept
 
void InflateRectY (TYPE dy) noexcept
 
void InflateRectBoth (TYPE dx, TYPE dy) noexcept
 
void UnionRect (const THIS_t &rect) noexcept
 
void UnionRectE (const THIS_t &rect) noexcept
 
bool IntersectRect (const THIS_t &rect) noexcept
 
void RectClamp (TYPE cx=(TYPE) INT_MAX, TYPE cy=(TYPE) INT_MAX) noexcept
 
void NormalizeRectClamp (TYPE cx=(TYPE) INT_MAX, TYPE cy=(TYPE) INT_MAX) noexcept
 
- Public Member Functions inherited from GrayLib::cRectT< TYPE >
 cRectT () noexcept
 
 cRectT (TYPE x1, TYPE y1, TYPE x2, TYPE y2) noexcept
 
 cRectT (const THIS_t &rect) noexcept
 
TYPE get_DiffX () const noexcept
 
TYPE get_DiffY () const noexcept
 
cVecT2< TYPEget_Center () const noexcept
 
float get_AspectRatio () const noexcept
 
bool IsEqual (const THIS_t &rect) const noexcept
 
bool operator== (const THIS_t &rect) const noexcept
 
bool operator!= (const THIS_t &rect) const noexcept
 
bool isRectNull () const noexcept
 
bool isRectNormal () const noexcept
 
bool isRectNormalE () const noexcept
 
bool IsInRangeX (TYPE value) const noexcept
 
bool IsInRangeY (TYPE value) const noexcept
 
void SetRectNull () noexcept
 
void SetRectWH (TYPE nLeft, TYPE nTop, TYPE nWidth, TYPE nHeight) noexcept
 
void SetRectEmptyX () noexcept
 
void SetRect4 (TYPE nLeft, TYPE nTop, TYPE nRight, TYPE nBottom) noexcept
 
void SetRectAsPt (TYPE x, TYPE y) noexcept
 
void SetRectAsPt (const POINT_t &pt) noexcept
 
void SetRectFromSphere (TYPE x, TYPE y, TYPE nRadius) noexcept
 
HRESULT SetRectAsStr (const char *pszStr)
 
void OffsetRectX (TYPE dx) noexcept
 
void OffsetRectY (TYPE dy) noexcept
 
void OffsetRect (TYPE dx, TYPE dy) noexcept
 
void UnionX (TYPE x) noexcept
 
void UnionY (TYPE y) noexcept
 
void Union2 (TYPE x, TYPE y) noexcept
 
void Union4 (const THIS_t &rect) noexcept
 
void ScrollInRangeX (TYPE value) noexcept
 
void ScrollInRangeY (TYPE value)
 
void SetRectNotEmpty (TYPE iMin=10) noexcept
 
void ScaleX (float mx) noexcept
 
void ScaleY (float my) noexcept
 
void Scale (float mx, float my) noexcept
 
void AddScaleY () noexcept
 
void NormalizeRect () noexcept
 

Additional Inherited Members

- Public Types inherited from GrayLib::cRectT< TYPE >
typedef TYPE DVALUE_t
 Dimension value type. More...
 
- Public Attributes inherited from GrayLib::cRectT< TYPE >
TYPE left
 
TYPE top
 
TYPE right
 
TYPE bottom
 

Detailed Description

template<typename TYPE>
class GrayLib::cRectNT< TYPE >

a normalized 2d rectangle of arbitrary TYPE units. common rectangle functions that are inclusive OR non-inclusive. (float/int) ASSUME N = Normalized = Left,Top less than Right,Bottom

Constructor & Destructor Documentation

◆ cRectNT() [1/3]

template<typename TYPE >
GrayLib::cRectNT< TYPE >::cRectNT ( )
inlinenoexcept

◆ cRectNT() [2/3]

template<typename TYPE >
GrayLib::cRectNT< TYPE >::cRectNT ( TYPE  x1,
TYPE  y1,
TYPE  x2,
TYPE  y2 
)
inlinenoexcept

◆ cRectNT() [3/3]

template<typename TYPE >
GrayLib::cRectNT< TYPE >::cRectNT ( const SUPER_t rect)
inlinenoexcept

Member Function Documentation

◆ get_Height()

template<typename TYPE >
TYPE GrayLib::cRectNT< TYPE >::get_Height ( void  ) const
inlinenoexcept

◆ get_Radius()

template<typename TYPE >
TYPE GrayLib::cRectNT< TYPE >::get_Radius ( ) const
inlinenoexcept

◆ get_Width()

template<typename TYPE >
TYPE GrayLib::cRectNT< TYPE >::get_Width ( ) const
inlinenoexcept

◆ get_X()

template<typename TYPE >
TYPE GrayLib::cRectNT< TYPE >::get_X ( ) const
inlinenoexcept

◆ get_Y()

template<typename TYPE >
TYPE GrayLib::cRectNT< TYPE >::get_Y ( ) const
inlinenoexcept

◆ Height()

template<typename TYPE >
TYPE GrayLib::cRectNT< TYPE >::Height ( ) const
inlinenoexcept

◆ InflateRectBoth()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::InflateRectBoth ( TYPE  dx,
TYPE  dy 
)
inlinenoexcept

Normal InflateRect() does not move the top and left. This does. ASSUME normalized!

◆ InflateRectX()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::InflateRectX ( TYPE  dx)
inlinenoexcept

◆ InflateRectY()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::InflateRectY ( TYPE  dy)
inlinenoexcept

◆ IntersectRect()

template<typename TYPE >
bool GrayLib::cRectNT< TYPE >::IntersectRect ( const THIS_t rect)
inlinenoexcept

Shrink this rectangle to be the overlap of the 2. (if anything) ASSUME: Normalized rectangle

Returns
true = rectangle is not empty. They do intersect.

◆ IsRectEmpty()

template<typename TYPE >
bool GrayLib::cRectNT< TYPE >::IsRectEmpty ( ) const
inlinenoexcept

MFC compatible. isRectNull()

◆ NormalizeRectClamp()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::NormalizeRectClamp ( TYPE  cx = (TYPE)INT_MAX,
TYPE  cy = (TYPE)INT_MAX 
)
inlinenoexcept

◆ RectClamp()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::RectClamp ( TYPE  cx = (TYPE)INT_MAX,
TYPE  cy = (TYPE)INT_MAX 
)
inlinenoexcept

limit the rectangle to a certain size.

◆ SetHeight()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::SetHeight ( TYPE  cy)
inlinenoexcept

◆ SetLT()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::SetLT ( TYPE  nLeft2,
TYPE  nTop2 
)
inlinenoexcept

Set LT (left,top) but leave the size.

◆ SetWH()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::SetWH ( TYPE  nWidth = 0,
TYPE  nHeight = 0 
)
inlinenoexcept

SetWidthHeight Adjust WH but leave the LT.

◆ SetWidth()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::SetWidth ( TYPE  cx)
inlinenoexcept

◆ UnionRect()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::UnionRect ( const THIS_t rect)
inlinenoexcept

Inflate this rect to include both rectangles (or points if empty rects). ASSUME: Normalized rect

◆ UnionRectE()

template<typename TYPE >
void GrayLib::cRectNT< TYPE >::UnionRectE ( const THIS_t rect)
inlinenoexcept

Inflate this rect to include both rectangles (ignore empty rects). ASSUME: Normalized rect

◆ Width()

template<typename TYPE >
TYPE GrayLib::cRectNT< TYPE >::Width ( ) const
inlinenoexcept

◆ X()

template<typename TYPE >
TYPE GrayLib::cRectNT< TYPE >::X ( ) const
inlinenoexcept

◆ Y()

template<typename TYPE >
TYPE GrayLib::cRectNT< TYPE >::Y ( ) const
inlinenoexcept

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