tFunction Class Reference

mathematical function (to be moved into tools sometime, and currently limited to linear functions) More...

#include <tFunction.h>

List of all members.

Public Member Functions

 tFunction ()
 constructor
 tFunction (REAL offset, REAL slope)
 constructor
 ~tFunction ()
 destructor
REAL Evaluate (REAL argument) const
 evaluates the function
REAL operator() (REAL argument) const
 evaluation operator
tFunctionSetOffset (REAL const &offset)
 Sets offset value.
REAL const & GetOffset (void) const
 Gets offset value.
tFunction const & GetOffset (REAL &offset) const
 Gets offset value.
tFunctionSetSlope (REAL const &slope)
 Sets function slope.
REAL const & GetSlope (void) const
 Gets function slope.
tFunction const & GetSlope (REAL &slope) const
 Gets function slope.

Public Attributes

REAL offset_
 offset value
REAL slope_
 function slope


Detailed Description

mathematical function (to be moved into tools sometime, and currently limited to linear functions)

Definition at line 35 of file tFunction.h.


Constructor & Destructor Documentation

tFunction::tFunction ( void   ) 

constructor

Definition at line 13 of file tFunction.cpp.

00014         : offset_(0), slope_(0)
00015 {
00016 }

tFunction::tFunction ( REAL  offset,
REAL  slope 
)

constructor

Definition at line 27 of file tFunction.cpp.

00028         : offset_(offset), slope_(slope)
00029 {
00030 }

tFunction::~tFunction ( void   ) 

destructor

Definition at line 41 of file tFunction.cpp.

00042 {
00043 }


Member Function Documentation

REAL tFunction::Evaluate ( REAL  argument  )  const

evaluates the function

Parameters:
argument 
Returns:

Definition at line 56 of file tFunction.cpp.

References offset_, and slope_.

Referenced by zShapePolygon::isInside(), zShapeCircle::isInteracting(), zShapePolygon::render(), zShapeCircle::render(), zShapePolygon::render2d(), and zShapeCircle::render2d().

00057 {
00058     return offset_ + slope_ * argument;
00059 }

Here is the caller graph for this function:

REAL tFunction::operator() ( REAL  argument  )  const [inline]

evaluation operator

function network message reading operator

Returns:
the function value

Definition at line 79 of file tFunction.h.

00080 {
00081     return Evaluate( argument );
00082 }

tFunction & tFunction::SetOffset ( REAL const &  offset  )  [inline]

Sets offset value.

Parameters:
offset offset value to set
Returns:
A reference to this to allow chaining

Definition at line 127 of file tFunction.h.

References offset_.

Referenced by zZoneInfluenceItemPosition::apply(), zZoneInfluenceItemScale::apply(), operator>>(), zZone::ReadSync(), gZone::ReadSync(), zZone::SetFunctionNow(), gZone::SetFunctionNow(), and gZone::SetReferenceTime().

00128 {
00129     this->offset_ = offset;
00130     return *this;
00131 }

Here is the caller graph for this function:

REAL const & tFunction::GetOffset ( void   )  const [inline]

Gets offset value.

Returns:
offset value

Definition at line 94 of file tFunction.h.

References offset_.

Referenced by zEffectorCycleAcceleration::effect(), operator<<(), and zZone::ReadSync().

00095 {
00096     return this->offset_;
00097 }

Here is the caller graph for this function:

tFunction const & tFunction::GetOffset ( REAL offset  )  const [inline]

Gets offset value.

Parameters:
offset offset value to fill
Returns:
A reference to this to allow chaining

Definition at line 110 of file tFunction.h.

References offset_.

00111 {
00112     offset = this->offset_;
00113     return *this;
00114 }

tFunction & tFunction::SetSlope ( REAL const &  slope  )  [inline]

Sets function slope.

Parameters:
slope function slope to set
Returns:
A reference to this to allow chaining

Definition at line 176 of file tFunction.h.

References slope_.

Referenced by zZoneInfluenceItemPosition::apply(), zZoneInfluenceItemScale::apply(), operator>>(), zZone::ReadSync(), gZone::ReadSync(), gZone::SetExpansionSpeed(), gZone::SetRotationAcceleration(), and gZone::SetVelocity().

00177 {
00178     this->slope_ = slope;
00179     return *this;
00180 }

Here is the caller graph for this function:

REAL const & tFunction::GetSlope ( void   )  const [inline]

Gets function slope.

Returns:
function slope

Definition at line 143 of file tFunction.h.

References slope_.

Referenced by gZone::GetExpansionSpeed(), gZone::GetRotationAcceleration(), gZone::GetVelocity(), operator<<(), zZone::ReadSync(), zZone::SetFunctionNow(), and gZone::SetFunctionNow().

00144 {
00145     return this->slope_;
00146 }

Here is the caller graph for this function:

tFunction const & tFunction::GetSlope ( REAL slope  )  const [inline]

Gets function slope.

Parameters:
slope function slope to fill
Returns:
A reference to this to allow chaining

Definition at line 159 of file tFunction.h.

References slope_.

00160 {
00161     slope = this->slope_;
00162     return *this;
00163 }


Member Data Documentation

REAL tFunction::offset_

offset value

Definition at line 46 of file tFunction.h.

Referenced by Evaluate(), GetOffset(), and SetOffset().

REAL tFunction::slope_

function slope

Definition at line 47 of file tFunction.h.

Referenced by Evaluate(), GetSlope(), and SetSlope().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:56:40 2008 for Armagetron Advanced by  doxygen 1.5.4