TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
sRect< T > Struct Template Reference
Inheritance diagram for sRect< T >:
sVec4< T >

Detailed Description

template<typename T>
struct ni::sRect< T >

Rect template class.

Public Member Functions

 sRect ()
 
 sRect (const sVec4< T > &avVec)
 
 sRect (T aLeft, T aTop, T aWidth=0, T aHeight=0)
 
 sRect (const sVec2< T > &aTopLeft, const sVec2< T > &aBottomRight)
 
 sRect (const sVec2< T > &aTopLeft, T aWidth=0, T aHeight=0)
 
void Set (T aLeft, T aTop, T aWidth=0, T aHeight=0)
 Set the Top Left corner and the size of the rectangle. More...
 
void Set (const sVec2< T > &aTopLeft, T aWidth, T aHeight)
 Set the Top Left corner and the size of the rectangle. More...
 
void SetCorners (const sVec2< T > &aTopLeft, const sVec2< T > &aBottomRight)
 Set the rectangle corners. More...
 
void SetCorner (eRectCorners aCorner, const sVec2< T > &aCornerPos)
 Set a rectangle corner. Adapt the others accordingly. More...
 
sVec2< T > GetCorner (eRectCorners aCorner) const
 Get a rectangle corner. More...
 
void SetTopLeft (const sVec2< T > &v)
 Set the Top Left corner. More...
 
sVec2< T > GetTopLeft () const
 Get the Top Left corner. More...
 
void SetTopRight (const sVec2< T > &v)
 Set the Top Right corner. More...
 
sVec2< T > GetTopRight () const
 Get the Top Right corner. More...
 
void SetBottomRight (const sVec2< T > &v)
 Set the Bottom Right corner. More...
 
sVec2< T > GetBottomRight () const
 Get the Bottom Right corner. More...
 
void SetBottomLeft (const sVec2< T > &v)
 Set the Bottom Left corner. More...
 
sVec2< T > GetBottomLeft () const
 Get the Bottom Left corner. More...
 
void SetLeft (T aV)
 Set the Left edge. More...
 
GetLeft () const
 Get the Left edge. More...
 
void SetRight (T aV)
 Set the Right edge. More...
 
GetRight () const
 Get the Right edge. More...
 
void SetTop (T aV)
 Set the Top edge. More...
 
GetTop () const
 Get the Top edge. More...
 
void SetBottom (T aV)
 Set the Bottom edge. More...
 
GetBottom () const
 Get the Bottom edge. More...
 
void SetWidth (T aWidth)
 Set the width of the rectangle. More...
 
GetWidth () const
 Get the width of the rectangle. More...
 
void SetHeight (T aHeight)
 Set the height of the rectangle. More...
 
GetHeight () const
 Get the height of the rectangle. More...
 
void SetSize (T aWidth, T aHeight)
 Set the width and height of the rectangle. More...
 
void SetSize (const sVec2< T > &aSize)
 Set the size of the rectangle. More...
 
sVec2< T > GetSize () const
 Get the size of the rectangle. More...
 
void Move (const sVec2< T > &aMoveOffset)
 Move the rectangle of the given offsets (relative movement). More...
 
void MoveTo (const sVec2< T > &aPos, eRectCorners aCorner=eRectCorners_TopLeft)
 Move the rectangle to the given position (absolute movement). More...
 
void Inflate (const sVec2< T > &aV)
 Inflate the size of the rectangle. More...
 
void Normalize ()
 Normalize the rectangle. Make sure that width and height are positive. More...
 
void SetCenter (const sVec2< T > &avPos)
 Set the center point of the rectangle. More...
 
sVec2< T > GetCenter () const
 Get the center point of the rectangle. More...
 
tBool IntersectRect (const sRect< T > &aRect) const
 Return eTrue if the given rectangle intersect this rectangle. More...
 
tBool Intersect (const sVec2< T > &aPoint) const
 Return eTrue if the given point intersect/is inside this rectangle. More...
 
sRect ClipRect (const sRect< T > &aRect) const
 clips the rectangle passed against himself and returns the resulting rectangle More...
 
sRect ComputeFrameCenter (T Left, T Right, T Top, T Bottom) const
 Get the center of the a frame with the specified borders. More...
 
sRect ComputeFrameCenter (const sVec4< T > &aFrameBorder) const
 Get the center of the a frame with the specified borders. More...
 
GetFrameLeftBorder (const sRect< T > &aFrame) const
 Get the size of the Left frame border. More...
 
GetFrameRightBorder (const sRect< T > &aFrame) const
 Get the size of the Right frame border. More...
 
GetFrameTopBorder (const sRect< T > &aFrame) const
 Get the size of the Top frame border. More...
 
GetFrameBottomBorder (const sRect< T > &aFrame) const
 Get the size of the Bottom frame border. More...
 
sVec4< T > GetFrameBorder (const sRect< T > &aFrame) const
 Return a vector that contains the border sizes. More...
 
sRectoperator+= (const sVec2< T > &v)
 += operator, move the rectangle. More...
 
sRect operator+ (const sVec2< T > &v) const
 += operator, move the rectangle. More...
 
sRectoperator-= (const sVec2< T > &v)
 -= operator, move the rectangle. More...
 
sRect operator- (const sVec2< T > &v) const
 -= operator, move the rectangle. More...
 
sRectoperator= (const sVec2< T > &v)
 = operator, move the rectangle to the specified position, Top Left is the anchor corner. More...
 
sRect< tI32ToInt () const
 
sRect< tF32ToFloat () const
 
sRect< T > FitInto (const sRect< T > &aDestRect, const tBool abCenter=ni::eTrue) const
 
const tBool IsNull () const
 
void Add (const sVec2< T > &aTL, const sVec2< T > &aBR)
 
