ValueFunctionPropeller Class Reference

#include <valfunc.h>

Inheritance diagram for ValueFunctionPropeller:

ValueFunctionRamp ValueFunction ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ValueFunctionPropeller (double StartValue=1.0, double EndValue=0.0)
virtual double GetValue (double Position)
 To read the value of this function at a given position.
virtual ValueFunctionClone (void)
 Clone operator. Creates an exact copy of this object.
virtual INT32 GetMinimumRecursionDepth ()
 Overriden function to indicate to the path stroker how many recursions to perform at minimum before declaring a line segment 'flat' enough.
virtual ValueFunctionID GetUniqueID (void)

Protected Member Functions

virtual ValueFunctionCreateAndReadFileRecord (CXaraFileRecord *pInputRecord)
 Loads a ValueFunction object from a record which was saved into a file using the WriteFileRecord call. This is called by the base class loader routine ReadFileRecord, which finds an appropriate instance of a derived class to call to load the data in question.

Private Member Functions

 CC_DECLARE_DYNAMIC (ValueFunctionPropeller)

Detailed Description

Definition at line 519 of file valfunc.h.


Constructor & Destructor Documentation

ValueFunctionPropeller::ValueFunctionPropeller double  StartValue = 1.0,
double  EndValue = 0.0
[inline]
 

Definition at line 524 of file valfunc.h.

00525                     :   ValueFunctionRamp(StartValue, EndValue)
00526                     {};


Member Function Documentation

ValueFunctionPropeller::CC_DECLARE_DYNAMIC ValueFunctionPropeller   )  [private]
 

ValueFunction * ValueFunctionPropeller::Clone void   )  [virtual]
 

Clone operator. Creates an exact copy of this object.

Author:
Priestley (Xara Group Ltd) <camelotdev@xara.com> from Jason
Date:
9/10/2000
Returns:
NULL if it failed, else an exact copy of this object

Implements ValueFunction.

Definition at line 1772 of file valfunc.cpp.

01773 {
01774     ValueFunction *pClone = new ValueFunctionPropeller(Value1, Value2);
01775     return(pClone);
01776 }

ValueFunction * ValueFunctionPropeller::CreateAndReadFileRecord CXaraFileRecord pInputRecord  )  [protected, virtual]
 

Loads a ValueFunction object from a record which was saved into a file using the WriteFileRecord call. This is called by the base class loader routine ReadFileRecord, which finds an appropriate instance of a derived class to call to load the data in question.

Author:
Priestley (Xara Group Ltd) <camelotdev@xara.com> from Jason
Date:
9/10/2000
Parameters:
pInputRecord - The file record to read [INPUTS]
Returns:
NULL if it failed, else a pointer to new ValueFunction object representing whatever was saved in that record.
This method creates a new instance of this particular ValueFunction class and then loads whatever information is necessary from the file to initialise itself properly. The record read-pointer is left pointing at the end of the ValueFunction-saved data so that the caller can continue reading their extra bytes of data after loading the ValueFunction.

See also:
ValueFunctionRamp::WriteFileRecord

Implements ValueFunction.

Definition at line 1807 of file valfunc.cpp.

01808 {
01809     ERROR3IF(pInputRecord == NULL, "Illegal NULL param");
01810 
01811     float Value1 = (float) 1.0;
01812     float Value2 = (float) 0.0;
01813 
01814     pInputRecord->ReadFLOAT(&Value1);
01815     pInputRecord->ReadFLOAT(&Value2);
01816 
01817     return(new ValueFunctionPropeller((double) Value1, (double) Value2));
01818 }

INT32 ValueFunctionPropeller::GetMinimumRecursionDepth  )  [virtual]
 

Overriden function to indicate to the path stroker how many recursions to perform at minimum before declaring a line segment 'flat' enough.

Author:
Priestley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/10/2000

Reimplemented from ValueFunction.

Definition at line 1753 of file valfunc.cpp.

01754 {
01755     return 4;
01756 }

virtual ValueFunctionID ValueFunctionPropeller::GetUniqueID void   )  [inline, virtual]
 

Implements ValueFunction.

Definition at line 533 of file valfunc.h.

00533 { return(ValueFunctionID_Propeller); };

double ValueFunctionPropeller::GetValue double  Position  )  [virtual]
 

To read the value of this function at a given position.

Author:
Priestley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/10/2000
Parameters:
Position - A value between 0.0 and 1.0 [INPUTS]
Returns:
A value (between Value1 and Value2 given in the constructor) representing the value of the function at the given Position.
Notes: CurvedSawTooth is a half sine-wave "S" shaped function

Implements ValueFunction.

Definition at line 1707 of file valfunc.cpp.

01708 {
01709     double Value;
01710 
01711     if (Position < 0.15)
01712     {
01713         //Draw a curved beginning bit...
01714         Position = 1.0 - Position/0.15;
01715         if ( Position>1.0 )
01716             Position = 1.0;
01717         Value = sqrt(1-Position*Position);
01718     }
01719     else
01720     {
01721         if (Position > 0.85)
01722         {
01723             //Draw a curved end bit...
01724             Position = (Position - 0.85) / 0.15;
01725             if ( Position>1.0 )
01726                 Position = 1.0;
01727             Value = sqrt(1-Position*Position);
01728         }
01729         else
01730         {
01731             //Scale Position to be a value between 0 and 1 based on how far through between
01732             //0.15 and 0.85 it is...
01733             Position = (Position - 0.15) / 0.7;
01734             Value = (cos(Position * 2.0 * Pi) + 1.5) * 0.4;
01735         }
01736     }
01737     return Value;
01738 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:02:48 2007 for Camelot by  doxygen 1.4.4