ValueFunctionBevelEnds Class Reference

#include <valfunc.h>

Inheritance diagram for ValueFunctionBevelEnds:

ValueFunctionRamp ValueFunction ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

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

Detailed Description

Definition at line 565 of file valfunc.h.


Constructor & Destructor Documentation

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

Definition at line 570 of file valfunc.h.

00571                     :   ValueFunctionRamp(StartValue, EndValue)
00572                     {};


Member Function Documentation

ValueFunctionBevelEnds::CC_DECLARE_DYNAMIC ValueFunctionBevelEnds   )  [private]
 

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

02193 {
02194     ValueFunction *pClone = new ValueFunctionBevelEnds(Value1, Value2);
02195     return(pClone);
02196 }

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

02245 {
02246     ERROR3IF(pInputRecord == NULL, "Illegal NULL param");
02247 
02248     float Value1 = (float) 1.0;
02249     float Value2 = (float) 0.0;
02250 
02251     pInputRecord->ReadFLOAT(&Value1);
02252     pInputRecord->ReadFLOAT(&Value2);
02253 
02254     return(new ValueFunctionBevelEnds((double) Value1, (double) Value2));
02255 }

INT32 ValueFunctionBevelEnds::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 2211 of file valfunc.cpp.

02212 {
02213     return 4;
02214 }

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

Implements ValueFunction.

Definition at line 579 of file valfunc.h.

00579 { return(ValueFunctionID_BevelEnds); };

double ValueFunctionBevelEnds::GetValue double  Position  )  [virtual]
 

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

Author:
Priestley (Xara Group Ltd) <camelotdev@xara.com> from Jason
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: Blobby is a half sine-wave "S" shaped function

Implements ValueFunction.

Definition at line 2145 of file valfunc.cpp.

02146 {
02147     double Value;
02148 
02149     if (Position == 1.0)
02150     {
02151         Value = 0.0;
02152     }
02153     else
02154     {
02155         if (Position < 0.15)
02156         {
02157             Position = Position / 0.15;
02158             Value = Position;
02159         }
02160         else
02161         {
02162             if (Position > 0.85)
02163             {
02164                 Position = (Position - 0.85) / 0.15;
02165                 Value = 1.0 - Position;
02166             }
02167             else
02168             {
02169                 Value = 1.0;
02170             }
02171         }
02172     }
02173 
02174     return Value;
02175 }


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