ValueFunctionRampLinear Class Reference

#include <valfunc.h>

Inheritance diagram for ValueFunctionRampLinear:

ValueFunctionRamp ValueFunction ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

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

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

Detailed Description

Definition at line 385 of file valfunc.h.


Constructor & Destructor Documentation

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

Definition at line 390 of file valfunc.h.

00391                     :   ValueFunctionRamp(StartValue, EndValue)
00392                     {};


Member Function Documentation

ValueFunctionRampLinear::CC_DECLARE_DYNAMIC ValueFunctionRampLinear   )  [private]
 

ValueFunction * ValueFunctionRampLinear::Clone void   )  [virtual]
 

Clone operator. Creates an exact copy of this object.

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

Implements ValueFunction.

Definition at line 1099 of file valfunc.cpp.

01100 {
01101     ValueFunction *pClone = new ValueFunctionRampLinear(Value1, Value2);
01102     return(pClone);
01103 }

ValueFunction * ValueFunctionRampLinear::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:
27/1/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 1134 of file valfunc.cpp.

01135 {
01136     ERROR3IF(pInputRecord == NULL, "Illegal NULL param");
01137 
01138     float Value1 = (float) 1.0;
01139     float Value2 = (float) 0.0;
01140 
01141     pInputRecord->ReadFLOAT(&Value1);
01142     pInputRecord->ReadFLOAT(&Value2);
01143 
01144     return(new ValueFunctionRampLinear((double) Value1, (double) Value2));
01145 }

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

Implements ValueFunction.

Definition at line 397 of file valfunc.h.

00397 { return(ValueFunctionID_RampLinear); };

double ValueFunctionRampLinear::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:
30/12/96
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: RampLinear is a linear interpolation between the start & end values

Implements ValueFunction.

Definition at line 1079 of file valfunc.cpp.

01080 {
01081     return(((1.0 - Position) * Value1) + (Position * Value2));
01082 }


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