PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFXSize
Class which represents a size(height and width).
#include <SFXSize.h.hpp>
class SFXSize;
SFMTYPEDEFCLASS(SFXSize)

Member

Constructor/Destructor
SFXSize( Void )
Constructor of the SFXSize class.
SFXSize( SFXSizeConstRef param )
Constructor of the SFXSize class.
SFXSize( SInt16 width , SInt16 height )
Constructor of the SFXSize class.
SFXSize( SFXGridConstRef grid )
Constructor of the SFXSize class.
Public Functions
SFXSizeRef Add( SFXSizeConstRef param )
Add the specified value to the size.
SFXSizeRef Add( SInt16 width , SInt16 height )
Add the specified value to the size.
SFXSizeRef Add( SFXGridConstRef grid )
Add the specified value to the size.
SFXSizeRef AddHeight( SInt16 param )
Add the specified value to the height.
SFXSizeRef AddWidth( SInt16 param )
Add the specified value to the width.
SFXSizeRef Div( SInt16 width , SInt16 height )
Divide the size by the specified value.
SFXSizeRef Div( SInt16 param )
Divide the size by the specified value.
SFXSizeRef DivHeight( SInt16 param )
Divide the height by the specified value.
SFXSizeRef DivWidth( SInt16 param )
Divide the width by the specified value.
static
SFXSizeConstRef
EmptyInstance( Void )
Get an empty size.
Bool Equals( SFXSizeConstRef param )
Check whether this size equals the specified size or not.
Bool Equals( SInt16 width , SInt16 height )
Check whether this size equals the specified size or not.
Bool Equals( SFXGridConstRef grid )
Check whether this size equals the specified size or not.
SInt16 GetHeight( Void )
Get the height.
SInt16 GetWidth( Void )
Get the width.
Bool IsEmpty( Void )
Check whether this size is empty or not.
SFXSizeRef Mod( SInt16 width , SInt16 height )
Set the size to the remainder of the division of the size by the specified value.
SFXSizeRef Mod( SInt16 param )
Set the size to the remainder of the division of the size by the specified value.
SFXSizeRef ModHeight( SInt16 param )
Set the height to the remainder of the division of the height by the specified value.
SFXSizeRef ModWidth( SInt16 param )
Set the width to the remainder of the division of the width by the specified value.
SFXSizeRef Mul( SInt16 width , SInt16 height )
Multiply the size by the specified value.
SFXSizeRef Mul( SInt16 param )
Multiply the size by the specified value.
SFXSizeRef MulHeight( SInt16 param )
Multiply the height by the specified value.
SFXSizeRef MulWidth( SInt16 param )
Multiply the width by the specified value.
SFXSizeRef Neg( Void )
Negate the sign of the size.
SFXSizeRef NegHeight( Void )
Negate the sign of the height.
SFXSizeRef NegWidth( Void )
Negate the sign of the width.
SFXSizeRef Normalize( Void )
Normalize the size.
SFXSizeRef Set( SFXSizeConstRef param )
Set the size.
SFXSizeRef Set( SInt16 width , SInt16 height )
Set the size.
SFXSizeRef Set( SFXGridConstRef grid )
Set the size.
SFXSizeRef SetHeight( SInt16 param )
Set the height.
SFXSizeRef SetWidth( SInt16 param )
Set the width.
SFXSizeRef Sub( SFXSizeConstRef param )
Subtract the specified value from the size.
SFXSizeRef Sub( SInt16 width , SInt16 height )
Subtract the specified value from the size.
SFXSizeRef Sub( SFXGridConstRef grid )
Subtract the specified value from the size.
SFXSizeRef SubHeight( SInt16 param )
Subtract the specified value from the height.
SFXSizeRef SubWidth( SInt16 param )
Subtract the specified value from the width.
static
SFXSizeConstRef
ZeroInstance( Void )
Get the instance that represents 0.
SFXSizeRef operator%=( SInt16 param )
Set the size to the remainder of the division of the size by the specified value.
SFXSizeRef operator*=( SInt16 param )
Multiply the size by the specified value.
SFXSizeRef operator+=( SFXSizeConstRef param )
Add the specified value to the size.
SFXSizeRef operator+=( SFXGridConstRef grid )
Add the specified value to the size.
SFXSizeRef operator-=( SFXSizeConstRef param )
Subtract the specified value from the size, shorten it.
SFXSizeRef operator-=( SFXGridConstRef grid )
Subtract the specified value from the size, shorten it.
SFXSizeRef operator/=( SInt16 param )
Divide the size by the specified value.
SFXSizeRef operator=( SFXSizeConstRef param )
Assign the size.
SFXSizeRef operator=( SFXGridConstRef grid )
Assign the size.
SFXSize::AtomRec * atomic_cast( SFXSize * param )
Convert SFXSize into SFXSize::AtomRec.
SFXSize::AtomRec const * atomic_cast( SFXSize const * param )
Convert SFXSize into SFXSize::AtomRec.
SFXSize operator/( SFXSizeConstRef left , SInt16 right )
Divide the size by the specified value.
Bool operator==( SFXSizeConstRef left , SFXSizeConstRef right )
Check the "==" relation.
Bool operator==( SFXSizeConstRef left , SFXGridConstRef right )
Check the "==" relation.
SFXSize operator-( Void )
Subtract the specified value from the size, shorten it.
SFXSize operator-( SFXSizeConstRef left , SFXSizeConstRef right )
Subtract the specified value from the size, shorten it.
SFXSize operator-( SFXSizeConstRef left , SFXGridConstRef right )
Subtract the specified value from the size, shorten it.
SFXSize operator%( SFXSizeConstRef left , SInt16 right )
Set the size to the remainder of the division of the size by the specified value.
SFXSize operator*( SFXSizeConstRef left , SInt16 right )
Multiply the size by the specified value.
Bool operator!=( SFXSizeConstRef left , SFXSizeConstRef right )
Check the "!=" relation.
Bool operator!=( SFXSizeConstRef left , SFXGridConstRef right )
Check the "!=" relation.
SFXSize operator+( Void )
Add the specified value to the size.
SFXSize operator+( SFXSizeConstRef left , SFXSizeConstRef right )
Add the specified value to the size.
SFXSize operator+( SFXSizeConstRef left , SFXGridConstRef right )
Add the specified value to the size.
Types
AtomRec
Structure that represents a size.
Global Functions
SFXSize::AtomRec * atomic_cast( SFXSize * param )
Convert SFXSize into SFXSize::AtomRec.
SFXSize::AtomRec const * atomic_cast( SFXSize const * param )
Convert SFXSize into SFXSize::AtomRec.
SFXSize operator/( SFXSizeConstRef left , SInt16 right )
Divide the size by the specified value.
Bool operator==( SFXSizeConstRef left , SFXSizeConstRef right )
Check the "==" relation.
Bool operator==( SFXSizeConstRef left , SFXGridConstRef right )
Check the "==" relation.
SFXSize operator-( Void )
Subtract the specified value from the size, shorten it.
SFXSize operator-( SFXSizeConstRef left , SFXSizeConstRef right )
Subtract the specified value from the size, shorten it.
SFXSize operator-( SFXSizeConstRef left , SFXGridConstRef right )
Subtract the specified value from the size, shorten it.
SFXSize operator%( SFXSizeConstRef left , SInt16 right )
Set the size to the remainder of the division of the size by the specified value.
SFXSize operator*( SFXSizeConstRef left , SInt16 right )
Multiply the size by the specified value.
Bool operator!=( SFXSizeConstRef left , SFXSizeConstRef right )
Check the "!=" relation.
Bool operator!=( SFXSizeConstRef left , SFXGridConstRef right )
Check the "!=" relation.
SFXSize operator+( Void )
Add the specified value to the size.
SFXSize operator+( SFXSizeConstRef left , SFXSizeConstRef right )
Add the specified value to the size.
SFXSize operator+( SFXSizeConstRef left , SFXGridConstRef right )
Add the specified value to the size.

SFXSize::SFXSize
Constructor of the SFXSize class.
[ public, explicit ]
SFXSize(Void);
[ public ]
SFXSize(
    SFXSizeConstRef param   // source size (SFXSize)
);
[ public, explicit ]
SFXSize(
    SInt16 width    // width
    SInt16 height   // height
);
[ public, explicit ]
SFXSize(
    SFXGridConstRef grid   // source size (SFXGrid)
);

SFXSize::Add
Add the specified value to the size.
[ public ]
SFXSizeRef Add(
    SFXSizeConstRef param   // value to add to the width and height (SFXSize)
);
[ public ]
SFXSizeRef Add(
    SInt16 width    // value to add to the width
    SInt16 height   // value to add to the height
);
[ public ]
SFXSizeRef Add(
    SFXGridConstRef grid   // value to add to the width and height (SFXGrid)
);

Reference

SFXSize::AddWidth | SFXSize::AddHeight | SFXSize::Sub | SFXSize::Mul | SFXSize::Div | SFXSize::Mod | SFXSize::Neg


SFXSize::AddHeight
Add the specified value to the height.
[ public ]
SFXSizeRef AddHeight(
    SInt16 param   // value to add to the height
);

Reference

SFXSize::AddWidth | SFXSize::SubHeight | SFXSize::MulHeight | SFXSize::DivHeight | SFXSize::ModHeight | SFXSize::NegHeight


SFXSize::AddWidth
Add the specified value to the width.
[ public ]
SFXSizeRef AddWidth(
    SInt16 param   // value to add to the width
);

Reference

SFXSize::AddHeight | SFXSize::SubWidth | SFXSize::MulWidth | SFXSize::DivWidth | SFXSize::ModWidth | SFXSize::NegWidth


SFXSize::Div
Divide the size by the specified value.
[ public ]
SFXSizeRef Div(
    SInt16 width    // divide the width by this value
    SInt16 height   // divide the height by this value
);
[ public ]
SFXSizeRef Div(
    SInt16 param   // divide the width and the height by this value
);

Description

The behaviour is not defined when the value of width, height, or param argument is 0.

Reference

SFXSize::Add | SFXSize::Sub | SFXSize::Mul | SFXSize::DivWidth | SFXSize::DivHeight | SFXSize::Mod | SFXSize::Neg | operator/ | SFXSize::operator/=


SFXSize::DivHeight
Divide the height by the specified value.
[ public ]
SFXSizeRef DivHeight(
    SInt16 param   // divide the height by this value
);

Description

The behaviour is not defined when the value of param argument is 0.

Reference

SFXSize::AddHeight | SFXSize::SubHeight | SFXSize::MulHeight | SFXSize::DivWidth | SFXSize::ModHeight | SFXSize::NegHeight


SFXSize::DivWidth
Divide the width by the specified value.
[ public ]
SFXSizeRef DivWidth(
    SInt16 param   // divide the width by this value
);

Description

The behaviour is not defined when the value of param argument is 0.

Reference

SFXSize::AddWidth | SFXSize::SubWidth | SFXSize::MulWidth | SFXSize::DivHeight | SFXSize::ModWidth | SFXSize::NegWidth


SFXSize::EmptyInstance
Get an empty size.
[ public, static ]
SFXSizeConstRef EmptyInstance(Void);

Return value

Return an empty SFXSize instance, which means this shape has no area.

Description

A shape has no area if the value of a length-related variable is less than or equals 0. This instance is used mainly as initial value of the assignment statement or return value of the shape-related function.


SFXSize::Equals
Check whether this size equals the specified size or not.
[ public, const ]
Bool Equals(
    SFXSizeConstRef param   // size to compare (SFXSize)
);
[ public, const ]
Bool Equals(
    SInt16 width    // width of the size to compare
    SInt16 height   // height of the size to compare
);
[ public, const ]
Bool Equals(
    SFXGridConstRef grid   // size to compare (SFXGrid)
);

Return value

  • If yes: true
  • Otherwise: false

Reference

operator== | operator!=


SFXSize::GetHeight
Get the height.
[ public, const ]
SInt16 GetHeight(Void);

Reference

