CPolygonFiller Class Reference

class CPolygonFiller : public CBase

Inherits from

Public Member Functions
CPolygonFiller()
~CPolygonFiller()
IMPORT_C voidConstruct(const CArrayFix< TPoint > *, CGraphicsContext::TFillRule, TUsage)
IMPORT_C voidConstruct(const TPoint *, TInt, CGraphicsContext::TFillRule, TUsage)
IMPORT_C voidGetNextPixelRun(TBool &, TInt &, TInt &, TInt &)
IMPORT_C voidGetNextPixelRunOnSpecifiedScanLine(TBool &, TInt, TInt &, TInt &)
IMPORT_C voidReset()
Private Member Functions
voidConstruct(CGraphicsContext::TFillRule, TUsage)
voidFastHandleVertexIntersection(TInt &, TBool)
voidJumpToCurrentScanLine(TLinearDDA &, const TPoint &, const TPoint &, TPoint &, TPoint &)
const TPoint &Point(TInt)
voidSetFastIntersection(SFastActiveEdge &, SFastScanLineIntersection &)
voidSlowHandleVertexIntersection(SSlowScanLineIntersection &, TInt &, TBool)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTUsage { EGetAllPixelRunsSequentially, EGetPixelRunsSequentiallyForSpecifiedScanLines }
Private Attributes
TInt iCurrentScanLine
SFastData iFastData
CGraphicsContext::TFillRule iFillRule
TInt iFirstScanLine
TInt iFirstVertex
TInt iLastScanLine
TInt iNestingLevel
TInt iNumVertexes
const CArrayFix< TPoint > *iPointArray
const TPoint *iPointList
TBool iPolygonIsAllHorizontal
TInt iRightMostPixelOnScanLine
TInt iScanLineIntersection
SSlowData iSlowData
TBool iToggler
TBool iUseFastAlgorithm

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

const CArrayFix< TPoint > * aPointArray
CGraphicsContext::TFillRule aFillRuleHow filling should be achieved, as described by a CGraphicsContext::TFillRule object.
TUsage aUsage = EGetAllPixelRunsSequentiallyHow 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

const TPoint * aPointListA list of points for the polygon.
TInt aNumPointsThe number of points in the list.
CGraphicsContext::TFillRule aFillRuleHow filling should be achieved, as described by a CGraphicsContext::TFillRule object.
TUsage aUsage = EGetAllPixelRunsSequentiallyHow the polygon should be used, see TUsage enumeration.

Construct(CGraphicsContext::TFillRule, TUsage)

voidConstruct(CGraphicsContext::TFillRuleaFillRule,
TUsageaUsage
)[private]

Parameters

CGraphicsContext::TFillRule aFillRule
TUsage aUsage

FastHandleVertexIntersection(TInt &, TBool)

voidFastHandleVertexIntersection(TInt &aCurrentActiveEdge,
TBoolaIsLowerVertex
)[private]

Parameters

TInt & aCurrentActiveEdge
TBool aIsLowerVertex

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

TBool & aExistsWill be set to false if a polygon with no vertexes is passed in, otherwise ETrue on return.
TInt & aScanLine
TInt & aStartThe position on the scan line to start the run, on returned.
TInt & 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

TBool & 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.
TInt aScanLine
TInt & aStartThe position on the scan line to start the run, on returned.
TInt & aEndThe position on the scan line to end the run, returned.

JumpToCurrentScanLine(TLinearDDA &, const TPoint &, const TPoint &, TPoint &, TPoint &)

voidJumpToCurrentScanLine(TLinearDDA &aLineGenerator,
const TPoint &aUpper,
const TPoint &aLower,
TPoint &aStartPos,
TPoint &aEndPos
)const [private]

Parameters

TLinearDDA & aLineGenerator
const TPoint & aUpper
const TPoint & aLower
TPoint & aStartPos
TPoint & aEndPos

Point(TInt)

const TPoint &Point(TIntaIndex)[private]

Parameters

TInt aIndex

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.

SetFastIntersection(SFastActiveEdge &, SFastScanLineIntersection &)

voidSetFastIntersection(SFastActiveEdge &aActiveEdge,
SFastScanLineIntersection &aScanLineIntersection
)[private]

Parameters

SFastActiveEdge & aActiveEdge
SFastScanLineIntersection & aScanLineIntersection

SlowHandleVertexIntersection(SSlowScanLineIntersection &, TInt &, TBool)

voidSlowHandleVertexIntersection(SSlowScanLineIntersection &aScanLineIntersection,
TInt &aVertexStartingCurrentEdge,
TBoolaIsLowerVertex
)[private]

Parameters

SSlowScanLineIntersection & aScanLineIntersection
TInt & aVertexStartingCurrentEdge
TBool aIsLowerVertex

Member Enumerations 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.

Enumerators

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.

Member Data Documentation

TInt iCurrentScanLine

TInt iCurrentScanLine[private]

SFastData iFastData

SFastData iFastData[private]

CGraphicsContext::TFillRule iFillRule

CGraphicsContext::TFillRule iFillRule[private]

TInt iFirstScanLine

TInt iFirstScanLine[private]

TInt iFirstVertex

TInt iFirstVertex[private]

TInt iLastScanLine

TInt iLastScanLine[private]

TInt iNestingLevel

TInt iNestingLevel[private]

TInt iNumVertexes

TInt iNumVertexes[private]

const CArrayFix< TPoint > * iPointArray

const CArrayFix< TPoint > *iPointArray[private]

const TPoint * iPointList

const TPoint *iPointList[private]

TBool iPolygonIsAllHorizontal

TBool iPolygonIsAllHorizontal[private]

TInt iRightMostPixelOnScanLine

TInt iRightMostPixelOnScanLine[private]

TInt iScanLineIntersection

TInt iScanLineIntersection[private]

SSlowData iSlowData

SSlowData iSlowData[private]

TBool iToggler

TBool iToggler[private]

TBool iUseFastAlgorithm

TBool iUseFastAlgorithm[private]