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 void AppendArcL (const TPoint &, const TSize &, TReal32 , TReal32 , TReal32 )
IMPORT_C void AppendArcL (const THuiRealPoint &, const THuiRealSize &, TReal32 , TReal32 , TReal32 )
IMPORT_C void AppendLineL (const TPoint &, const TPoint &, TReal32 )
IMPORT_C void AppendLineL (const THuiRealPoint &, const THuiRealPoint &, TReal32 )
IMPORT_C void Draw (const TPoint &, CHuiGc *)
IMPORT_C void EnableLoop ( TBool )
IMPORT_C void Evaluate ( TReal32 , THuiRealPoint &)
IMPORT_C const CHuiVisual * GetVisual ()
IMPORT_C TBool IsLegacyApiUsed ()
IMPORT_C TReal32 Length ()
IMPORT_C TBool Loop ()
IMPORT_C TReal32 MapValue ( TReal32 , TInt )
IMPORT_C TBool MappingFunctionChanged ()
IMPORT_C void MappingFunctionClearChanged ()
IMPORT_C TBool NeedUpdate ()
IMPORT_C CHuiCurvePath * NewL ()
IMPORT_C CHuiCurvePath * NewLC ()
IMPORT_C void Reset ()
IMPORT_C void SetNeedsUpdate ()
IMPORT_C void SetOrigin ( TReal32 )
IMPORT_C void SetVisual (const CHuiVisual *)
IMPORT_C void Update ( TReal32 , TReal32 , TReal32 , MHuiMappingFunction *, MHuiMappingFunction *)
Protected Member Functions
IMPORT_C TReal32 CalculateLength ()
IMPORT_C void CurvePathExtension (const TUid &, TAny **)
IMPORT_C void EvaluateSegment ( TReal32 , const TSegment &, THuiRealPoint &, THuiRealPoint *)
IMPORT_C TSegment Segment ( TInt )
IMPORT_C TInt SegmentCount ()
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
enum TSegmentType { 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_C CHuiCurvePath ( )

Constructor. Not exported.

~CHuiCurvePath()

IMPORT_C ~CHuiCurvePath ( )

Destructor.

Member Functions Documentation

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

IMPORT_C void AppendArcL ( const TPoint & aOrigin,
const TSize & aSize,
TReal32 aStartAngle,
TReal32 aEndAngle,
TReal32 aLength = -1
)

Appends a curve segment to the path.

Parameters

const TPoint & aOrigin Origin of the arc ellipse.
const TSize & aSize Horiz and vert radii of the arc ellipse.
TReal32 aStartAngle Start angle of the arc (degrees).
TReal32 aEndAngle End angle of the arc (degrees).
TReal32 aLength = -1 Negative length means that the length will be the actual length of the arc.

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

IMPORT_C void AppendArcL ( const THuiRealPoint & aOrigin,
const THuiRealSize & aSize,
TReal32 aStartAngle,
TReal32 aEndAngle,
TReal32 aLength = -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 & aOrigin Origin of the arc ellipse.
const THuiRealSize & aSize Horiz and vert radii of the arc ellipse.
TReal32 aStartAngle Start angle of the arc (degrees).
TReal32 aEndAngle End angle of the arc (degrees).
TReal32 aLength = -1 Negative length means that the length will be the actual length of the arc.

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

IMPORT_C void AppendLineL ( const TPoint & aStart,
const TPoint & aEnd,
TReal32 aLength = -1
)

Appends a line segment to the path.

Parameters

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

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

IMPORT_C void AppendLineL ( const THuiRealPoint & aStart,
const THuiRealPoint & aEnd,
TReal32 aLength = -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 & aStart Start point of the line segment.
const THuiRealPoint & aEnd End point of the line segment.
TReal32 aLength = -1 Negative length means that the length will be the actual length of the line segment.

CalculateLength()

IMPORT_C TReal32 CalculateLength ( ) const [protected]

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

CurvePathExtension(const TUid &, TAny **)

IMPORT_C void CurvePathExtension ( 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 & aExtensionUid UID, which is being used for recognizing the extension
TAny ** aExtensionParams Return pointer to the extension API, once recognized from the extension uid

Draw(const TPoint &, CHuiGc *)

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

Draws the path's triangles.

Parameters

const TPoint & aOrigin
CHuiGc * aGc

EnableLoop(TBool)

IMPORT_C void EnableLoop ( TBool aEnable = 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 void Evaluate ( TReal32 aPos,
THuiRealPoint & aPoint
) const

Evaluates a point along the curve path.

Parameters

TReal32 aPos Position along the path.
THuiRealPoint & aPoint X and Y coordinates of the point on the path.

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

IMPORT_C void EvaluateSegment ( TReal32 aPos,
const TSegment & aSegment,
THuiRealPoint & aPoint,
THuiRealPoint * aNormal = 0
) const [protected]

Evaluates a point on a segment.

Parameters

TReal32 aPos Position.
const TSegment & aSegment Segment (arc or line).
THuiRealPoint & aPoint Result point.
THuiRealPoint * aNormal = 0 If specified, returns the normal of the path point.

GetVisual()

IMPORT_C const CHuiVisual * GetVisual ( ) const

IsLegacyApiUsed()

IMPORT_C TBool IsLegacyApiUsed ( ) const

Length()

IMPORT_C TReal32 Length ( ) const

Determines the total length of the path.

Loop()

IMPORT_C TBool Loop ( ) const

Determines if the path is wrapped.

MapValue(TReal32, TInt)

IMPORT_C TReal32 MapValue ( TReal32 aValue,
TInt aComponent
) const

Parameters

TReal32 aValue
TInt aComponent

MappingFunctionChanged()

IMPORT_C TBool MappingFunctionChanged ( ) const

MappingFunctionClearChanged()

IMPORT_C void MappingFunctionClearChanged ( )

NeedUpdate()

IMPORT_C TBool NeedUpdate ( ) 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 void Reset ( ) [virtual]

Resets the path by removing all segments.

Segment(TInt)

IMPORT_C TSegment Segment ( TInt aIndex ) const [protected]

Returns a segment.

Parameters

TInt aIndex

SegmentCount()

IMPORT_C TInt SegmentCount ( ) const [protected]

Returns the number of segments.

SetNeedsUpdate()

IMPORT_C void SetNeedsUpdate ( )

Called when the path needs updating.

SetOrigin(TReal32)

IMPORT_C void SetOrigin ( TReal32 aPosOrigin )

Sets the position that is at path location zero.

Parameters

TReal32 aPosOrigin Added to positions when evaluating.

SetVisual(const CHuiVisual *)

IMPORT_C void SetVisual ( const CHuiVisual * aVisual ) const

Parameters

const CHuiVisual * aVisual

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

IMPORT_C void Update ( TReal32 aStartPos,
TReal32 aEndPos,
TReal32 aAlphaFactor,
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]