OpenCurves  0.9
PlotFunction Class Reference

A function called to operation on any number of plot expressions. More...

#include <plotfunction.h>

Inheritance diagram for PlotFunction:
PlotExpression

Public Member Functions

 PlotFunction (const FunctionDefinition *function, const QVector< PlotExpression * > &args=QVector< PlotExpression * >())
 Create a function expression. More...
 
 ~PlotFunction ()
 Destructor, releasing all args().
 
const FunctionDefinitionfunction () const
 The FunctionDefinition underpinning this expression object. More...
 
virtual BindResult bind (const QList< PlotInstance * > &curves, PlotBindingTracker &bindTracker, PlotExpressionBindDomain &info, bool repeatLastBinding=false)
 Bind the argument expressions for the function.
 
virtual void unbind ()
 Unbind arguments.
 
virtual double sample (double sampleTime) const
 Sample at sampleTime. More...
 
const QVector< PlotExpression * > & args () const
 Get the argument expressions.
 
QVector< PlotExpression * > cloneArgs () const
 Clone the arguments.
 
virtual PlotExpressionclone () const
 Deep clone, including arguments.
 
- Public Member Functions inherited from PlotExpression
 PlotExpression ()
 Empty constructor.
 
virtual ~PlotExpression ()
 Empty, virtual destructor.
 
QString toString () const
 Converts the PlotExpression into a parseable string form. More...
 
virtual bool explicitTime () const
 Is the curve generated with explicit time values? More...
 

Detailed Description

A function called to operation on any number of plot expressions.

This inserts a FunctionDefinition to the expression tree. It supports appropriate binding and parameter evaluation for the definition.

Expression binding is managed by binding each of the args() expressions (if any) with the binding domain as the union of the arguments' domain. Sampling is achieved by sampling each of the args(), then calling FunctionDefinition::evaluate() with the results.

The number of args() in the expression must match that of the FunctionDefinition.

Constructor & Destructor Documentation

PlotFunction::PlotFunction ( const FunctionDefinition function,
const QVector< PlotExpression * > &  args = QVector< PlotExpression * >() 
)

Create a function expression.

The number of args must match the minimum for the function. The function must outlive this object.

Parameters
functionThe function definition.
argsExpressions used to evaluate the arguments.

Member Function Documentation

const FunctionDefinition* PlotFunction::function ( ) const
inline

The FunctionDefinition underpinning this expression object.

Returns
The function definition.
virtual double PlotFunction::sample ( double  sampleTime) const
virtual

Sample at sampleTime.

This samples all args() expressions at sampleTime, then filters the result through the function() object.

Implements PlotExpression.


The documentation for this class was generated from the following file: