TEllipse Class Reference

#include <bitstd.h>

Link against: bitgdi.lib

class TEllipse
Protected Attributes
TInt iA
TInt64 iASquBSqu
TInt64 iASquared
TInt iB
TInt64 iBSquared
TInt64 iD1
TInt64 iD2
TPoint iOffset
TEllipseStatus iStatus
TInt iX
TInt iXAdj
TInt iY
TInt iYAdj
Public Member Enumerations
enumTEllipseStatus { EInitialised, EFirstSector, ESecondSector, EComplete, ELine }
Public Member Functions
IMPORT_C voidConstruct(const TRect &)
IMPORT_C TPointIntersection(const TRect &, const TPoint &)
IMPORT_C TBoolNextStep(TPoint &, TPoint &, TPoint &, TPoint &)
IMPORT_C TBoolSingleStep(TPoint &, TPoint &, TPoint &, TPoint &)
Protected Member Functions
IMPORT_C TBoolOutput(TPoint &, TPoint &, TPoint &, TPoint &)

Member Attribute Documentation

iA

TInt iA[protected]

iASquBSqu

TInt64 iASquBSqu[protected]

iASquared

TInt64 iASquared[protected]

iB

TInt iB[protected]

iBSquared

TInt64 iBSquared[protected]

iD1

TInt64 iD1[protected]

iD2

TInt64 iD2[protected]

iOffset

TPoint iOffset[protected]

iStatus

TEllipseStatus iStatus[protected]

iX

TInt iX[protected]

iXAdj

TInt iXAdj[protected]

iY

TInt iY[protected]

iYAdj

TInt iYAdj[protected]

Member Enumeration Documentation

Enum TEllipseStatus

Enumeration for the ellipse production life cycle

EnumeratorValueDescription
EInitialised

Ellipse has been initialised but has no area

EFirstSector

The ellipse is drawn as two parabolas. These are in two sectors, the top and bottom half of the rectangle. The first sector means the top parabola has been produced.

ESecondSector

The parabola that occupies the bottom half of the rectangle has been produced.

EComplete

The ellipse is complete

ELine

The ellipse has either a height or width of two units or less and so takes the appearance of a line

Member Function Documentation

Construct ( const TRect & )

IMPORT_C voidConstruct(const TRect &aRect)

Initialises the values of the ellipse so that it conforms to a rectangle entered as a parameter.

Parameters
aRectthe rectangle within which the ellipse is drawn

Intersection ( const TRect &, const TPoint & )

IMPORT_C TPointIntersection(const TRect &aRect,
const TPoint &aPoint
)

Constructs an ellipse from the rectangle which it is given and assesses the points position with regard to the ellipse and where they intersect.

Parameters
aRectThe rectangle within which the ellipse is drawn.
aPointA point to compare with the ellipse to determine if intersection occurs.
Return Value
TPoint The point is set to the corner which the intersection is nearest to.

NextStep ( TPoint &, TPoint &, TPoint &, TPoint & )

IMPORT_C TBoolNextStep(TPoint &aTopLeft,
TPoint &aTopRight,
TPoint &aBottomLeft,
TPoint &aBottomRight
)

By analysing the current state of the ellipse the process is taken to the next appropriate step. If iStatus = EInitialised only one step will be taken, if the ellipse is already semi constructed then it will be taken to completion. Takes in four point parameters that defines the rectangle in order to pass to SingleStep(aTopLeft,aTopRight,aBottomLeft,aBottomRight).

Parameters
aTopLeftTop left corner of rectangle
aTopRightTop right corner of rectangle
aBottomLeftBottom left corner of rectangle
aBottomRightBottom right corner of rectangle
Return Value
TBool ETrue if a valid rectangle is produced, else EFalse.

Output ( TPoint &, TPoint &, TPoint &, TPoint & )

IMPORT_C TBoolOutput(TPoint &aTopLeft,
TPoint &aTopRight,
TPoint &aBottomLeft,
TPoint &aBottomRight
)[protected]

Sets the absolute points that define the ellipse as calculated using its iOffset from the origin and using the half width and half height of the rectangle iA and iB.

Parameters
aTopLeftThe absolute (x,y) position for the top left point.
aTopRightThe absolute (x,y) position for the top right point.
aBottomLeftThe absolute (x,y) position for the bottom left point.
aBottomRightThe absolute (x,y) position for the bottom right point.
Return Value
TBool ETrue if a valid rectangle is produced, else EFalse. Also sets iStatus to EComplete.

SingleStep ( TPoint &, TPoint &, TPoint &, TPoint & )

IMPORT_C TBoolSingleStep(TPoint &aTopLeft,
TPoint &aTopRight,
TPoint &aBottomLeft,
TPoint &aBottomRight
)

Does the next stage in producing an ellipse by taking four points (the corners of the rectangle the ellipse should fill) as parameters. Updates TEllipse status accordingly and calls Output(aTopLeft,aTopRight,aBottomLeft,aBottomRight).

Parameters
aTopLeftTop left corner of rectangle
aTopRightTop right corner of rectangle
aBottomLeftBottom left corner of rectangle
aBottomRightBottom right corner of rectangle
Return Value
TBool ETrue if step completed successfully.