CHuiCurvePath Class Reference

class CHuiCurvePath : public CBase

CHuiCurvePath is a 2D path composed out of line segments and ellipse arcs. Each segment can have a length factor that causes it to be shorter or longer than its real length.

Inherits from

Nested Classes and Structures

Public Member Functions
CHuiCurvePath()
~CHuiCurvePath()
IMPORT_C voidAppendArcL(const TPoint &, const TSize &, TReal32, TReal32, TReal32)
IMPORT_C voidAppendArcL(const THuiRealPoint &, const THuiRealSize &, TReal32, TReal32, TReal32)
IMPORT_C voidAppendLineL(const TPoint &, const TPoint &, TReal32)
IMPORT_C voidAppendLineL(const THuiRealPoint &, const THuiRealPoint &, TReal32)
IMPORT_C voidDraw(const TPoint &, CHuiGc *)
IMPORT_C voidEnableLoop(TBool)
IMPORT_C voidEvaluate(TReal32, THuiRealPoint &)
IMPORT_C const CHuiVisual *GetVisual()
IMPORT_C TBoolIsLegacyApiUsed()
IMPORT_C TReal32Length()
IMPORT_C TBoolLoop()
IMPORT_C TReal32MapValue(TReal32, TInt)
IMPORT_C TBoolMappingFunctionChanged()
IMPORT_C voidMappingFunctionClearChanged()
IMPORT_C TBoolNeedUpdate()
IMPORT_C CHuiCurvePath *NewL()
IMPORT_C CHuiCurvePath *NewLC()
IMPORT_C voidReset()
IMPORT_C voidSetNeedsUpdate()
IMPORT_C voidSetOrigin(TReal32)
IMPORT_C voidSetVisual(const CHuiVisual *)
IMPORT_C voidUpdate(TReal32, TReal32, TReal32, MHuiMappingFunction *, MHuiMappingFunction *)
Protected Member Functions
IMPORT_C TReal32CalculateLength()
IMPORT_C voidCurvePathExtension(const TUid &, TAny **)
IMPORT_C voidEvaluateSegment(TReal32, const TSegment &, THuiRealPoint &, THuiRealPoint *)
IMPORT_C TSegmentSegment(TInt)
IMPORT_C TIntSegmentCount()
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()
Protected Member Enumerations
enumTSegmentType { ESegmentTypeLine, ESegmentTypeArc }
Public Attributes
THuiTimedPoint iOffset
Private Attributes
TBool iChanged
THuiCurvePathExtension *iExtension
TBool iNeedUpdate
TReal32 iPosOrigin
RArray< TSegment >iSegments
TInt iSpare
TReal32 iTotalLength

Constructor & Destructor Documentation

CHuiCurvePath()

IMPORT_CCHuiCurvePath()

Constructor. Not exported.

~CHuiCurvePath()

IMPORT_C~CHuiCurvePath()

Destructor.

Member Functions Documentation

AppendArcL(const TPoint &, const TSize &, TReal32, TReal32, TReal32)

IMPORT_C voidAppendArcL(const TPoint &aOrigin,
const TSize &aSize,
TReal32aStartAngle,
TReal32aEndAngle,
TReal32aLength = -1
)

Appends a curve segment to the path.

Parameters

const TPoint & aOriginOrigin of the arc ellipse.
const TSize & aSizeHoriz and vert radii of the arc ellipse.
TReal32 aStartAngleStart angle of the arc (degrees).
TReal32 aEndAngleEnd angle of the arc (degrees).
TReal32 aLength = -1Negative length means that the length will be the actual length of the arc.

AppendArcL(const THuiRealPoint &, const THuiRealSize &, TReal32, TReal32, TReal32)

IMPORT_C voidAppendArcL(const THuiRealPoint &aOrigin,
const THuiRealSize &aSize,
TReal32aStartAngle,
TReal32aEndAngle,
TReal32aLength = -1
)

Appends a curve segment to the path. Note that the coordinate values should match to the metrics unit type of the visual that uses this class.

Parameters

const THuiRealPoint & aOriginOrigin of the arc ellipse.
const THuiRealSize & aSizeHoriz and vert radii of the arc ellipse.
TReal32 aStartAngleStart angle of the arc (degrees).
TReal32 aEndAngleEnd angle of the arc (degrees).
TReal32 aLength = -1Negative length means that the length will be the actual length of the arc.

AppendLineL(const TPoint &, const TPoint &, TReal32)

IMPORT_C voidAppendLineL(const TPoint &aStart,
const TPoint &aEnd,
TReal32aLength = -1
)

Appends a line segment to the path.

Parameters

const TPoint & aStart
const TPoint & aEnd
TReal32 aLength = -1Negative length means that the length will be the actual length of the line segment.

AppendLineL(const THuiRealPoint &, const THuiRealPoint &, TReal32)

IMPORT_C voidAppendLineL(const THuiRealPoint &aStart,
const THuiRealPoint &aEnd,
TReal32aLength = -1
)

Appends a line segment to the path. Note that the coordinate values should match to the metrics unit type of the visual that uses this class.

Parameters

const THuiRealPoint & aStartStart point of the line segment.
const THuiRealPoint & aEndEnd point of the line segment.
TReal32 aLength = -1Negative length means that the length will be the actual length of the line segment.

CalculateLength()

IMPORT_C TReal32CalculateLength()const [protected]

