ValueFunctionSawTooth Class Reference

#include <valfunc.h>

Inheritance diagram for ValueFunctionSawTooth:

ValueFunctionRamp ValueFunction ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ValueFunctionSawTooth (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 ValueFunctionID GetUniqueID (void)
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.

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 (ValueFunctionSawTooth)

Detailed Description

Definition at line 496 of file valfunc.h.


Constructor & Destructor Documentation

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

Definition at line 501 of file valfunc.h.

00502                     :   ValueFunctionRamp(StartValue, EndValue)
00503                     {};


Member Function Documentation

ValueFunctionSawTooth::CC_DECLARE_DYNAMIC ValueFunctionSawTooth   )  [private]
 

ValueFunction * ValueFunctionSawTooth::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 1621 of file valfunc.cpp.

01622 {
01623     ValueFunction *pClone = new ValueFunctionSawTooth(Value1, Value2);
01624     return(pClone);
01625 }

ValueFunction * ValueFunctionSawTooth::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 1675 of file valfunc.cpp.

01676 {
01677     ERROR3IF(pInputRecord == NULL, "Illegal NULL param");
01678 
01679     float Value1 = (float) 1.0;
01680     float Value2 = (float) 0.0;
01681 
01682     pInputRecord->ReadFLOAT(&Value1);
01683     pInputRecord->ReadFLOAT(&Value2);
01684 
01685     return(new ValueFunctionSawTooth((double) Value1, (double) Value2));
01686 }

INT32 ValueFunctionSawTooth::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 1641 of file valfunc.cpp.

01642 {
01643     return 4;
01644 }

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

Implements ValueFunction.

Definition at line 508 of file valfunc.h.

00508 { return(ValueFunctionID_SawTooth); };

double ValueFunctionSawTooth::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: SawTooth is a half sine-wave "S" shaped function

Implements ValueFunction.

Definition at line 1593 of file valfunc.cpp.

01594 {
01595     if (Position == 1.0)
01596     {
01597         return 0.0;
01598     }
01599     else
01600     {
01601         double Value    = (9.0 * Position) - (floor(9.0 * Position));
01602         return(1.0 - (Value * Value));
01603     }
01604 }


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