SFXSize::GetWidth | SFXSize::SetHeight


SFXSize::GetWidth
Get the width.
[ public, const ]
SInt16 GetWidth(Void);

Reference

SFXSize::GetHeight | SFXSize::SetWidth


SFXSize::IsEmpty
Check whether this size is empty or not.
[ public, const ]
Bool IsEmpty(Void);

Return value

  • If yes: true
  • Otherwise: false

SFXSize::Mod
Set the size to the remainder of the division of the size by the specified value.
[ public ]
SFXSizeRef Mod(
    SInt16 width    // divide the width by this value
    SInt16 height   // divide the height by this value
);
[ public ]
SFXSizeRef Mod(
    SInt16 param   // divide the width and height by this value
);

Description

The operation when param, width, or height is 0 has not been defined yet.

Reference

SFXSize::Add | SFXSize::Sub | SFXSize::Mul | SFXSize::Div | SFXSize::ModWidth | SFXSize::ModHeight | SFXSize::Neg | operator% | SFXSize::operator%=


SFXSize::ModHeight
Set the height to the remainder of the division of the height by the specified value.
[ public ]
SFXSizeRef ModHeight(
    SInt16 param   // divide the height by this value
);

Description

The behaviour is not defined when the value of param argument is 0.

Reference

SFXSize::AddHeight | SFXSize::SubHeight | SFXSize::MulHeight | SFXSize::DivHeight | SFXSize::ModWidth | SFXSize::NegHeight


SFXSize::ModWidth
Set the width to the remainder of the division of the width by the specified value.
[ public ]
SFXSizeRef ModWidth(
    SInt16 param   // divide the width by this value
);

Description

The behaviour is not defined when the value of param argument is 0.

Reference

SFXSize::AddWidth | SFXSize::SubWidth | SFXSize::MulWidth | SFXSize::DivWidth | SFXSize::Mod | SFXSize::ModHeight | SFXSize::NegWidth


SFXSize::Mul
Multiply the size by the specified value.
[ public ]
SFXSizeRef Mul(
    SInt16 width    // value to multiply with the width
    SInt16 height   // value to multiply with the height
);
[ public ]
SFXSizeRef Mul(
    SInt16 param   // value to multiply with the width and height
);

Reference

SFXSize::Add | SFXSize::Sub | SFXSize::ModWidth | SFXSize::ModHeight | SFXSize::Div | SFXSize::Mod | SFXSize::Neg | operator* | SFXSize::operator*=


SFXSize::MulHeight
Multiply the height by the specified value.
[ public ]
SFXSizeRef MulHeight(
    SInt16 param   // value to multiply with the height
);

Reference

SFXSize::AddHeight | SFXSize::SubHeight | SFXSize::MulWidth | SFXSize::DivHeight | SFXSize::ModHeight | SFXSize::NegHeight


SFXSize::MulWidth
Multiply the width by the specified value.
[ public ]
SFXSizeRef MulWidth(
    SInt16 param   // value to multiply with the width
);

Reference

SFXSize::AddWidth | SFXSize::SubWidth | SFXSize::MulHeight | SFXSize::DivWidth | SFXSize::ModWidth | SFXSize::NegWidth


SFXSize::Neg
Negate the sign of the size.
[ public ]
SFXSizeRef Neg(Void);

Reference

SFXSize::Add | SFXSize::Sub | SFXSize::Mul | SFXSize::Div | SFXSize::Mod | SFXSize::NegWidth | SFXSize::NegHeight


SFXSize::NegHeight
Negate the sign of the height.
[ public ]
SFXSizeRef NegHeight(Void);

Reference

SFXSize::AddHeight | SFXSize::SubHeight | SFXSize::MulHeight | SFXSize::DivHeight | SFXSize::ModHeight | SFXSize::NegWidth


SFXSize::NegWidth
Negate the sign of the width.
[ public ]
SFXSizeRef NegWidth(Void);

Reference

SFXSize::AddWidth | SFXSize::SubWidth | SFXSize::MulWidth | SFXSize::DivWidth | SFXSize::ModWidth | SFXSize::NegHeight


