ValueFunctionRampL Class Reference

#include <valfunc.h>

Inheritance diagram for ValueFunctionRampL:

ValueFunctionRamp ValueFunction ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

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

Detailed Description

Definition at line 450 of file valfunc.h.


Constructor & Destructor Documentation

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

Definition at line 455 of file valfunc.h.

00456                     :   ValueFunctionRamp(StartValue, EndValue)
00457                     {};


Member Function Documentation

ValueFunctionRampL::CC_DECLARE_DYNAMIC ValueFunctionRampL   )  [private]
 

ValueFunction * ValueFunctionRampL::Clone void   )  [virtual]
 

Clone operator. Creates an exact copy of this object.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/2/97
Returns:
NULL if it failed, else an exact copy of this object

Implements ValueFunction.

Definition at line 1421 of file valfunc.cpp.

01422 {
01423     ValueFunction *pClone = new ValueFunctionRampL(Value1, Value2);
01424     return(pClone);
01425 }

ValueFunction * ValueFunctionRampL::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:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/2/97
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 1456 of file valfunc.cpp.

01457 {
01458     ERROR3IF(pInputRecord == NULL, "Illegal NULL param");
01459 
01460     float Value1 = (float) 1.0;
01461     float Value2 = (float) 0.0;
01462 
01463     pInputRecord->ReadFLOAT(&Value1);
01464     pInputRecord->ReadFLOAT(&Value2);
01465 
01466     return(new ValueFunctionRampL((double) Value1, (double) Value2));
01467 }

INT32 ValueFunctionRampL::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 1402 of file valfunc.cpp.

01403 {
01404     return 2;
01405 }

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

Implements ValueFunction.

Definition at line 463 of file valfunc.h.

00463 { return(ValueFunctionID_RampL); };

double ValueFunctionRampL::GetValue double  Position  )  [virtual]
 

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

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/2/97
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: RampL is a half sine-wave "S" shaped function

Implements ValueFunction.

Definition at line 1382 of file valfunc.cpp.

01383 {
01384     const double MixValue   = cos((Pi/2.0) + (Position * Pi/2.0)) + 1.0;
01385 
01386     return((MixValue * Value1) + ((1.0 - MixValue) * Value2));
01387 }


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