SophiaFramework UNIVERSE 5.3 |
SFXGrid is the class that handles the grid coordinates.
In SophiaFramework, there are 2 coordinate systems: grid coordinate system and pixel coordinate system. The grid coordinates form a lattice point.
The difference between the 2 coordinate systems is as follows:
Comparing to the "Go" game or the Japanese Chess game, the drawing plain is like the playing board, the grid is like the place to put the "Go" stone, the pixel is like the place to put the horse of the Japanese Chess game.
Constructor/Destructor |
---|
SFXGrid( Void ) Constructor of the SFXGrid class.
|
SFXGrid(
SFXGridConstRef param
) Constructor of the SFXGrid class.
|
SFXGrid(
SInt16 x
, SInt16 y
) Constructor of the SFXGrid class.
|
SFXGrid(
SFXSizeConstRef size
) Constructor of the SFXGrid class.
|
Public Functions | |
---|---|
SFXGridRef |
Add(
SFXGridConstRef param
) Add the specified value to the coordinates.
|
SFXGridRef |
Add(
SInt16 x
, SInt16 y
) Add the specified value to the coordinates.
|
SFXGridRef |
Add(
SFXSizeConstRef size
) Add the specified value to the coordinates.
|
SFXGridRef |
AddX(
SInt16 param
) Add the specified value to X coordinate.
|
SFXGridRef |
AddY(
SInt16 param
) Add the specified value to Y coordinate.
|
SFXGridRef |
Div(
SInt16 x
, SInt16 y
) Divide the coordinate.
|
SFXGridRef |
Div(
SInt16 param
) Divide the coordinate.
|
SFXGridRef |
DivX(
SInt16 param
) Divide the X coordinate.
|
SFXGridRef |
DivY(
SInt16 param
) Divide the Y coordinate by the specified value.
|
Bool |
Equals(
SFXGridConstRef param
) Check whether this grid equals the specified grid or not.
|
Bool |
Equals(
SInt16 x
, SInt16 y
) Check whether this grid equals the specified grid or not.
|
Bool |
Equals(
SFXSizeConstRef size
) Check whether this grid equals the specified grid or not.
|
SFXPixel |
GetLeftBottom( Void ) Get the left-bottom point.
|
SFXPixel |
GetLeftTop( Void ) Get the left-top point.
|
SFXPixel |
GetRightBottom( Void ) Get the right-bottom point.
|
SFXPixel |
GetRightTop( Void ) Get the right-top point.
|
SInt16 |
GetX( Void ) Get the X coordinate.
|
SInt16 |
GetY( Void ) Get the Y coordinate.
|
Bool |
IsInsideOf(
SFXRectangleConstRef param
) Check whether this grid is inside of the specified rectangular area or not.
|
SFXGridRef |
Mod(
SInt16 x
, SInt16 y
) Set the coordinates to the remainder of the division of this coordinates by the specified value.
|
SFXGridRef |
Mod(
SInt16 param
) Set the coordinates to the remainder of the division of this coordinates by the specified value.
|
SFXGridRef |
ModX(
SInt16 param
) Set the X coordinate to the remainder of the division of X coordinate by the specified value.
|
SFXGridRef |
ModY(
SInt16 param
) Set the Y coordinate to the remainder of the division of Y coordinate by the specified value.
|
SFXGridRef |
Mul(
SInt16 x
, SInt16 y
) Multiply the coordinate by the specified value.
|
SFXGridRef |
Mul(
SInt16 param
) Multiply the coordinate by the specified value.
|
SFXGridRef |
MulX(
SInt16 param
) Multiply the X coordinate by the specified value.
|
SFXGridRef |
MulY(
SInt16 param
) Multiply the Y coordinate by the specified value.
|
SFXGridRef |
Neg( Void ) Negate the sign of the coordinates.
|
SFXGridRef |
NegX( Void ) Negate the sign of the X coordinate.
|
SFXGridRef |
NegY( Void ) Negate the sign of the Y coordinate.
|
SFXGridRef |
Set(
SFXGridConstRef param
) Set the grid.
|
SFXGridRef |
Set(
SInt16 x
, SInt16 y
) Set the grid.
|
SFXGridRef |
Set(
SFXSizeConstRef size
) Set the grid.
|
SFXGridRef |
SetLeftBottom(
SFXPixelConstRef param
) Set the left-bottom point.
|
SFXGridRef |
SetLeftBottom(
SInt16 x
, SInt16 y
) Set the left-bottom point.
|
SFXGridRef |
SetLeftTop(
SFXPixelConstRef param
) Set the left-top point.
|
SFXGridRef |
SetLeftTop(
SInt16 x
, SInt16 y
) Set the left-top point.
|
SFXGridRef |
SetRightBottom(
SFXPixelConstRef param
) Set the right-bottom point.
|
SFXGridRef |
SetRightBottom(
SInt16 x
, SInt16 y
) Set the right-bottom point.
|
SFXGridRef |
SetRightTop(
SFXPixelConstRef param
) Set the right-top point.
|
SFXGridRef |
SetRightTop(
SInt16 x
, SInt16 y
) Set the right-top point.
|
SFXGridRef |
SetX(
SInt16 param
) Set the X coordinate.
|
SFXGridRef |
SetY(
SInt16 param
) Set the Y coordinate.
|
SFXGridRef |
Sub(
SFXGridConstRef param
) Subtract the specified value from the coordinates
|
SFXGridRef |
Sub(
SInt16 x
, SInt16 y
) Subtract the specified value from the coordinates
|
SFXGridRef |
Sub(
SFXSizeConstRef size
) Subtract the specified value from the coordinates
|
SFXGridRef |
SubX(
SInt16 param
) Subtract the specified value from the X coordinate
|
SFXGridRef |
SubY(
SInt16 param
) Subtract the specified value from the Y coordinate
|
static SFXGridConstRef |
ZeroInstance( Void ) Get the instance that represents 0.
|
SFXGridRef |
operator%=(
SInt16 param
) Set the coordinates to the remainder of the division of this coordinates by the specified value.
|
SFXGridRef |
operator*=(
SInt16 param
) Multiply the coordinates by the specified value.
|
SFXGridRef |
operator+=(
SFXGridConstRef param
) Add the specified value to the coordinates and move this grid.
|
SFXGridRef |
operator+=(
SFXSizeConstRef size
) Add the specified value to the coordinates and move this grid.
|
SFXGridRef |
operator-=(
SFXGridConstRef param
) Subtract the specified value from the coordinates and move this grid.
|
SFXGridRef |
operator-=(
SFXSizeConstRef size
) Subtract the specified value from the coordinates and move this grid.
|
SFXGridRef |
operator/=(
SInt16 param
) Divide the coordinates by the specified value.
|
SFXGridRef |
operator=(
SFXGridConstRef param
) Assign a grid.
|
SFXGridRef |
operator=(
SFXSizeConstRef size
) Assign a grid.
|
SFXGrid::AtomRec * |
atomic_cast(
SFXGrid * param
) Convert SFXGrid into SFXGrid::AtomRec.
|
SFXGrid::AtomRec const * |
atomic_cast(
SFXGrid const * param
) Convert SFXGrid into SFXGrid::AtomRec.
|
AEEPoint * |
interface_cast(
SFXGrid * param
) Convert SFXGrid into AEEPoint.
|
AEEPoint const * |
interface_cast(
SFXGrid const * param
) Convert SFXGrid into AEEPoint.
|
SFXGrid |
operator/(
SFXGridConstRef left
, SInt16 right
) Divide the coordinates of a grid by the specified value.
|
Bool |
operator==(
SFXGridConstRef left
, SFXGridConstRef right
) Check the "==" relation.
|
Bool |
operator==(
SFXGridConstRef left
, SFXSizeConstRef right
) Check the "==" relation.
|
SFXGrid |
operator-( Void ) Subtract the specified value from the coordinates of a grid and move this grid.
|
SFXGrid |
operator-(
SFXGridConstRef left
, SFXGridConstRef right
) Subtract the specified value from the coordinates of a grid and move this grid.
|
SFXGrid |
operator-(
SFXGridConstRef left
, SFXSizeConstRef right
) Subtract the specified value from the coordinates of a grid and move this grid.
|
SFXGrid |
operator%(
SFXGridConstRef left
, SInt16 right
) Set the coordinates to the remainder of the division of this coordinates by the specified value.
|
SFXGrid |
operator*(
SFXGridConstRef left
, SInt16 right
) Multiply the coordinates of a grid by the specified value.
|
Bool |
operator!=(
SFXGridConstRef left
, SFXGridConstRef right
) Check the "!=" relation.
|
Bool |
operator!=(
SFXGridConstRef left
, SFXSizeConstRef right
) Check the "!=" relation.
|
SFXGrid |
operator+( Void ) Add the specified value to the coordinates of a grid and move this grid.
|
SFXGrid |
operator+(
SFXGridConstRef left
, SFXGridConstRef right
) Add the specified value to the coordinates of a grid and move this grid.
|
SFXGrid |
operator+(
SFXGridConstRef left
, SFXSizeConstRef right
) Add the specified value to the coordinates of a grid and move this grid.
|
Types |
---|
AtomRec
Structure that represents a lattice point (a grid).
|
Global Functions | |
---|---|
SFXGrid::AtomRec * |
atomic_cast(
SFXGrid * param
) Convert SFXGrid into SFXGrid::AtomRec.
|
SFXGrid::AtomRec const * |
atomic_cast(
SFXGrid const * param
) Convert SFXGrid into SFXGrid::AtomRec.
|
AEEPoint * |
interface_cast(
SFXGrid * param
) Convert SFXGrid into AEEPoint.
|
AEEPoint const * |
interface_cast(
SFXGrid const * param
) Convert SFXGrid into AEEPoint.
|
SFXGrid |
operator/(
SFXGridConstRef left
, SInt16 right
) Divide the coordinates of a grid by the specified value.
|
Bool |
operator==(
SFXGridConstRef left
, SFXGridConstRef right
) Check the "==" relation.
|
Bool |
operator==(
SFXGridConstRef left
, SFXSizeConstRef right
) Check the "==" relation.
|
SFXGrid |
operator-( Void ) Subtract the specified value from the coordinates of a grid and move this grid.
|
SFXGrid |
operator-(
SFXGridConstRef left
, SFXGridConstRef right
) Subtract the specified value from the coordinates of a grid and move this grid.
|
SFXGrid |
operator-(
SFXGridConstRef left
, SFXSizeConstRef right
) Subtract the specified value from the coordinates of a grid and move this grid.
|
SFXGrid |
operator%(
SFXGridConstRef left
, SInt16 right
) Set the coordinates to the remainder of the division of this coordinates by the specified value.
|
SFXGrid |
operator*(
SFXGridConstRef left
, SInt16 right
) Multiply the coordinates of a grid by the specified value.
|
Bool |
operator!=(
SFXGridConstRef left
, SFXGridConstRef right
) Check the "!=" relation.
|
Bool |
operator!=(
SFXGridConstRef left
, SFXSizeConstRef right
) Check the "!=" relation.
|
SFXGrid |
operator+( Void ) Add the specified value to the coordinates of a grid and move this grid.
|
SFXGrid |
operator+(
SFXGridConstRef left
, SFXGridConstRef right
) Add the specified value to the coordinates of a grid and move this grid.
|
SFXGrid |
operator+(
SFXGridConstRef left
, SFXSizeConstRef right
) Add the specified value to the coordinates of a grid and move this grid.
|
[ public, explicit ] SFXGrid(Void);
[ public ] SFXGrid( SFXGridConstRef param // source SFXGrid object );
[ public, explicit ] SFXGrid( SInt16 x // X coordinate SInt16 y // Y coordinate );
[ public, explicit ] SFXGrid( SFXSizeConstRef size // width and height );
If the arguments are specified, this constructer will set this pixel to the specified values by calling the SFXGrid::Set function internally.
If an SFXSize instancec is specified in the argument, the X and Y coordinate of this pixel is set to its width and height respectively.
[ public ] SFXGridRef Add( SFXGridConstRef param // value to add to the coordinates );
[ public ] SFXGridRef Add( SInt16 x // value to add to the X coordinate SInt16 y // value to add to the Y coordinate );
[ public ] SFXGridRef Add( SFXSizeConstRef size // value to add to the coordinates );
SFXGrid::AddX | SFXGrid::AddY | SFXGrid::Sub | SFXGrid::Mul | SFXGrid::Div | SFXGrid::Mod | SFXGrid::Neg
[ public ] SFXGridRef AddX( SInt16 param // value to add );
SFXGrid::Add | SFXGrid::AddY | SFXGrid::SubX | SFXGrid::MulX | SFXGrid::DivX | SFXGrid::ModX | SFXGrid::NegX
[ public ] SFXGridRef AddY( SInt16 param // value to add );
SFXGrid::Add | SFXGrid::AddX | SFXGrid::SubY | SFXGrid::MulY | SFXGrid::DivY | SFXGrid::ModY | SFXGrid::NegY
[ public ] SFXGridRef Div( SInt16 x // divide the X coordinate by this value SInt16 y // divide the Y coordinate by this value );
[ public ] SFXGridRef Div( SInt16 param // divide the coordinates by this value );
The behaviour is not defined when the value of x, y, or param argument is 0.
SFXGrid::Add | SFXGrid::Sub | SFXGrid::Mul | SFXGrid::DivX | SFXGrid::DivY | SFXGrid::Mod | SFXGrid::Neg | operator/ | SFXGrid::operator/=
[ public ] SFXGridRef DivX( SInt16 param // divide the X coordinate by this value );
The behaviour is not defined when the value of param argument is 0.
SFXGrid::AddX | SFXGrid::SubX | SFXGrid::MulX | SFXGrid::Div | SFXGrid::DivY | SFXGrid::ModX | SFXGrid::NegX
[ public ] SFXGridRef DivY( SInt16 param // divide the Y coordinate by this value );
The behaviour is not defined when the value of param argument is 0.
SFXGrid::AddY | SFXGrid::SubY | SFXGrid::MulY | SFXGrid::Div | SFXGrid::DivX | SFXGrid::ModY | SFXGrid::NegY
[ public, const ] Bool Equals( SFXGridConstRef param // grid to compare );
[ public, const ] Bool Equals( SInt16 x // X coordinate of grid to compare SInt16 y // Y coordinate of grid to compare );
[ public, const ] Bool Equals( SFXSizeConstRef size // size of grid to compare );
When comparing a grid with an object of SFXSize class, the grid X coordinate is compared with the width of SFXSize object, and the grid Y coordinate is compared with the height of SFXSize object.
[ public, const ] SFXPixel GetLeftBottom(Void);
[ public, const ] SFXPixel GetLeftTop(Void);
[ public, const ] SFXPixel GetRightBottom(Void);
[ public, const ] SFXPixel GetRightTop(Void);
[ public, const ] SInt16 GetX(Void);
[ public, const ] SInt16 GetY(Void);
[ public, const ] Bool IsInsideOf( SFXRectangleConstRef param // base rectangle );
The grid with coordinates on the edge of the rectangle is also considered being inside of the rectangle.
[ public ] SFXGridRef Mod( SInt16 x // divide the X coordinate by this value SInt16 y // divide the Y coordinate by this value );
[ public ] SFXGridRef Mod( SInt16 param // divide the coordinates by this value );
The behaviour is not defined when the value of value argument is 0.
SFXGrid::Add | SFXGrid::Sub | SFXGrid::Mul | SFXGrid::Div | SFXGrid::ModX | SFXGrid::ModY | SFXGrid::Neg | operator% | SFXGrid::operator%=
[ public ] SFXGridRef ModX( SInt16 param // divide the X coordinate by this value );
The behaviour is not defined when the value of value argument is 0.
SFXGrid::AddX | SFXGrid::SubX | SFXGrid::MulX | SFXGrid::DivX | SFXGrid::Mod | SFXGrid::ModY | SFXGrid::NegX
[ public ] SFXGridRef ModY( SInt16 param // divide the Y coordinate by this value );
The behaviour is not defined when the value of value argument is 0.
SFXGrid::AddY | SFXGrid::SubY | SFXGrid::MulY | SFXGrid::DivY | SFXGrid::Mod | SFXGrid::ModX | SFXGrid::NegY
[ public ] SFXGridRef Mul( SInt16 x // value to multiply with the X coordinate SInt16 y // value to multiply with the Y coordinate );
[ public ] SFXGridRef Mul( SInt16 param // value to multiply with the coordinates );
SFXGrid::Add | SFXGrid::Sub | SFXGrid::MulX | SFXGrid::MulY | SFXGrid::Div | SFXGrid::Mod | SFXGrid::Neg | operator* | SFXGrid::operator*=
[ public ] SFXGridRef MulX( SInt16 param // value to multiply with the X coordinate );
SFXGrid::AddX | SFXGrid::SubX | SFXGrid::Mul | SFXGrid::MulY | SFXGrid::DivX | SFXGrid::ModX | SFXGrid::NegX
[ public ] SFXGridRef MulY( SInt16 param // value to multiply with the Y coordinate );
SFXGrid::AddY | SFXGrid::SubY | SFXGrid::Mul | SFXGrid::MulX | SFXGrid::DivY | SFXGrid::ModY | SFXGrid::NegY
[ public ] SFXGridRef Neg(Void);
SFXGrid::Add | SFXGrid::Sub | SFXGrid::Mul | SFXGrid::Div | SFXGrid::Mod | SFXGrid::NegX | SFXGrid::NegY
[ public ] SFXGridRef NegX(Void);
SFXGrid::AddX | SFXGrid::SubX | SFXGrid::MulX | SFXGrid::DivX | SFXGrid::ModX | SFXGrid::Neg | SFXGrid::NegY
[ public ] SFXGridRef NegY(Void);
SFXGrid::AddY | SFXGrid::SubY | SFXGrid::MulY | SFXGrid::DivY | SFXGrid::ModY | SFXGrid::Neg | SFXGrid::NegX
[ public ] SFXGridRef Set( SFXGridConstRef param // grid to set );
[ public ] SFXGridRef Set( SInt16 x // X coordinate to set SInt16 y // Y coordinate to set );
[ public ] SFXGridRef Set( SFXSizeConstRef size // width and height to set );
If the arguments are specified by the SFXSize class, the width will be set to X coordinate, and the height will be set to Y coordinate.
[ public ] SFXGridRef SetLeftBottom( SFXPixelConstRef param // coordinates of left-bottom point to set );
[ public ] SFXGridRef SetLeftBottom( SInt16 x // X coordinate of left-bottom point to set SInt16 y // Y coordinate of left-bottom point to set );
[ public ] SFXGridRef SetLeftTop( SFXPixelConstRef param // coordinates of left-top point to set );
[ public ] SFXGridRef SetLeftTop( SInt16 x // X coordinate of left-top point to set SInt16 y // Y coordinate of left-top point to set );
[ public ] SFXGridRef SetRightBottom( SFXPixelConstRef param // coordinates of right-bottom point to set );
[ public ] SFXGridRef SetRightBottom( SInt16 x // X coordinate of right-bottom point to set SInt16 y // Y coordinate of right-bottom point to set );
[ public ] SFXGridRef SetRightTop( SFXPixelConstRef param // coordinates of right-top point to set );
[ public ] SFXGridRef SetRightTop( SInt16 x // X coordinate of right-top point to set SInt16 y // Y coordinate of right-top point to set );
[ public ] SFXGridRef SetX( SInt16 param // X coordinate to set );
[ public ] SFXGridRef SetY( SInt16 param // Y coordinate to set );
[ public ] SFXGridRef Sub( SFXGridConstRef param // value to subtract from the coordinates );
[ public ] SFXGridRef Sub( SInt16 x // value to subtract from the X coordinate SInt16 y // value to subtract from the Y coordinate );
[ public ] SFXGridRef Sub( SFXSizeConstRef size // value to subtract from the coordinates );
SFXGrid::Add | SFXGrid::SubX | SFXGrid::SubY | SFXGrid::Mul | SFXGrid::Div | SFXGrid::Mod | SFXGrid::Neg
[ public ] SFXGridRef SubX( SInt16 param // value to subtract from the X coordinate );
SFXGrid::AddX | SFXGrid::Sub | SFXGrid::SubY | SFXGrid::MulX | SFXGrid::DivX | SFXGrid::ModX | SFXGrid::NegX
[ public ] SFXGridRef SubY( SInt16 param // value to subtract from the Y coordinate );
SFXGrid::AddY | SFXGrid::Sub | SFXGrid::SubX | SFXGrid::MulY | SFXGrid::DivY | SFXGrid::ModY | SFXGrid::NegY
[ public, static ] SFXGridConstRef ZeroInstance(Void);
This function returns the 0 instance, which means that 0 or null is set to all the member variables of its corresponding AtomRec struct.
SFXGrid grid(10, 20); grid = SFXGrid::ZeroInstance(); // intialize grid TRACE("x = %d, y = %d", grid.GetX(), grid.GetY()); // x = 0, y = 0
[ public, friend ] SFXGrid::AtomRec * atomic_cast( SFXGrid * param // grid to cast );
[ public, friend ] SFXGrid::AtomRec const * atomic_cast( SFXGrid const * param // grid to cast );
[ public, friend ] AEEPoint * interface_cast( SFXGrid * param // grid to cast );
[ public, friend ] AEEPoint const * interface_cast( SFXGrid const * param // grid to cast );
[ public ] SFXGridRef operator=( SFXGridConstRef param // source grid );
[ public ] SFXGridRef operator=( SFXSizeConstRef size // width and height );
[ public ] SFXGridRef operator/=( SInt16 param // divide the coordinates by this value );
The behaviour is not defined when the value of value argument is 0.
SFXGrid::Div | operator/ | SFXGrid::operator*= | SFXGrid::operator%=
[ public, friend ] SFXGrid operator/( SFXGridConstRef left // grid to divide SInt16 right // divide the coordinates of the grid by this value );
The behaviour is not defined when the value of value argument is 0.
[ public, friend ] Bool operator==( SFXGridConstRef left // grid to compare SFXGridConstRef right // grid to compare );
[ public, friend ] Bool operator==( SFXGridConstRef left // grid to compare SFXSizeConstRef right // size );
When comparing with an object of SFXSize class, the grid X coordinate is compared with the width of SFXSize object, and the grid Y coordinate is compared with the htight of SFXSize object.
[ public ] SFXGridRef operator-=( SFXGridConstRef param // value to subtract from the coordinates );
[ public ] SFXGridRef operator-=( SFXSizeConstRef size // value to subtract from the coordinates );
[ public, const ] SFXGrid operator-(Void);
[ public, friend ] SFXGrid operator-( SFXGridConstRef left // grid to move SFXGridConstRef right // value to subtract from the coordinates of the grid );
[ public, friend ] SFXGrid operator-( SFXGridConstRef left // grid to move SFXSizeConstRef right // value to subtract from the coordinates of the grid );
[ public ] SFXGridRef operator%=( SInt16 param // divide the coordinates by this value );
The behaviour is not defined when the value of value argument is 0.
SFXGrid::Mod | SFXGrid::operator/= | SFXGrid::operator*= | operator%
[ public, friend ] SFXGrid operator%( SFXGridConstRef left // coordinates of the grid to divide SInt16 right // divide the coordinates by this value );
The operation when the right is zero has not been defined yet.
[ public ] SFXGridRef operator*=( SInt16 param // value to multiply with the coordinates );
SFXGrid::Mul | SFXGrid::operator/= | operator* | SFXGrid::operator%=
[ public, friend ] SFXGrid operator*( SFXGridConstRef left // coordinates of the grid SInt16 right // value to multiply with the coordinates of the grid );
[ public, friend ] Bool operator!=( SFXGridConstRef left // grid to compare SFXGridConstRef right // grid to compare );
[ public, friend ] Bool operator!=( SFXGridConstRef left // grid to compare SFXSizeConstRef right // compare size );
When compare with the SFXSize class, it compare the grid X coordinate with the width of SFXSize class, and the grid Y coordinate with the htight of SFXSize class.
[ public ] SFXGridRef operator+=( SFXGridConstRef param // value to add to the coordinate );
[ public ] SFXGridRef operator+=( SFXSizeConstRef size // value to add to the coordinate );
[ public, const ] SFXGrid operator+(Void);
[ public, friend ] SFXGrid operator+( SFXGridConstRef left // grid to move SFXGridConstRef right // value to add to the coordinates of the grid );
[ public, friend ] SFXGrid operator+( SFXGridConstRef left // grid to move SFXSizeConstRef right // value to add to the coordinate );
struct AtomRec { SInt16 x; // X coordinate SInt16 y; // Y coordinate };
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |