MorphElement

class MorphElement: public DataElement

Implements a morphable data element.  Morph elements can either have the initial shape of a bar or a pie slice and can then morph to the other shape.

Inherits from DataElement.

Summary
MorphElementImplements a morphable data element.
Functions
MorphElementInitializes the object as a copy of a bar data element.
MorphElementInitializes the object as a copy of a pie slice data element.
~MorphElementReleases all allocated resources.
DrawDraws the morph element.
DrawLabelsUnused function.
ChangePositionChanges the position of the morph element.
ScaleScales the object.
ChangeAlphaChanges the alpha value of the morph element.
MorphMorphs the object to the shape of the result morph element by moving the single vertices according to the morph steps.
GetAllPointsReturns all vertices of the morph element.
GetVertexCountReturns the total number of vertices of the element.
GetResultElementReturns the pointer to the specified result morph element.

Functions

MorphElement

MorphElement(DataEntry *pDataEntry,
MorphElement *pResultElement,
int iVerticesPerSide,
float fLeft,
float fTop,
float fBottom,
float fWidth)

Initializes the object as a copy of a bar data element.

Parameters

pDataEntryPointer to the data entry object that shall be represented by the morph element.
pResultElementPointer to the morph element whose shape shall be the result of the morphing process.
iVerticesPerSideNumber of vertices of the bar.
fLeftThe x value of the bar.
fTopThe upper y value of the bar.
fBottomThe lower y value of the bar.
fWidthThe width of the bar.

MorphElement

MorphElement(DataEntry *pDataEntry,
MorphElement *pResultElement,
int iVerticesPerSide,
float fBeginValue,
float fWidth)

Initializes the object as a copy of a pie slice data element.

Parameters

pDataEntryPointer to the data entry object that shall be represented by the morph element.
pResultElementPointer to the morph element whose shape shall be the result of the morphing process.
iVerticesPerSideNumber of outter vertices of the pie slice.
fBeginValueAccumulated data entry values of predecessor pie slices.
fWidthData entry value of the pie slice.

~MorphElement

~MorphElement()

Releases all allocated resources.

Draw

void Draw(QPainter *pPainter)

Draws the morph element.  Inherited from AlterableObject.

Parameters

pPainterThe QPainter object that shall be used for painting.

DrawLabels

void DrawLabels(QPainter *pPainter)

Unused function.  Inherited from AlterableObject.

Parameters

pPainterUnused parameter.

ChangePosition

void ChangePosition(float fDeltaLeft,  
float fDeltaTop,  
float fDeltaBottom =  0.0f)

Changes the position of the morph element.  Inherited from AlterableObject.

Parameters

fDeltaLeftTotal horizontal distance.
fDeltaTopTotal vertical distance according to the upper vertices.
fDeltaBottomTotal vertical distance according to the lower vertices.  Default value is 0.0f.

Scale

void Scale(float fDeltaWidth,
float fDeltaHeight)

Scales the object.  Inherited from DataElement.

Parameters

fDeltaWidthTotal horizontal scaling value.
fDeltaHeightTotal vertical scaling value.

ChangeAlpha

void ChangeAlpha(float fDeltaAlpha)

Changes the alpha value of the morph element.  Inherited from AlterableObject.

Parameters

fDeltaAlphaChange of alpha value.  Default value is 0.0f.

Morph

void Morph(glm::vec2 *vMorphSteps)

Morphs the object to the shape of the result morph element by moving the single vertices according to the morph steps.

Parameters

vMorphStepsAn array containing X and Y moving offsets for every vertex of the morph element.

GetAllPoints

glm::vec4* GetAllPoints()

Returns all vertices of the morph element.

Returns

An array containing all vertices of the morph element.

GetVertexCount

int GetVertexCount()

Returns the total number of vertices of the element.

Returns

The total number of vertices of the element.

GetResultElement

MorphElement* GetResultElement()

Returns the pointer to the specified result morph element.

Returns

The pointer to the specified result morph element.  For a specified result morph element itself, this returns NULL.

class MorphElement: public DataElement
Implements a morphable data element.
MorphElement(DataEntry *pDataEntry,
MorphElement *pResultElement,
int iVerticesPerSide,
float fLeft,
float fTop,
float fBottom,
float fWidth)
Initializes the object as a copy of a bar data element.
~MorphElement()
Releases all allocated resources.
void Draw(QPainter *pPainter)
Draws the morph element.
void DrawLabels(QPainter *pPainter)
Unused function.
void ChangePosition(float fDeltaLeft,  
float fDeltaTop,  
float fDeltaBottom =  0.0f)
Changes the position of the morph element.
void Scale(float fDeltaWidth,
float fDeltaHeight)
Scales the object.
void ChangeAlpha(float fDeltaAlpha)
Changes the alpha value of the morph element.
void Morph(glm::vec2 *vMorphSteps)
Morphs the object to the shape of the result morph element by moving the single vertices according to the morph steps.
glm::vec4* GetAllPoints()
Returns all vertices of the morph element.
int GetVertexCount()
Returns the total number of vertices of the element.
MorphElement* GetResultElement()
Returns the pointer to the specified result morph element.
class DataElement: public AlterableObject
Abstract class that implements the skeleton of a data element.
class AlterableObject
Abstract class that implements the skeleton of an alterable object, i.e.
Close