#include <valfunc.h>
Inheritance diagram for ValueFunctionPropeller:
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 ValueFunction * | Clone (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 ValueFunction * | CreateAndReadFileRecord (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) |
Definition at line 519 of file valfunc.h.
|
Definition at line 524 of file valfunc.h. 00525 : ValueFunctionRamp(StartValue, EndValue) 00526 {};
|
|
|
|
Clone operator. Creates 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 }
|
|
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.
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 }
|
|
Overriden function to indicate to the path stroker how many recursions to perform at minimum before declaring a line segment 'flat' enough.
Reimplemented from ValueFunction. Definition at line 1753 of file valfunc.cpp.
|
|
Implements ValueFunction. Definition at line 533 of file valfunc.h. 00533 { return(ValueFunctionID_Propeller); };
|
|
To read the value of this function at a given position.
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 }
|