#include <valfunc.h>
Inheritance diagram for ValueFunctionRamp:
Public Member Functions | |
ValueFunctionRamp (double StartValue=1.0, double EndValue=0.0) | |
Constructor Ramp functions interpolate between two values in some fashion Derived classes provide such things as linear and sine-wave interpolations. | |
virtual BOOL | IsDifferent (ValueFunction *pOther) |
Comparator. Determines if 2 different ValueFunction objects are considered different. | |
virtual CamelotFileRecord * | WriteFileRecord (INT32 RecordTag, INT32 ExtraBytes, BaseCamelotFilter *pFilter) |
Saves a ValueFunction object to a Xara file. This function will create a new variable-sized record with the given record tag, and will write out whatever data is needed to save this ValueFunction's state to the file. | |
Protected Attributes | |
double | Value1 |
double | Value2 |
Private Member Functions | |
CC_DECLARE_DYNAMIC (ValueFunctionRamp) |
ValueFunctionRampS provides a half-sine-wave (S) ramp between 2 values
Definition at line 367 of file valfunc.h.
|
Constructor Ramp functions interpolate between two values in some fashion Derived classes provide such things as linear and sine-wave interpolations.
Definition at line 945 of file valfunc.cpp.
|
|
|
|
Comparator. Determines if 2 different ValueFunction objects are considered different.
Reimplemented from ValueFunction. Definition at line 974 of file valfunc.cpp. 00975 { 00976 if (ValueFunction::IsDifferent(pOther)) 00977 return(TRUE); 00978 00979 // Both objects are instances of this class, so compare them more carefully 00980 return( (Value1 != ((ValueFunctionRamp *)pOther)->Value1) || 00981 (Value2 != ((ValueFunctionRamp *)pOther)->Value2) ); 00982 }
|
|
Saves a ValueFunction object to a Xara file. This function will create a new variable-sized record with the given record tag, and will write out whatever data is needed to save this ValueFunction's state to the file.
All ValueFunction record data has 3 sections, whiich are recorded as follows: 1. ValueFunction header, identifying which type of VF is being saved INT32 ValueFunctionUniqueID (4 bytes) 2. Derived-class-data (0 or more bytes). This particular class adds: float Value1 float Value2 (8 bytes) 3. Caller data. This is written by the caller to the returned record object. This data must be ExtraBytes (0 or more) bytes in length. Implements ValueFunction. Definition at line 1027 of file valfunc.cpp. 01029 { 01030 ERROR3IF(pFilter == NULL, "Illegal NULL param"); 01031 ERROR3IF(ExtraBytes < 0, "Stupid ExtraBytes request in ValueFunction::WriteFileRecord"); 01032 01033 // Calculate how many bytes of information this VF will write. We do not include 01034 // the header info written by the base class or the ExtraInfo desired by the caller - 01035 // the base class adds all that in for us. 01036 const INT32 MyRecordSize = 8; 01037 01038 // Create an appropriate record, and write our data to it 01039 CamelotFileRecord *pRec = CreateAndWriteFileRecord(RecordTag, MyRecordSize, ExtraBytes, pFilter); 01040 01041 if (pRec != NULL) 01042 { 01043 BOOL ok = TRUE; 01044 if (ok) ok = pRec->WriteFLOAT((FLOAT) Value1); 01045 if (ok) ok = pRec->WriteFLOAT((FLOAT) Value2); 01046 01047 if (!ok) // If we failed, clean up & return NULL 01048 { 01049 delete pRec; 01050 pRec = NULL; 01051 } 01052 } 01053 01054 return(pRec); 01055 }
|
|
|
|
|