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

#include <cRectT.h>

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

Public Member Functions

 cRectFT (TYPE nleft=0, TYPE ntop=0, TYPE nright=0, TYPE nbottom=0) noexcept
 
 cRectFT (const POINT_t &ptCenter, TYPE nSizeX=0, TYPE nSizeY=0) noexcept
 
 cRectFT (const SUPER_t &rect) noexcept
 
bool IsInsideX (TYPE x) const noexcept
 
bool IsInsideY (TYPE y) const noexcept
 
bool PtInRect (TYPE x, TYPE y) const noexcept
 
bool PtInRect (const POINT_t &pt) const noexcept
 
bool IsInsideMe (const RECT_t &rect) const
 
bool IsOverlapped (const RECT_t &rect) const
 
bool ClampPtInRect (OUT POINT_t &pt) const
 
void UnionPoint (TYPE x, TYPE y)
 
cString get_RectStr (void) const
 
ITERATE_t v_SetRect (const cVariant &vVal)
 
void v_GetRect (cVariant &vVal) const
 
- Public Member Functions inherited from GrayLib::cRectNT< float >
 cRectNT () noexcept
 
 cRectNT (float x1, float y1, float x2, float y2) noexcept
 
 cRectNT (const SUPER_t &rect) noexcept
 
float get_X () const noexcept
 
float X () const noexcept
 
float get_Y () const noexcept
 
float Y () const noexcept
 
float get_Width () const noexcept
 
float Width () const noexcept
 
float get_Height () const noexcept
 
float Height () const noexcept
 
float get_Radius () const noexcept
 
bool IsRectEmpty () const noexcept
 
void SetLT (float nLeft2, float nTop2) noexcept
 
void SetWidth (float cx) noexcept
 
void SetHeight (float cy) noexcept
 
void SetWH (float nWidth=0, float nHeight=0) noexcept
 
void InflateRectX (float dx) noexcept
 
void InflateRectY (float dy) noexcept
 
void InflateRectBoth (float dx, float 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 (float cx=(float) INT_MAX, float cy=(float) INT_MAX) noexcept
 
void NormalizeRectClamp (float cx=(float) INT_MAX, float cy=(float) 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 = float>
class GrayLib::cRectFT< TYPE >

float TYPE normalized rectangle. Same order and basic element sizing as _WIN32 RECT and MFC CRect based on _WIN32 RECT and MFC CRect

Constructor & Destructor Documentation

◆ cRectFT() [1/3]

template<typename TYPE = float>
GrayLib::cRectFT< TYPE >::cRectFT ( TYPE  nleft = 0,
TYPE  ntop = 0,
TYPE  nright = 0,
TYPE  nbottom = 0 
)
inlinenoexcept

◆ cRectFT() [2/3]

template<typename TYPE = float>
GrayLib::cRectFT< TYPE >::cRectFT ( const POINT_t ptCenter,
TYPE  nSizeX = 0,
TYPE  nSizeY = 0 
)
inlinenoexcept

◆ cRectFT() [3/3]

template<typename TYPE = float>
GrayLib::cRectFT< TYPE >::cRectFT ( const SUPER_t rect)
inlinenoexcept

Member Function Documentation

◆ ClampPtInRect()

template<typename TYPE = float>
bool GrayLib::cRectFT< TYPE >::ClampPtInRect ( OUT POINT_t pt) const
inline

This is slightly weird because integer rectangles are not normally inclusive

Returns
clamped pt in rect.

◆ get_RectStr()

template<typename TYPE = float>
cString GrayLib::cRectFT< TYPE >::get_RectStr ( void  ) const
inline

◆ IsInsideMe()

template<typename TYPE = float>
bool GrayLib::cRectFT< TYPE >::IsInsideMe ( const RECT_t rect) const
inline

Is &rect inside me/this ? or equal=inside ASSUME: Normalized rect

◆ IsInsideX()

template<typename TYPE = float>
bool GrayLib::cRectFT< TYPE >::IsInsideX ( TYPE  x) const
inlinenoexcept

float is inclusive of right. ASSUME normalized!

◆ IsInsideY()

template<typename TYPE = float>
bool GrayLib::cRectFT< TYPE >::IsInsideY ( TYPE  y) const
inlinenoexcept

float is inclusive of bottom. ASSUME normalized!

◆ IsOverlapped()

template<typename TYPE = float>
bool GrayLib::cRectFT< TYPE >::IsOverlapped ( const RECT_t rect) const
inline

are the 2 rects overlapped/intersected at all ? float is inclusive rect. ASSUME: Normalized rect

◆ PtInRect() [1/2]

template<typename TYPE = float>
bool GrayLib::cRectFT< TYPE >::PtInRect ( const POINT_t pt) const
inlinenoexcept

Is the point in the rectangle ? NON inclusive rect! same as MFC PtInRect() A point is within CRect if it lies on the left or top side or is within all four sides. A point on the right or bottom side is outside CRect.

Note
The rectangle must be normalized or this function may fail. You can call NormalizeRect to normalize the rectangle before calling this function.

◆ PtInRect() [2/2]

template<typename TYPE = float>
bool GrayLib::cRectFT< TYPE >::PtInRect ( TYPE  x,
TYPE  y 
) const
inlinenoexcept

float is inclusive rect! Is the point in the rectangle ?

◆ UnionPoint()

template<typename TYPE = float>
void GrayLib::cRectFT< TYPE >::UnionPoint ( TYPE  x,
TYPE  y 
)
inline

Inflate this rect to include this point. ASSUME this is a inclusive rect! ASSUME normalized!

◆ v_GetRect()

template<typename TYPE >
void GrayLib::cRectFT< TYPE >::v_GetRect ( cVariant vVal) const

◆ v_SetRect()

template<typename TYPE >
ITERATE_t GrayLib::cRectFT< TYPE >::v_SetRect ( const cVariant vVal)

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