SFXSize::Normalize
Normalize the size.
[ public ]
SFXSizeRef Normalize(Void);

Description

If both width and height are positive numbers, do nothing.

If either width or height is negative, negate its sign.


SFXSize::Set
Set the size.
[ public ]
SFXSizeRef Set(
    SFXSizeConstRef param   // size (SFXSize) to set
);
[ public ]
SFXSizeRef Set(
    SInt16 width    // width to set
    SInt16 height   // height to set
);
[ public ]
SFXSizeRef Set(
    SFXGridConstRef grid   // size (SFXGrid) to set
);

Reference

SFXSize::operator=


SFXSize::SetHeight
Set the height.
[ public ]
SFXSizeRef SetHeight(
    SInt16 param   // height to set
);

Reference

SFXSize::GetHeight | SFXSize::SetWidth | SFXSize::Set


SFXSize::SetWidth
Set the width.
[ public ]
SFXSizeRef SetWidth(
    SInt16 param   // width to set
);

Reference

SFXSize::GetWidth | SFXSize::SetHeight | SFXSize::Set


SFXSize::Sub
Subtract the specified value from the size.
[ public ]
SFXSizeRef Sub(
    SFXSizeConstRef param   // value to subtract from the width and height (SFXSize)
);
[ public ]
SFXSizeRef Sub(
    SInt16 width    // value to subtract from the width
    SInt16 height   // value to subtract from the height
);
[ public ]
SFXSizeRef Sub(
    SFXGridConstRef grid   // value to subtract from the width and height (SFXGrid)
);

Reference

SFXSize::Add | SFXSize::SubWidth | SFXSize::SubHeight | SFXSize::Mul | SFXSize::Div | SFXSize::Mod | SFXSize::Neg


SFXSize::SubHeight
Subtract the specified value from the height.
[ public ]
SFXSizeRef SubHeight(
    SInt16 param   // value to subtract from the height
);

Reference

SFXSize::AddHeight | SFXSize::SubWidth | SFXSize::MulHeight | SFXSize::DivHeight | SFXSize::ModHeight | SFXSize::NegHeight


SFXSize::SubWidth
Subtract the specified value from the width.
[ public ]
SFXSizeRef SubWidth(
    SInt16 param   // value to subtract from the width
);

Reference

SFXSize::AddWidth | SFXSize::SubHeight | SFXSize::MulWidth | SFXSize::DivWidth | SFXSize::ModWidth | SFXSize::NegWidth


SFXSize::ZeroInstance
Get the instance that represents 0.
[ public, static ]
SFXSizeConstRef ZeroInstance(Void);

Description

This function returns the 0 instance, which means that 0 or null is set to all the member variables of its corresponding AtomRec struct.

Example

SFXSize size(10, 20);

size =  SFXSize::ZeroInstance();   // initialize size
TRACE("width = %d, height = %d", size.GetWidth(), size.GetHeight());  // width = 0, height = 0

Reference

SFXSize::AtomRec


atomic_cast
Convert SFXSize into SFXSize::AtomRec.
[ public, friend ]
SFXSize::AtomRec * atomic_cast(
    SFXSize * param   // size to cast
);
[ public, friend ]
SFXSize::AtomRec const * atomic_cast(
    SFXSize const * param   // size to cast
);

Reference

SFXSize::AtomRec


SFXSize::operator=
Assign the size.
[ public ]
SFXSizeRef operator=(
    SFXSizeConstRef param   // source size (SFXSize)
);
[ public ]
SFXSizeRef operator=(
    SFXGridConstRef grid   // source size (SFXGrid)
);

Reference

SFXSize::Set


SFXSize::operator/=
Divide the size by the specified value.
[ public ]
SFXSizeRef operator/=(
    SInt16 param   // divide the width and height by this value
);

Description

The behaviour is not defined when the value of param argument is 0.

Reference

SFXSize::Div | operator/ | SFXSize::operator*= | SFXSize::operator%=


operator/
Divide the size by the specified value.
[ public, friend ]
SFXSize operator/(
    SFXSizeConstRef left   // size to divide
    SInt16 right           // divide the width and height by this value
);