Determines the total length of the path by summing the lengths of all the segments.

CurvePathExtension(const TUid &, TAny **)

IMPORT_C voidCurvePathExtension(const TUid &aExtensionUid,
TAny **aExtensionParams
)[protected, virtual]

Provides expandability, helps keeping the binary compatibility. Since virtual table is now exported and this class is dll derivable and the implementation is more difficult to change, hence this method, which can provide additional extension APIs.

Parameters

const TUid & aExtensionUidUID, which is being used for recognizing the extension
TAny ** aExtensionParamsReturn pointer to the extension API, once recognized from the extension uid

Draw(const TPoint &, CHuiGc *)

IMPORT_C voidDraw(const TPoint &aOrigin,
CHuiGc *aGc
)const [virtual]

Draws the path's triangles.

Parameters

const TPoint & aOrigin
CHuiGc * aGc

EnableLoop(TBool)

IMPORT_C voidEnableLoop(TBoolaEnable = ETrue)

Enables or disables looping of the path. Looping means that all positions are wrapped to the path, so that, e.g., positions past the end are wrapped to the beginning of the path. Looping is enabled by default.

Parameters

TBool aEnable = ETrue

Evaluate(TReal32, THuiRealPoint &)

IMPORT_C voidEvaluate(TReal32aPos,
THuiRealPoint &aPoint
)const

Evaluates a point along the curve path.

Parameters

TReal32 aPosPosition along the path.
THuiRealPoint & aPointX and Y coordinates of the point on the path.

EvaluateSegment(TReal32, const TSegment &, THuiRealPoint &, THuiRealPoint *)

IMPORT_C voidEvaluateSegment(TReal32aPos,
const TSegment &aSegment,
THuiRealPoint &aPoint,
THuiRealPoint *aNormal = 0
)const [protected]

Evaluates a point on a segment.

Parameters

TReal32 aPosPosition.
const TSegment & aSegmentSegment (arc or line).
THuiRealPoint & aPointResult point.
THuiRealPoint * aNormal = 0If specified, returns the normal of the path point.

GetVisual()

IMPORT_C const CHuiVisual *GetVisual()const

IsLegacyApiUsed()

IMPORT_C TBoolIsLegacyApiUsed()const

Length()

IMPORT_C TReal32Length()const

Determines the total length of the path.

Loop()

IMPORT_C TBoolLoop()const

Determines if the path is wrapped.

MapValue(TReal32, TInt)

IMPORT_C TReal32MapValue(TReal32aValue,
TIntaComponent
)const

Parameters

TReal32 aValue
TInt aComponent

MappingFunctionChanged()

IMPORT_C TBoolMappingFunctionChanged()const

MappingFunctionClearChanged()

IMPORT_C voidMappingFunctionClearChanged()

NeedUpdate()

IMPORT_C TBoolNeedUpdate()const

Determines if the path needs updating.

NewL()

IMPORT_C CHuiCurvePath *NewL()[static]

Constructor.

NewLC()

IMPORT_C CHuiCurvePath *NewLC()[static]

Constructor. The new brush is left on the cleanup stack.

Reset()

IMPORT_C voidReset()[virtual]

Resets the path by removing all segments.

Segment(TInt)

IMPORT_C TSegmentSegment(TIntaIndex)const [protected]

Returns a segment.

Parameters

TInt aIndex

SegmentCount()

IMPORT_C TIntSegmentCount()const [protected]

Returns the number of segments.

SetNeedsUpdate()

IMPORT_C voidSetNeedsUpdate()

Called when the path needs updating.

SetOrigin(TReal32)

IMPORT_C voidSetOrigin(TReal32aPosOrigin)

Sets the position that is at path location zero.

Parameters

TReal32 aPosOriginAdded to positions when evaluating.

SetVisual(const CHuiVisual *)

IMPORT_C voidSetVisual(const CHuiVisual *aVisual)const

Parameters

const CHuiVisual * aVisual

Update(TReal32, TReal32, TReal32, MHuiMappingFunction *, MHuiMappingFunction *)

IMPORT_C voidUpdate(TReal32aStartPos,
TReal32aEndPos,
TReal32aAlphaFactor,
MHuiMappingFunction *aAlphaFunction,
MHuiMappingFunction *aWidthFunction
)[virtual]

Recalculate the path's vertices and colors.

Parameters

TReal32 aStartPos
TReal32 aEndPos
TReal32 aAlphaFactor
MHuiMappingFunction * aAlphaFunction
MHuiMappingFunction * aWidthFunction

Member Enumerations Documentation

Enum TSegmentType

Segment type.

Enumerators

ESegmentTypeLine
ESegmentTypeArc

Member Data Documentation

TBool iChanged

TBool iChanged[private]

Flag to determine if the path has changed.

THuiCurvePathExtension * iExtension

THuiCurvePathExtension *iExtension[private]

TBool iNeedUpdate

TBool iNeedUpdate[private]

THuiTimedPoint iOffset

THuiTimedPoint iOffset

Offset to the entire path.

TReal32 iPosOrigin

TReal32 iPosOrigin[private]

Path location origin.

RArray< TSegment > iSegments

RArray< TSegment >iSegments[private]

Array of line and arc segments.

TInt iSpare

TInt iSpare[private]

Spare member to help keeping binary compatibility, since HuiCurvePath is now dll derivable

TReal32 iTotalLength

TReal32 iTotalLength[private]