ValueFunctionThumbtack 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 ValueFunctionThumbtack:

ValueFunctionBlip ValueFunction ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

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 ValueFunctionThumbtack & ValueFunctionThumbtackS.

Private Member Functions

 CC_DECLARE_DYNAMIC (ValueFunctionThumbtack)

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:
26/2/97
This derived class returns a Thumbtack shape built of 2 quarter circles back to back:

/\ __- -__

Definition at line 804 of file valfunc.h.


Member Function Documentation

ValueFunctionThumbtack::CC_DECLARE_DYNAMIC ValueFunctionThumbtack   )  [private]
 

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

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

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/2/97
Returns:
NULL if it failed, else a pointer to new ValueFunctionThumbtack object of the same type as "this" one. Used to allow derived Thumbtack 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 2792 of file valfunc.cpp.

02793 {   
02794     return(new ValueFunctionThumbtack);
02795 }

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

Reimplemented from ValueFunctionBlip.

Definition at line 811 of file valfunc.h.

00811 { return(ValueFunctionID_Thumbtack); };

double ValueFunctionThumbtack::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:
26/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 2758 of file valfunc.cpp.

02759 {
02760     if (Position < MaxPos)
02761         Position = Position / MaxPos;
02762     else
02763         Position = 1.0 - ((Position - MaxPos) / (1.0 - MaxPos));
02764 
02765     if ( Position>1.0 )
02766         Position = 1.0;
02767     return 1.0 - sqrt(1-Position*Position);
02768 }


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