Description

The operation when the right is 0 has not been defined yet.

Reference

SFXSize::Div | SFXSize::operator/= | operator* | operator%


operator==
Check the "==" relation.
[ public, friend ]
Bool operator==(
    SFXSizeConstRef left    // size to compare
    SFXSizeConstRef right   // size to compare
);
[ public, friend ]
Bool operator==(
    SFXSizeConstRef left    // size to compare
    SFXGridConstRef right   // size to compare
);

Return value

  • If yes: true
  • Otherwise: false

Reference

SFXSize::Equals | operator!=


SFXSize::operator-=
Subtract the specified value from the size, shorten it.
[ public ]
SFXSizeRef operator-=(
    SFXSizeConstRef param   // width and height to subtract (SFXSize)
);
[ public ]
SFXSizeRef operator-=(
    SFXGridConstRef grid   // width and height to subtract(SFXGrid)
);

Reference

operator- | SFXSize::operator+=


operator-
Subtract the specified value from the size, shorten it.
[ public, const ]
SFXSize operator-(Void);
[ public, friend ]
SFXSize operator-(
    SFXSizeConstRef left    // size to subtract
    SFXSizeConstRef right   // width and height to subtract (SFXSize)
);
[ public, friend ]
SFXSize operator-(
    SFXSizeConstRef left    // 
    SFXGridConstRef right   // width and height to subtract (SFXGrid)
);

Reference

SFXSize::operator-= | operator+


SFXSize::operator%=
Set the size to the remainder of the division of the size by the specified value.
[ public ]
SFXSizeRef operator%=(
    SInt16 param   // divide the width and height by this value
);

Description

The behaviour is not defined when the value of param argument is 0.

Reference

SFXSize::Mod | SFXSize::operator/= | SFXSize::operator*= | operator%


operator%
Set the size to the remainder of the division of the size by the specified value.
[ public, friend ]
SFXSize operator%(
    SFXSizeConstRef left   // size to divide
    SInt16 right           // divide the width and height by this value
);

Description

The operation when the right is 0 has not been defined yet.

Reference

SFXSize::Mod | operator/ | operator* | SFXSize::operator%=


SFXSize::operator*=
Multiply the size by the specified value.
[ public ]
SFXSizeRef operator*=(
    SInt16 param   // value to multiply with the width and height
);

Reference

SFXSize::Mul | SFXSize::operator/= | operator* | SFXSize::operator%=


operator*
Multiply the size by the specified value.
[ public, friend ]
SFXSize operator*(
    SFXSizeConstRef left   // size to multiply
    SInt16 right           // value to multiply with the width and height
);

Reference

SFXSize::Mul | operator/ | SFXSize::operator*= | operator%


operator!=
Check the "!=" relation.
[ public, friend ]
Bool operator!=(
    SFXSizeConstRef left    // size to compare
    SFXSizeConstRef right   // size to compare
);
[ public, friend ]
Bool operator!=(
    SFXSizeConstRef left    // size to compare
    SFXGridConstRef right   // size to compare
);

Return value

  • Not identical: true
  • Identical: false

Reference

SFXSize::Equals | operator==


SFXSize::operator+=
Add the specified value to the size.
[ public ]
SFXSizeRef operator+=(
    SFXSizeConstRef param   // size to add
);
[ public ]
SFXSizeRef operator+=(
    SFXGridConstRef grid   // width and height to add
);

Reference

SFXSize::operator-= | operator+


operator+
Add the specified value to the size.
[ public, const ]
SFXSize operator+(Void);
[ public, friend ]
SFXSize operator+(
    SFXSizeConstRef left    // size to add
    SFXSizeConstRef right   // width and height to add ( SFXSize )
);
[ public, friend ]
SFXSize operator+(
    SFXSizeConstRef left    // size to add
    SFXGridConstRef right   // width and height to add ( SFXGrid )
);

Reference

operator- | SFXSize::operator+=


SFXSize::AtomRec
Structure that represents a size.
struct AtomRec {
  SInt16  width;   // width
  SInt16  height;  // height
};