void Add (const sRect< T > &aRight)
 
- Public Member Functions inherited from sVec4< T >
void Set (T aX, T aY=0, T aZ=0, T aW=0)
 
void Set (const T *apV)
 
tSize size () const
 
T * ptr ()
 
const T * ptr () const
 
T & operator[] (int idx)
 
const T & operator[] (int idx) const
 
T & Left ()
 
const T & Left () const
 
T & Top ()
 
const T & Top () const
 
T & Right ()
 
const T & Right () const
 
T & Bottom ()
 
const T & Bottom () const
 
T & x1 ()
 
const T & x1 () const
 
T & y1 ()
 
const T & y1 () const
 
T & x2 ()
 
const T & x2 () const
 
T & y2 ()
 
const T & y2 () const
 
T & A ()
 
const T & A () const
 
T & B ()
 
const T & B () const
 
T & C ()
 
const T & C () const
 
T & D ()
 
const T & D () const
 
void SetNormal (const sVec3< T > &v)
 
sVec3< T > GetNormal () const
 
void SetDist (T v)
 
GetDist () const
 
void SetPosition (const sVec3< T > &v)
 
sVec3< T > GetPosition () const
 
void SetRadius (T v)
 
GetRadius () const
 
T & ew ()
 
const T & ew () const
 
T & ex ()
 
const T & ex () const
 
T & ey ()
 
const T & ey () const
 
T & ez ()
 
const T & ez () const
 
T & _11 ()
 
const T & _11 () const
 
T & _12 ()
 
const T & _12 () const
 
T & _21 ()
 
const T & _21 () const
 
T & _22 ()
 
const T & _22 () const
 
sVec4< T > operator[] (const cchar *idx) const
 
bool operator< (const sVec4< T > &aR) const
 
bool operator<= (const sVec4< T > &aR) const
 
bool operator> (const sVec4< T > &aR) const
 
bool operator>= (const sVec4< T > &aR) const
 
bool operator== (const sVec4< T > &aR) const
 
bool operator!= (const sVec4< T > &aR) const
 
sVec4 operator+ () const
 
sVec4 operator- () const
 
sVec4operator+= (const sVec4< T > &v)
 
sVec4operator+= (T s)
 
sVec4 operator+ (const sVec4< T > &v) const
 
sVec4 operator+ (T s) const
 
sVec4operator-= (const sVec4< T > &v)
 
sVec4operator-= (T s)
 
sVec4 operator- (const sVec4< T > &v) const
 
sVec4 operator- (T s) const
 
sVec4operator*= (const sVec4< T > &v)
 
sVec4operator*= (T s)
 
sVec4 operator* (const sVec4< T > &v) const
 
sVec4 operator* (T s) const
 
sVec4operator/= (const sVec4< T > &v)
 
sVec4operator/= (T s)
 
sVec4 operator/ (const sVec4< T > &v) const
 
sVec4 operator/ (T s) const
 

Static Public Member Functions

static const sRectNull ()
 
- Static Public Member Functions inherited from sVec4< T >
static const sVec4Zero ()
 
static const sVec4One ()
 
static const sVec4Epsilon ()
 
static const sVec4XAxis ()
 
static const sVec4YAxis ()
 
static const sVec4ZAxis ()
 
static const sVec4WAxis ()
 
static const sVec4OpXAxis ()
 
static const sVec4OpYAxis ()
 
static const sVec4OpZAxis ()
 
static const sVec4OpWAxis ()
 
static const sVec4Black ()
 
static const sVec4White ()
 
static const sVec4Red ()
 
static const sVec4Green ()
 
static const sVec4Blue ()
 
static const sVec4Yellow ()
 
static const sVec4Pink ()
 
static const sVec4Aqua ()
 
static const sVec4Orange ()
 
static const sVec4Gray ()
 
static const sVec4QuatIdentity ()
 

Additional Inherited Members

- Public Attributes inherited from sVec4< T >
x
 
y
 
z
 
w
 

Member Function Documentation

void SetTopLeft ( const sVec2< T > &  v)

Set the Top Left corner.

sVec2<T> GetTopLeft ( ) const

Get the Top Left corner.

void SetTopRight ( const sVec2< T > &  v)

Set the Top Right corner.

sVec2<T> GetTopRight ( ) const

Get the Top Right corner.

void SetBottomRight ( const sVec2< T > &  v)

Set the Bottom Right corner.

sVec2<T> GetBottomRight ( ) const

Get the Bottom Right corner.

void SetBottomLeft ( const sVec2< T > &  v)

Set the Bottom Left corner.

sVec2<T> GetBottomLeft ( ) const

Get the Bottom Left corner.

sRect ComputeFrameCenter ( const sVec4< T > &  aFrameBorder) const

Get the center of the a frame with the specified borders.

T GetFrameLeftBorder ( const sRect< T > &  aFrame) const

Get the size of the Left frame border.

T GetFrameRightBorder ( const sRect< T > &  aFrame) const

Get the size of the Right frame border.

T GetFrameTopBorder ( const sRect< T > &  aFrame) const

Get the size of the Top frame border.

T GetFrameBottomBorder ( const sRect< T > &  aFrame) const

Get the size of the Bottom frame border.

sVec4<T> GetFrameBorder ( const sRect< T > &  aFrame) const

Return a vector that contains the border sizes.

static const sRect& Null ( )
static
sRect<tI32> ToInt ( ) const
sRect<tF32> ToFloat ( ) const
sRect<T> FitInto ( const sRect< T > &  aDestRect,
const tBool  abCenter = ni::eTrue 
) const
const tBool IsNull ( ) const
void Add ( const sVec2< T > &  aTL,
const sVec2< T > &  aBR 
)
void Add ( const sRect< T > &  aRight)