ValueFunctionTeardrop Class Reference

Provides an interface by which the caller can obtain the value of a given function at a given "position". More...

#include <valfunc.h>

Inheritance diagram for ValueFunctionTeardrop:

ValueFunctionBlip ValueFunction ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ValueFunctionTeardrop (double MaxPosition=0.20)
virtual double GetValue (double Position)
 To read the value of this function at a given position.
virtual ValueFunctionID GetUniqueID (void)

Protected Member Functions

virtual ValueFunctionBlipCreateInstance (void)
 Creates a new blank object of the same type as this one. Internal function used in ValueFunctionTeardrop & ValueFunctionTeardropS.

Private Member Functions

 CC_DECLARE_DYNAMIC (ValueFunctionTeardrop)

Detailed Description

Provides an interface by which the caller can obtain the value of a given function at a given "position".

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/12/96
This derived class returns a Teardrop shape: ___ / ---___ | ---___

Definition at line 707 of file valfunc.h.


Constructor & Destructor Documentation

ValueFunctionTeardrop::ValueFunctionTeardrop double  MaxPosition = 0.20  )  [inline]
 

Definition at line 712 of file valfunc.h.

00712 : ValueFunctionBlip(MaxPosition) {};


Member Function Documentation

ValueFunctionTeardrop::CC_DECLARE_DYNAMIC ValueFunctionTeardrop   )  [private]
 

ValueFunctionBlip * ValueFunctionTeardrop::CreateInstance void   )  [protected, virtual]
 

Creates a new blank object of the same type as this one. Internal function used in ValueFunctionTeardrop & ValueFunctionTeardropS.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/2/97
Returns:
NULL if it failed, else a pointer to new ValueFunctionTeardrop object of the same type as "this" one. Used to allow derived Teardrop classes to use all the base class code, and merely override the GetValue method.
Notes: Called by ValueFunctionBlip::Clone and CreateAndReadFileRecord, as this is the only action in those functions that depends on the type of the class that is being used

Reimplemented from ValueFunctionBlip.

Definition at line 2582 of file valfunc.cpp.

02583 {   
02584     return(new ValueFunctionTeardrop);
02585 }

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

Reimplemented from ValueFunctionBlip.

Definition at line 715 of file valfunc.h.

00715 { return(ValueFunctionID_Teardrop); };

double ValueFunctionTeardrop::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:
1/2/97
Parameters:
Position - A value between 0.0 and 1.0 [INPUTS]
Returns:
A value representing the value of the function at the given Position.

Reimplemented from ValueFunctionBlip.

Definition at line 2541 of file valfunc.cpp.

02542 {
02543     double Value;
02544     if (Position < MaxPos)
02545     {
02546         Position = 1.0 - Position/MaxPos;
02547         if ( Position>1.0 )
02548             Position = 1.0;
02549         Value = sqrt(1-Position*Position);
02550     }
02551     else
02552     {
02553         Position = (Position - MaxPos) / (1.0 - MaxPos);
02554         Value = (cos( Position * Pi) + 1.0) / 2.0;
02555     }
02556 
02557     return Value;
02558 }


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