OpenCurves
0.9
|
A function called to operation on any number of plot expressions. More...
#include <plotfunction.h>
Public Member Functions | |
PlotFunction (const FunctionDefinition *function, const QVector< PlotExpression * > &args=QVector< PlotExpression * >()) | |
Create a function expression. More... | |
~PlotFunction () | |
Destructor, releasing all args() . | |
const FunctionDefinition * | function () 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 PlotExpression * | clone () const |
Deep clone, including arguments. | |
![]() | |
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... | |
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
.
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.
function | The function definition. |
args | Expressions used to evaluate the arguments. |
|
inline |
The FunctionDefinition
underpinning this expression object.
|
virtual |
Sample at sampleTime
.
This samples all args()
expressions at sampleTime
, then filters the result through the function()
object.
Implements PlotExpression.