CPolygonFiller Class Reference

#include <bitstd.h>

class CPolygonFiller : public CBase

Inherits from

Member Enumeration Documentation

Enum TUsage

Describes how pixels are to be displayed in the polygon. aUsage should be select to one of these values before CPolygonFiller::Construct is used.

EnumeratorValueDescription
EGetAllPixelRunsSequentially

A request for all pixel runs in sequential order

EGetPixelRunsSequentiallyForSpecifiedScanLines

A request for all pixel runs in sequential order but only for specified lines.

Constructor & Destructor Documentation

CPolygonFiller ( )

IMPORT_CCPolygonFiller()

Constructor which initializes all member data to zero, EFalse or null for TInt, TBool pointers respectively.

~CPolygonFiller ( )

IMPORT_C~CPolygonFiller()

Destructor calls reset on the polygon.

Member Function Documentation

Construct ( const CArrayFix< TPoint > *, CGraphicsContext::TFillRule, TUsage )

IMPORT_C voidConstruct(const CArrayFix< TPoint > *aPointArray,
CGraphicsContext::TFillRuleaFillRule,
TUsageaUsage = EGetAllPixelRunsSequentially
)

An overloaded version of Construct which allows the list of points to be passed in as a point array. Exactly the same behaviour and structure as above. This should not fail. This method does not require the number of nodes to be given as a parameter.

Parameters
aFillRuleHow filling should be achieved, as described by a CGraphicsContext::TFillRule object.
aUsageHow the polygon should be used.

Construct ( const TPoint *, TInt, CGraphicsContext::TFillRule, TUsage )

IMPORT_C voidConstruct(const TPoint *aPointList,
TIntaNumPoints,
CGraphicsContext::TFillRuleaFillRule,
TUsageaUsage = EGetAllPixelRunsSequentially
)

Takes a list of points to be the points for the new polygon and sets the number of points in the shape. After this has been done it transfers the task to Construct(aFillRule,aUsage). This should not fail.

Parameters
aPointListA list of points for the polygon.
aNumPointsThe number of points in the list.
aFillRuleHow filling should be achieved, as described by a CGraphicsContext::TFillRule object.
aUsageHow the polygon should be used, see TUsage enumeration.

GetNextPixelRun ( TBool &, TInt &, TInt &, TInt & )

IMPORT_C voidGetNextPixelRun(TBool &aExists,
TInt &aScanLine,
TInt &aStart,
TInt &aEnd
)

Method is used to calculate the locations of vertex interactions between the polygon and scan lines. An initial scan line is required. It calculates the start and end positions on the line. The method can use either the fast or slow polygon algorithm depending upon the state of aUsage. Polygon filling is also addressed by this method.

Parameters
aExistsWill be set to false if a polygon with no vertexes is passed in, otherwise ETrue on return.
aStartThe position on the scan line to start the run, on returned.
aEndThe position on the scan line to end the run, returned.

GetNextPixelRunOnSpecifiedScanLine ( TBool &, TInt, TInt &, TInt & )

IMPORT_C voidGetNextPixelRunOnSpecifiedScanLine(TBool &aExists,
TIntaScanLine,
TInt &aStart,
TInt &aEnd
)

Similar to GetNextPixelRun(aExists, aScanLine, aStart, aEnd) this method is used to draw the relevant vertex intersections for a polygon but only for an individual specified scan line. The method can use either the fast or slow polygon algorithm depending upon the state of aUsage.

Parameters
aExistsWill be set to false if the line does not pass through the polygon or if a polygon with no vertices is specified, otherwise ETrue on return.
aStartThe position on the scan line to start the run, on returned.
aEndThe position on the scan line to end the run, returned.

Reset ( )

IMPORT_C voidReset()

Frees any data held in the polygons lists of all edges, vertexs and scan lines and sets these values to NULL. It also has the feature of setting iUseFastAlgorithm = EFalse.