#include <FunctionCurve.h>
Public Types | |
enum | FunctionType { Normal = 0, Parametric = 1, Polar = 2 } |
Public Member Functions | |
QMap< QString, double > | constants () |
void | copy (FunctionCurve *f) |
double | endRange () |
QStringList | formulas () |
FunctionCurve (const QString &name=QString()) | |
FunctionCurve (const FunctionType &t, const QString &name=QString()) | |
FunctionType | functionType () |
QString | legend () |
Returns a string that can be displayed in a plot legend. | |
void | loadData (int points=0, bool xLog10Scale=false) |
void | removeConstant (const QString &parName) |
void | removeConstants () |
QString | saveToString () |
Returns a string used when saving to a project file. | |
void | setConstant (const QString &parName, double val) |
void | setConstants (const QMap< QString, double > &map) |
void | setFormula (const QString &s) |
Provided for convenience when dealing with normal functions. | |
void | setFormulas (const QStringList &lst) |
void | setFunctionType (const FunctionType &t) |
void | setRange (double from, double to) |
void | setVariable (const QString &s) |
double | startRange () |
QString | variable () |
Static Public Member Functions | |
static void | restore (Graph *g, const QStringList &lst) |
Used when reading from a project file. | |
Private Attributes | |
QMap< QString, double > | d_constants |
QStringList | d_formulas |
double | d_from |
FunctionType | d_function_type |
double | d_to |
QString | d_variable |
FunctionCurve::FunctionCurve | ( | const FunctionType & | t, | |
const QString & | name = QString() | |||
) |
References Graph::Function, Graph::Line, PlotCurve::setPlotStyle(), and PlotCurve::setType().
Referenced by restore().
FunctionCurve::FunctionCurve | ( | const QString & | name = QString() |
) |
References d_formulas, Graph::Function, Graph::Line, PlotCurve::setPlotStyle(), and PlotCurve::setType().
QMap<QString, double> FunctionCurve::constants | ( | ) | [inline] |
References d_constants.
Referenced by copy(), Graph::modifyFunctionCurve(), restore(), FunctionDialog::setCurveToModify(), and FitDialog::updatePreview().
void FunctionCurve::copy | ( | FunctionCurve * | f | ) |
References constants(), d_constants, d_formulas, d_from, d_function_type, d_to, d_variable, endRange(), formulas(), functionType(), startRange(), and variable().
double FunctionCurve::endRange | ( | ) | [inline] |
References d_to.
Referenced by copy(), Graph::modifyFunctionCurve(), FunctionDialog::setCurveToModify(), and FitDialog::updatePreview().
QStringList FunctionCurve::formulas | ( | ) | [inline] |
References d_formulas.
Referenced by copy(), Graph::modifyFunctionCurve(), restore(), TranslateCurveTool::selectDestination(), FunctionDialog::setCurveToModify(), and FitDialog::updatePreview().
FunctionType FunctionCurve::functionType | ( | ) | [inline] |
References d_function_type.
Referenced by copy(), Graph::modifyFunctionCurve(), TranslateCurveTool::selectDestination(), and FunctionDialog::setCurveToModify().
QString FunctionCurve::legend | ( | ) |
Returns a string that can be displayed in a plot legend.
References d_formulas, d_function_type, d_variable, Normal, Parametric, and Polar.
Referenced by Graph::modifyFunctionCurve().
void FunctionCurve::loadData | ( | int | points = 0 , |
|
bool | xLog10Scale = false | |||
) |
References d_constants, d_formulas, d_from, d_function_type, d_to, d_variable, MyParser::EvalRemoveSingularity(), ScaleTransformation::Log10, Normal, Parametric, Polar, and ScaleEngine::type().
Referenced by Graph::addFunction(), NonLinearFit::insertFitFunctionCurve(), Fit::insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), Graph::modifyFunctionCurve(), restore(), TranslateCurveTool::selectDestination(), AxesDialog::updateMinorTicksList(), and FitDialog::updatePreview().
void FunctionCurve::removeConstant | ( | const QString & | parName | ) | [inline] |
References d_constants.
void FunctionCurve::removeConstants | ( | ) | [inline] |
References d_constants.
Referenced by FitDialog::updatePreview().
void FunctionCurve::restore | ( | Graph * | g, | |
const QStringList & | lst | |||
) | [static] |
Used when reading from a project file.
References constants(), Graph::curveIndex(), formulas(), FunctionCurve(), Graph::insertCurve(), loadData(), PlotCurve::restoreCurveLayout(), setConstants(), Graph::setCurveStyle(), setFormulas(), PlotCurve::setPlotStyle(), setRange(), setVariable(), PlotCurve::type(), and Graph::updatePlot().
Referenced by ApplicationWindow::openGraph().
QString FunctionCurve::saveToString | ( | ) |
Returns a string used when saving to a project file.
References d_constants, d_formulas, d_from, d_function_type, d_to, d_variable, ScaleTransformation::Log10, PlotCurve::saveCurveLayout(), and ScaleEngine::type().
void FunctionCurve::setConstant | ( | const QString & | parName, | |
double | val | |||
) | [inline] |
References d_constants.
Referenced by NonLinearFit::insertFitFunctionCurve(), Fit::insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), and FitDialog::updatePreview().
void FunctionCurve::setConstants | ( | const QMap< QString, double > & | map | ) | [inline] |
References d_constants.
Referenced by Graph::modifyFunctionCurve(), and restore().
void FunctionCurve::setFormula | ( | const QString & | s | ) | [inline] |
Provided for convenience when dealing with normal functions.
References d_formulas.
Referenced by Fit::insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), TranslateCurveTool::selectDestination(), and FitDialog::updatePreview().
void FunctionCurve::setFormulas | ( | const QStringList & | lst | ) | [inline] |
References d_formulas.
Referenced by Graph::addFunction(), Graph::modifyFunctionCurve(), and restore().
void FunctionCurve::setFunctionType | ( | const FunctionType & | t | ) | [inline] |
References d_function_type.
Referenced by Graph::modifyFunctionCurve().
void FunctionCurve::setRange | ( | double | from, | |
double | to | |||
) |
void FunctionCurve::setVariable | ( | const QString & | s | ) | [inline] |
References d_variable.
Referenced by Graph::addFunction(), Graph::modifyFunctionCurve(), and restore().
double FunctionCurve::startRange | ( | ) | [inline] |
References d_from.
Referenced by copy(), Graph::modifyFunctionCurve(), FunctionDialog::setCurveToModify(), and FitDialog::updatePreview().
QString FunctionCurve::variable | ( | ) | [inline] |
References d_variable.
Referenced by copy(), Graph::modifyFunctionCurve(), and FunctionDialog::setCurveToModify().
QMap<QString, double> FunctionCurve::d_constants [private] |
Referenced by constants(), copy(), loadData(), removeConstant(), removeConstants(), saveToString(), setConstant(), and setConstants().
QStringList FunctionCurve::d_formulas [private] |
Referenced by copy(), formulas(), FunctionCurve(), legend(), loadData(), saveToString(), setFormula(), and setFormulas().
double FunctionCurve::d_from [private] |
Referenced by copy(), loadData(), saveToString(), setRange(), and startRange().
FunctionType FunctionCurve::d_function_type [private] |
Referenced by copy(), functionType(), legend(), loadData(), saveToString(), and setFunctionType().
double FunctionCurve::d_to [private] |
Referenced by copy(), endRange(), loadData(), saveToString(), and setRange().
QString FunctionCurve::d_variable [private] |
Referenced by copy(), legend(), loadData(), saveToString(), setVariable(), and variable().