SophiaFramework UNIVERSE 5.3 |
SFXPolygon class processes the vertices' coordinates as an array.
SFXPolygon does not allocate the internal heap. It is necessary to create an array that keeps the coordinates of the vertices.
The created array should not be deleted when it is in the scope of SFXPolygon class.
Constructor/Destructor |
---|
SFXPolygon( Void ) Constructor of the SFXPolygon class.
|
SFXPolygon(
SFXPolygonConstRef param
) Constructor of the SFXPolygon class.
|
SFXPolygon(
SFXPixelPtr vertex
, SInt16 length
) Constructor of the SFXPolygon class.
|
SFXPolygon(
SFXPolylineConstRef polyline
) Constructor of the SFXPolygon class.
|
Public Functions | |
---|---|
SFXPolygonRef |
AddVertex(
SInt16 index
, SFXPixelConstRef value
) Add the specified value to the coordinates of a vertex.
|
SFXPolygonRef |
AddVertex(
SInt16 index
, SInt16 x
, SInt16 y
) Add the specified value to the coordinates of a vertex.
|
SFXPolygonRef |
AddVertexX(
SInt16 index
, SInt16 value
) Add the specified value to the X coordinate of a vertex.
|
SFXPolygonRef |
AddVertexY(
SInt16 index
, SInt16 value
) Add the specified value to the Y coordinate of a vertex.
|
SFXPolygonRef |
DivVertex(
SInt16 index
, SInt16 x
, SInt16 y
) Divide the coordinates of a vertex by a specifed value.
|
SFXPolygonRef |
DivVertex(
SInt16 index
, SInt16 value
) Divide the coordinates of a vertex by a specifed value.
|
SFXPolygonRef |
DivVertexX(
SInt16 index
, SInt16 value
) Divide the X coordinate of a vertex by a specifed value.
|
SFXPolygonRef |
DivVertexY(
SInt16 index
, SInt16 value
) Divide the Y coordinate of a vertex by a specifed value.
|
static SFXPolygonConstRef |
EmptyInstance( Void ) Get an empty polygon.
|
Bool |
Equals(
SFXPolygonConstRef param
) Check whether this polygon equals the specified polygon or not.
|
Bool |
Equals(
SFXPixelConstPtr vertex
, SInt16 length
) Check whether this polygon equals the specified polygon or not.
|
SInt16 |
GetLength( Void ) Get the number of vertices.
|
SFXPixelPtr |
GetVertex( Void ) Get the coordinates of a vertex (vertices).
|
SFXPixelConstRef |
GetVertex(
SInt16 index
) Get the coordinates of a vertex (vertices).
|
SInt16 |
GetVertexX(
SInt16 index
) Get the X coordinate of a vertex.
|
SInt16 |
GetVertexY(
SInt16 index
) Get the Y coordinate of a vertex.
|
Bool |
IsEmpty( Void ) Check whether this polygon is empty or not.
|
SFXPolygonRef |
ModVertex(
SInt16 index
, SInt16 x
, SInt16 y
) Set the coordinates of a vertex to the remainder of the division of this coordinates by the specified value.
|
SFXPolygonRef |
ModVertex(
SInt16 index
, SInt16 value
) Set the coordinates of a vertex to the remainder of the division of this coordinates by the specified value.
|
SFXPolygonRef |
ModVertexX(
SInt16 index
, SInt16 value
) Set the X coordinate of a vertex to the remainder of the division of X coordinate by the specified value.
|
SFXPolygonRef |
ModVertexY(
SInt16 index
, SInt16 value
) Set the Y coordinate of a vertex to the remainder of the division of Y coordinate by the specified value.
|
SFXPolygonRef |
MulVertex(
SInt16 index
, SInt16 x
, SInt16 y
) Multiply the coordinates of a vertex by the specified value.
|
SFXPolygonRef |
MulVertex(
SInt16 index
, SInt16 value
) Multiply the coordinates of a vertex by the specified value.
|
SFXPolygonRef |
MulVertexX(
SInt16 index
, SInt16 value
) Multiply the X coordinate of the vertex by the specified value.
|
SFXPolygonRef |
MulVertexY(
SInt16 index
, SInt16 value
) Multiply the Y coordinate of a vertex by the specified value.
|
SFXPolygonRef |
NegVertex(
SInt16 index
) Negate the sign of the coordinates of a vertex.
|
SFXPolygonRef |
NegVertexX(
SInt16 index
) Negate the sign of the X coordinate of a vertex.
|
SFXPolygonRef |
NegVertexY(
SInt16 index
) Negate the sign of the Y coordinate of a vertex.
|
SFXPolygonRef |
Normalize( Void ) Nprmalize the polygon.
|
SFXPolygonRef |
Offset(
SFXGridConstRef param
) Add the specified value to the coordinates of all the vertices and move this polygon.
|
SFXPolygonRef |
Offset(
SInt16 x
, SInt16 y
) Add the specified value to the coordinates of all the vertices and move this polygon.
|
SFXPolygonRef |
Set(
SFXPolygonConstRef param
) Set the polygon.
|
SFXPolygonRef |
Set(
SFXPixelPtr vertex
, SInt16 length
) Set the polygon.
|
SFXPolygonRef |
Set(
SFXPolylineConstRef polyline
) Set the polygon.
|
SFXPolygonRef |
SetLength(
SInt16 param
) Set the number of vertices.
|
SFXPolygonRef |
SetVertex(
SFXPixelPtr param
) Set the coordinates of a vertex (vertices).
|
SFXPolygonRef |
SetVertex(
SInt16 index
, SFXPixelConstRef value
) Set the coordinates of a vertex (vertices).
|
SFXPolygonRef |
SetVertex(
SInt16 index
, SInt16 x
, SInt16 y
) Set the coordinates of a vertex (vertices).
|
SFXPolygonRef |
SetVertexX(
SInt16 index
, SInt16 value
) Set the X coordinate of the specified vertex.
|
SFXPolygonRef |
SetVertexY(
SInt16 index
, SInt16 value
) Set the Y coordinate of the specified vertex.
|
SFXPolygonRef |
SubVertex(
SInt16 index
, SFXPixelConstRef value
) Subtract the specified value from the coordinates of a vertex.
|
SFXPolygonRef |
SubVertex(
SInt16 index
, SInt16 x
, SInt16 y
) Subtract the specified value from the coordinates of a vertex.
|
SFXPolygonRef |
SubVertexX(
SInt16 index
, SInt16 value
) Subtract the specified value from the X coordinate of a vertex.
|
SFXPolygonRef |
SubVertexY(
SInt16 index
, SInt16 value
) Subtract the specified value from the Y coordinate of a vertex.
|
SFXPolygonRef |
Unoffset(
SFXGridConstRef param
) Subtract the specified value from the coordinates of all the vertices and move this polygon.
|
SFXPolygonRef |
Unoffset(
SInt16 x
, SInt16 y
) Subtract the specified value from the coordinates of all the vertices and move this polygon.
|
static SFXPolygonConstRef |
ZeroInstance( Void ) Get the instance that represents 0.
|
SFXPolygonRef |
operator+=(
SFXGridConstRef param
) Add the specified value to the coordinates of all the vertices and move this polygon.
|
SFXPolygonRef |
operator-=(
SFXGridConstRef param
) Subtract the specified value from the coordinates of all the vertices and move this polygon.
|
SFXPolygonRef |
operator=(
SFXPolygonConstRef param
) Assign the polygon.
|
SFXPixelRef |
operator[](
SInt16 index
) Get the coordinates of the specified vertex.
|
SFXPolygon::AtomRec * |
atomic_cast(
SFXPolygon * param
) Convert SFXPolygon into SFXPolygon::AtomRec.
|
SFXPolygon::AtomRec const * |
atomic_cast(
SFXPolygon const * param
) Convert SFXPolygon into SFXPolygon::AtomRec.
|
AEEPolygon * |
interface_cast(
SFXPolygon * param
) Convert the SFXPolygon into AEEPolygon.
|
AEEPolygon const * |
interface_cast(
SFXPolygon const * param
) Convert the SFXPolygon into AEEPolygon.
|
Bool |
operator==(
SFXPolygonConstRef left
, SFXPolygonConstRef right
) Check the "==" relation.
|
SFXPolygon |
operator-(
SFXPolygonConstRef left
, SFXGridConstRef right
) Subtract the specified value from the coordinates of all the vertices of a polygon and move this polygon.
|
Bool |
operator!=(
SFXPolygonConstRef left
, SFXPolygonConstRef right
) Check the "!=" relation.
|
SFXPolygon |
operator+(
SFXPolygonConstRef left
, SFXGridConstRef right
) Add the specified value to the coordinates of all the vertices of a polygon and move this polygon.
|
Types |
---|
AtomRec Structure that represents a polygon.
|
Global Functions | |
---|---|
SFXPolygon::AtomRec * |
atomic_cast(
SFXPolygon * param
) Convert SFXPolygon into SFXPolygon::AtomRec.
|
SFXPolygon::AtomRec const * |
atomic_cast(
SFXPolygon const * param
) Convert SFXPolygon into SFXPolygon::AtomRec.
|
AEEPolygon * |
interface_cast(
SFXPolygon * param
) Convert the SFXPolygon into AEEPolygon.
|
AEEPolygon const * |
interface_cast(
SFXPolygon const * param
) Convert the SFXPolygon into AEEPolygon.
|
Bool |
operator==(
SFXPolygonConstRef left
, SFXPolygonConstRef right
) Check the "==" relation.
|
SFXPolygon |
operator-(
SFXPolygonConstRef left
, SFXGridConstRef right
) Subtract the specified value from the coordinates of all the vertices of a polygon and move this polygon.
|
Bool |
operator!=(
SFXPolygonConstRef left
, SFXPolygonConstRef right
) Check the "!=" relation.
|
SFXPolygon |
operator+(
SFXPolygonConstRef left
, SFXGridConstRef right
) Add the specified value to the coordinates of all the vertices of a polygon and move this polygon.
|
[ public, explicit ] SFXPolygon(Void);
[ public ] SFXPolygon( SFXPolygonConstRef param // source polygon );
[ public, explicit ] SFXPolygon( SFXPixelPtr vertex // array of vertices SInt16 length // number of vertices );
[ public, explicit ] SFXPolygon( SFXPolylineConstRef polyline // source polyline );
[ public ] SFXPolygonRef AddVertex( SInt16 index // index of the vertex SFXPixelConstRef value // value to add to the coordinates of the vertex );
[ public ] SFXPolygonRef AddVertex( SInt16 index // index of the vertex SInt16 x // value to add to the X coordinate of the vertex SInt16 y // value to add to the Y coordinate of the vertex );
SFXPolygon::AddVertexX | SFXPolygon::AddVertexY | SFXPolygon::SubVertex | SFXPolygon::MulVertex | SFXPolygon::DivVertex | SFXPolygon::ModVertex | SFXPolygon::NegVertex
[ public ] SFXPolygonRef AddVertexX( SInt16 index // index of the vertex SInt16 value // value to add to the coordinates of the vertex );
SFXPolygon::AddVertex | SFXPolygon::AddVertexY | SFXPolygon::SubVertexX | SFXPolygon::MulVertexX | SFXPolygon::DivVertexX | SFXPolygon::ModVertexX | SFXPolygon::NegVertexX
[ public ] SFXPolygonRef AddVertexY( SInt16 index // index of the vertex SInt16 value // value to add to the coordinates of the vertex );
SFXPolygon::AddVertex | SFXPolygon::AddVertexX | SFXPolygon::SubVertexY | SFXPolygon::MulVertexY | SFXPolygon::DivVertexY | SFXPolygon::ModVertexY | SFXPolygon::NegVertexY
[ public ] SFXPolygonRef DivVertex( SInt16 index // index of the vertex SInt16 x // divide the X coordinate by this value SInt16 y // divide the Y coordinate by this value );
[ public ] SFXPolygonRef DivVertex( SInt16 index // index of the vertex SInt16 value // divide the coordinates by this value );
The behaviour is not defined when the value of x, y, or value argument is 0.
SFXPolygon::AddVertex | SFXPolygon::SubVertex | SFXPolygon::MulVertex | SFXPolygon::DivVertexX | SFXPolygon::DivVertexY | SFXPolygon::ModVertex | SFXPolygon::NegVertex
[ public ] SFXPolygonRef DivVertexX( SInt16 index // index of the vertex SInt16 value // divide the X coordinate by this value );
The behaviour is not defined when the value of value argument is 0.
SFXPolygon::AddVertexX | SFXPolygon::SubVertexX | SFXPolygon::MulVertexX | SFXPolygon::DivVertex | SFXPolygon::DivVertexY | SFXPolygon::ModVertexX | SFXPolygon::NegVertexX
[ public ] SFXPolygonRef DivVertexY( SInt16 index // index of the vertex SInt16 value // divide the Y coordinate by this value );
The behaviour is not defined when the value of value argument is 0.
SFXPolygon::AddVertexY | SFXPolygon::SubVertexY | SFXPolygon::MulVertexY | SFXPolygon::DivVertex | SFXPolygon::DivVertexX | SFXPolygon::ModVertexY | SFXPolygon::NegVertexY
[ public, static ] SFXPolygonConstRef EmptyInstance(Void);
Return an empty SFXPolygon instance, which means this shape has no area.
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.
[ public, const ] Bool Equals( SFXPolygonConstRef param // polygon to compare );
[ public, const ] Bool Equals( SFXPixelConstPtr vertex // vertices array of the polygon to compare SInt16 length // number of vertices of the polygon to compare );
[ public, const ] SInt16 GetLength(Void);
[ public, const ] SFXPixelPtr GetVertex(Void);
[ public, const ] SFXPixelConstRef GetVertex( SInt16 index // index of the vertex );
[ public, const ] Bool IsEmpty(Void);
[ public ] SFXPolygonRef ModVertex( SInt16 index // index of the vertex SInt16 x // divide X coordinate by this value SInt16 y // divide Y coordinate by this value );
[ public ] SFXPolygonRef ModVertex( SInt16 index // index of the vertex SInt16 value // divide the coordinates by this value );
The behaviour is not defined when the value of x, y, or value argument is 0.
SFXPolygon::AddVertex | SFXPolygon::SubVertex | SFXPolygon::MulVertex | SFXPolygon::DivVertex | SFXPolygon::ModVertexX | SFXPolygon::ModVertexY | SFXPolygon::NegVertex
[ public ] SFXPolygonRef ModVertexX( SInt16 index // index of the vertex SInt16 value // divide X coordinate by this value );
The behaviour is not defined when the value of value argument is 0.
SFXPolygon::AddVertexX | SFXPolygon::SubVertexX | SFXPolygon::MulVertexX | SFXPolygon::DivVertexX | SFXPolygon::ModVertex | SFXPolygon::ModVertexY | SFXPolygon::NegVertexX
[ public ] SFXPolygonRef ModVertexY( SInt16 index // index of the vertex SInt16 value // divide Y coordinate by this value );
The behaviour is not defined when the value of value argument is 0.
SFXPolygon::AddVertexY | SFXPolygon::SubVertexY | SFXPolygon::MulVertexY | SFXPolygon::DivVertexY | SFXPolygon::ModVertex | SFXPolygon::ModVertexX | SFXPolygon::NegVertexY
[ public ] SFXPolygonRef MulVertex( SInt16 index // index of the vertex SInt16 x // value to multiply with the X coordinate of the vertex SInt16 y // value to multiply with the Y coordinate of the vertex );
[ public ] SFXPolygonRef MulVertex( SInt16 index // index of the vertex SInt16 value // value to multiply with the coordinates of the vertex );
SFXPolygon::AddVertex | SFXPolygon::SubVertex | SFXPolygon::MulVertexX | SFXPolygon::MulVertexY | SFXPolygon::DivVertex | SFXPolygon::ModVertex | SFXPolygon::NegVertex
[ public ] SFXPolygonRef MulVertexX( SInt16 index // index of the vertex SInt16 value // value to multiply with the X coordinate of the vertex );
SFXPolygon::AddVertexX | SFXPolygon::SubVertexX | SFXPolygon::MulVertex | SFXPolygon::MulVertexY | SFXPolygon::DivVertexX | SFXPolygon::ModVertexX | SFXPolygon::NegVertexX
[ public ] SFXPolygonRef MulVertexY( SInt16 index // index of the vertex SInt16 value // value to multiply with the Y coordinate of the vertex );
SFXPolygon::AddVertexY | SFXPolygon::SubVertexY | SFXPolygon::MulVertex | SFXPolygon::MulVertexX | SFXPolygon::DivVertexY | SFXPolygon::ModVertexY | SFXPolygon::NegVertexY
[ public ] SFXPolygonRef NegVertex( SInt16 index // index of the vertex );
SFXPolygon::AddVertex | SFXPolygon::SubVertex | SFXPolygon::MulVertex | SFXPolygon::DivVertex | SFXPolygon::ModVertex | SFXPolygon::NegVertexX | SFXPolygon::NegVertexY
[ public ] SFXPolygonRef NegVertexX( SInt16 index // index of the vertex );
SFXPolygon::AddVertexX | SFXPolygon::SubVertexX | SFXPolygon::MulVertexX | SFXPolygon::DivVertexX | SFXPolygon::ModVertexX | SFXPolygon::NegVertex | SFXPolygon::NegVertexY
[ public ] SFXPolygonRef NegVertexY( SInt16 index // index of the vertex );
SFXPolygon::AddVertexY | SFXPolygon::SubVertexY | SFXPolygon::MulVertexY | SFXPolygon::DivVertexY | SFXPolygon::ModVertexY | SFXPolygon::NegVertex | SFXPolygon::NegVertexX
[ public ] SFXPolygonRef Normalize(Void);
Do nothing.
[ public ] SFXPolygonRef Offset( SFXGridConstRef param // value to add to the coordinates of all the vertices );
[ public ] SFXPolygonRef Offset( SInt16 x // value to add to the X coordinate of all the vertices SInt16 y // value to add to the Y coordinate of all the vertices );
[ public ] SFXPolygonRef Set( SFXPolygonConstRef param // polygon to set );
[ public ] SFXPolygonRef Set( SFXPixelPtr vertex // array of vertices to set SInt16 length // number of vertices to set );
[ public ] SFXPolygonRef Set( SFXPolylineConstRef polyline // polyline to set );
[ public ] SFXPolygonRef SetLength( SInt16 param // number of vertices to set );
[ public ] SFXPolygonRef SetVertex( SFXPixelPtr param // array of vertices to set );
[ public ] SFXPolygonRef SetVertex( SInt16 index // index of the vertex to set SFXPixelConstRef value // coordinates of the vertex to set );
[ public ] SFXPolygonRef SetVertex( SInt16 index // index of the vertex to set SInt16 x // X coordinate of the vertex to set SInt16 y // Y coordinate of the vertex to set );
[ public ] SFXPolygonRef SetVertexX( SInt16 index // index of the vertex to set SInt16 value // X coordinate of the vertex to set );
[ public ] SFXPolygonRef SetVertexY( SInt16 index // index of the vertex to set SInt16 value // Y coordinate of the vertex to set );
[ public ] SFXPolygonRef SubVertex( SInt16 index // index of the vertex SFXPixelConstRef value // value to subtract from the coordinates of the vertex );
[ public ] SFXPolygonRef SubVertex( SInt16 index // index of the vertex SInt16 x // value to subtract from the X coordinate of the vertex SInt16 y // value to subtract from the Y coordinate of the vertex );
SFXPolygon::AddVertex | SFXPolygon::SubVertexX | SFXPolygon::SubVertexY | SFXPolygon::MulVertex | SFXPolygon::DivVertex | SFXPolygon::ModVertex | SFXPolygon::NegVertex
[ public ] SFXPolygonRef SubVertexX( SInt16 index // index of the vertex SInt16 value // value to subtract from the X coordinate of the vertex );
SFXPolygon::AddVertexX | SFXPolygon::SubVertex | SFXPolygon::SubVertexY | SFXPolygon::MulVertexX | SFXPolygon::DivVertexX | SFXPolygon::ModVertexX | SFXPolygon::NegVertexX
[ public ] SFXPolygonRef SubVertexY( SInt16 index // index of the vertex SInt16 value // value to subtract from the Y coordinate of the vertex );
SFXPolygon::AddVertexY | SFXPolygon::SubVertex | SFXPolygon::SubVertexX | SFXPolygon::MulVertexY | SFXPolygon::DivVertexY | SFXPolygon::ModVertexY | SFXPolygon::NegVertexY
[ public ] SFXPolygonRef Unoffset( SFXGridConstRef param // value to subtract from the coordinates of all the vertices );
[ public ] SFXPolygonRef Unoffset( SInt16 x // value to subtract from the X coordinate of all the vertices SInt16 y // value to subtract from the Y coordinate of all the vertices );
[ public, static ] SFXPolygonConstRef 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.
SFXPixel vertex[] = { SFXPixel(40, 40), SFXPixel(40, 60), SFXPixel(50, 30), SFXPixel(60, 20), SFXPixel(30, 30) }; SFXPolygon polygon; // set polygon polygon.Set(vertex, lengthof(vertex)); // get number of vertices TRACE("Length = %d", polygon.GetLength()); // Length = 5 // initialize polygon polygon = SFXPolygon::ZeroInstance(); // get number of vertices TRACE("Length = %d", polygon.GetLength()); // Length = 0
[ public, friend ] SFXPolygon::AtomRec * atomic_cast( SFXPolygon * param // polygon to cast );
[ public, friend ] SFXPolygon::AtomRec const * atomic_cast( SFXPolygon const * param // polygon to cast );
[ public, friend ] AEEPolygon * interface_cast( SFXPolygon * param // polygon to cast );
[ public, friend ] AEEPolygon const * interface_cast( SFXPolygon const * param // polygon to cast );
[ public ] SFXPolygonRef operator=( SFXPolygonConstRef param // source polygon );
[ public, friend ] Bool operator==( SFXPolygonConstRef left // polygon to compare SFXPolygonConstRef right // polygon to compare );
[ public, const ] SFXPixelRef operator[]( SInt16 index // index of the vertex );
[ public ] SFXPolygonRef operator-=( SFXGridConstRef param // value to subtract from the coordinates of all the vertices );
[ public, friend ] SFXPolygon operator-( SFXPolygonConstRef left // polygon to move SFXGridConstRef right // value to subtract from the coordinates of all the vertices of the polygon );
[ public, friend ] Bool operator!=( SFXPolygonConstRef left // polygon to compare SFXPolygonConstRef right // polygon to compare );
[ public ] SFXPolygonRef operator+=( SFXGridConstRef param // value to add to the coordinates of all the vertices );
[ public, friend ] SFXPolygon operator+( SFXPolygonConstRef left // polygon to move SFXGridConstRef right // value to add to the coordinates of all the vertices of the polygon );
struct AtomRec { SInt16 length; // number of vertices SFXPixel::AtomRecPtr vertex; // array of vertices };
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |