TEllipse Class Reference

class TEllipse
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 &)
Public Member Enumerations
enumTEllipseStatus { EInitialised, EFirstSector, ESecondSector, EComplete, ELine }
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

Member Functions 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

const TRect & 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

const TRect & aRectThe rectangle within which the ellipse is drawn.
const TPoint & aPointA point to compare with the ellipse to determine if intersection occurs.

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

TPoint & aTopLeftTop left corner of rectangle
TPoint & aTopRightTop right corner of rectangle
TPoint & aBottomLeftBottom left corner of rectangle
TPoint & aBottomRightBottom right corner of rectangle

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

TPoint & aTopLeftThe absolute (x,y) position for the top left point.
TPoint & aTopRightThe absolute (x,y) position for the top right point.
TPoint & aBottomLeftThe absolute (x,y) position for the bottom left point.
TPoint & aBottomRightThe absolute (x,y) position for the bottom right point.

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

TPoint & aTopLeftTop left corner of rectangle
TPoint & aTopRightTop right corner of rectangle
TPoint & aBottomLeftBottom left corner of rectangle
TPoint & aBottomRightBottom right corner of rectangle

Member Enumerations Documentation

Enum TEllipseStatus

Enumeration for the ellipse production life cycle

Enumerators

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 Data Documentation

TInt iA

TInt iA[protected]

TInt64 iASquBSqu

TInt64 iASquBSqu[protected]

TInt64 iASquared

TInt64 iASquared[protected]

TInt iB

TInt iB[protected]

TInt64 iBSquared

TInt64 iBSquared[protected]

TInt64 iD1

TInt64 iD1[protected]

TInt64 iD2

TInt64 iD2[protected]

TPoint iOffset

TPoint iOffset[protected]

TEllipseStatus iStatus

TEllipseStatus iStatus[protected]

TInt iX

TInt iX[protected]

TInt iXAdj

TInt iXAdj[protected]

TInt iY

TInt iY[protected]

TInt iYAdj

TInt iYAdj[protected]