#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 | |
---|---|
enum | TEllipseStatus { EInitialised, EFirstSector, ESecondSector, EComplete, ELine } |
Public Member Functions | |
---|---|
IMPORT_C void | Construct(const TRect &) |
IMPORT_C TPoint | Intersection(const TRect &, const TPoint &) |
IMPORT_C TBool | NextStep(TPoint &, TPoint &, TPoint &, TPoint &) |
IMPORT_C TBool | SingleStep(TPoint &, TPoint &, TPoint &, TPoint &) |
Protected Member Functions | |
---|---|
IMPORT_C TBool | Output(TPoint &, TPoint &, TPoint &, TPoint &) |
TInt | iA | [protected] |
TInt64 | iASquBSqu | [protected] |
TInt64 | iASquared | [protected] |
TInt | iB | [protected] |
TInt64 | iBSquared | [protected] |
TInt64 | iD1 | [protected] |
TInt64 | iD2 | [protected] |
TPoint | iOffset | [protected] |
TEllipseStatus | iStatus | [protected] |
TInt | iX | [protected] |
TInt | iXAdj | [protected] |
TInt | iY | [protected] |
TInt | iYAdj | [protected] |
Enumeration for the ellipse production life cycle
Enumerator | Value | Description |
---|---|---|
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 |
IMPORT_C void | Construct | ( | const TRect & | aRect | ) |
Initialises the values of the ellipse so that it conforms to a rectangle entered as a parameter.
Parameters | |
---|---|
aRect | the rectangle within which the ellipse is drawn |
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 | |
---|---|
aRect | The rectangle within which the ellipse is drawn. |
aPoint | A point to compare with the ellipse to determine if intersection occurs. |
IMPORT_C TBool | NextStep | ( | 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 | |
---|---|
aTopLeft | Top left corner of rectangle |
aTopRight | Top right corner of rectangle |
aBottomLeft | Bottom left corner of rectangle |
aBottomRight | Bottom right corner of rectangle |
IMPORT_C TBool | Output | ( | 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 | |
---|---|
aTopLeft | The absolute (x,y) position for the top left point. |
aTopRight | The absolute (x,y) position for the top right point. |
aBottomLeft | The absolute (x,y) position for the bottom left point. |
aBottomRight | The absolute (x,y) position for the bottom right point. |
IMPORT_C TBool | SingleStep | ( | 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 | |
---|---|
aTopLeft | Top left corner of rectangle |
aTopRight | Top right corner of rectangle |
aBottomLeft | Bottom left corner of rectangle |
aBottomRight | Bottom right corner of rectangle |