OpenCurves  0.9
PlotConstant Class Reference

An expression yielding a constant numeric value. More...

#include <plotconstant.h>

Inheritance diagram for PlotConstant:
PlotExpression

Public Member Functions

 PlotConstant (double constant)
 Create a constant expression. More...
 
void setConstant (double constant)
 Sets the constant value. More...
 
double constant () const
 Get the constant value. More...
 
virtual double sample (double sampleTime) const
 Return the constant. More...
 
virtual BindResult bind (const QList< PlotInstance * > &curves, PlotBindingTracker &bindTracker, PlotExpressionBindDomain &info, bool repeatLastBinding=false)
 Always bound, but sets the domain sample count to 1.
 
virtual PlotExpressionclone () const
 Deep clone.
 
- Public Member Functions inherited from PlotExpression
 PlotExpression ()
 Empty constructor.
 
virtual ~PlotExpression ()
 Empty, virtual destructor.
 
virtual void unbind ()
 Unbinds the sampling state once sampling has completed. More...
 
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

An expression yielding a constant numeric value.

The constant has no specific domain and its range depends on other domains in the expression tree.

Constructor & Destructor Documentation

PlotConstant::PlotConstant ( double  constant)
inline

Create a constant expression.

Parameters
constantThe value to return from sample().

Member Function Documentation

double PlotConstant::constant ( ) const
inline

Get the constant value.

Returns
The value to return from sample().

Referenced by setConstant().

virtual double PlotConstant::sample ( double  sampleTime) const
virtual

Return the constant.

Returns
constant().

Implements PlotExpression.

void PlotConstant::setConstant ( double  constant)
inline

Sets the constant value.

Parameters
constantThe value to return from sample().

References constant().


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