QtiPlot  0.9.8.2
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
FunctionCurve Class Reference

#include <FunctionCurve.h>

Inheritance diagram for FunctionCurve:
PlotCurve

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 FunctionType &t, const QString &name=QString())
 
 FunctionCurve (const QString &name=QString())
 
FunctionType functionType ()
 
QString legend ()
 Returns a string that can be displayed in a plot legend. More...
 
bool loadData (int points=0, bool xLog10Scale=false)
 
QString parameterName (int index)
 Returns the name of the parameter of rang index. More...
 
int parametersCount ()
 Returns the number of parameters in your function formula. More...
 
double parameterValue (int index)
 Returns the value of the parameter of rang index. More...
 
double parameterValue (const QString &name)
 Returns the value of the name parameter. More...
 
void removeConstant (const QString &parName)
 
void removeConstants ()
 
QString saveToString ()
 Returns a string used when saving to a project file. More...
 
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. More...
 
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 ()
 
- Public Member Functions inherited from PlotCurve
void enableSideLines (bool on)
 
 PlotCurve (const QString &name=QString())
 
int plotStyle ()
 The plot style of the curve. More...
 
void restoreCurveLayout (const QStringList &lst)
 
QString saveCurveLayout ()
 
QString saveCurveSymbolImage ()
 
void setPlotStyle (int s)
 
void setSkipSymbolsCount (int count)
 Set the number of symbols not to be drawn: usefull for large data sets. More...
 
void setType (int t)
 
void setXOffset (double dx)
 
void setYOffset (double dy)
 
bool sideLinesEnabled ()
 
int skipSymbolsCount ()
 Returns the number of symbols not to be drawn. More...
 
int type ()
 Sort of rtti() More...
 
double xOffset ()
 
double yOffset ()
 

Static Public Member Functions

static void restore (Graph *g, const QStringList &lst)
 Used when reading from a project file. More...
 

Private Attributes

QMap< QString, double > d_constants
 
QStringList d_formulas
 
double d_from
 
FunctionType d_function_type
 
double d_to
 
QString d_variable
 

Additional Inherited Members

- Protected Member Functions inherited from PlotCurve
QwtDoubleRect boundingRect () const
 
virtual void drawCurve (QPainter *p, int style, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
 
void drawSideLines (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
 
void drawSticks (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
 
virtual void drawSymbols (QPainter *p, const QwtSymbol &, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
 Draw symbols. More...
 
- Protected Attributes inherited from PlotCurve
int d_plot_style
 
bool d_side_lines
 
int d_skip_symbols
 
int d_type
 
double d_x_offset
 
double d_y_offset
 

Member Enumeration Documentation

◆ FunctionType

Enumerator
Normal 
Parametric 
Polar 

Constructor & Destructor Documentation

◆ FunctionCurve() [1/2]

FunctionCurve::FunctionCurve ( const FunctionType t,
const QString &  name = QString() 
)

◆ FunctionCurve() [2/2]

FunctionCurve::FunctionCurve ( const QString &  name = QString())

Member Function Documentation

◆ constants()

QMap<QString, double> FunctionCurve::constants ( )
inline

◆ copy()

void FunctionCurve::copy ( FunctionCurve f)

◆ endRange()

double FunctionCurve::endRange ( )
inline

◆ formulas()

QStringList FunctionCurve::formulas ( )
inline

◆ functionType()

FunctionType FunctionCurve::functionType ( )
inline

◆ legend()

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(), and setFunctionType().

◆ loadData()

bool FunctionCurve::loadData ( int  points = 0,
bool  xLog10Scale = false 
)

◆ parameterName()

QString FunctionCurve::parameterName ( int  index)

Returns the name of the parameter of rang index.

References d_constants.

Referenced by parametersCount().

◆ parametersCount()

int FunctionCurve::parametersCount ( )
inline

Returns the number of parameters in your function formula.

References d_constants, parameterName(), and parameterValue().

◆ parameterValue() [1/2]

double FunctionCurve::parameterValue ( int  index)

Returns the value of the parameter of rang index.

References d_constants.

Referenced by parametersCount().

◆ parameterValue() [2/2]

double FunctionCurve::parameterValue ( const QString &  name)

Returns the value of the name parameter.

References d_constants.

◆ removeConstant()

void FunctionCurve::removeConstant ( const QString &  parName)
inline

References d_constants.

◆ removeConstants()

void FunctionCurve::removeConstants ( )
inline

References d_constants, and d_function_type.

Referenced by FitDialog::updatePreview().

◆ restore()

void FunctionCurve::restore ( Graph g,
const QStringList &  lst 
)
static

◆ saveToString()

QString FunctionCurve::saveToString ( )

◆ setConstant()

void FunctionCurve::setConstant ( const QString &  parName,
double  val 
)
inline

◆ setConstants()

void FunctionCurve::setConstants ( const QMap< QString, double > &  map)
inline

◆ setFormula()

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().

◆ setFormulas()

void FunctionCurve::setFormulas ( const QStringList &  lst)
inline

◆ setFunctionType()

void FunctionCurve::setFunctionType ( const FunctionType t)
inline

◆ setRange()

void FunctionCurve::setRange ( double  from,
double  to 
)

◆ setVariable()

void FunctionCurve::setVariable ( const QString &  s)
inline

◆ startRange()

double FunctionCurve::startRange ( )
inline

◆ variable()

QString FunctionCurve::variable ( )
inline

Member Data Documentation

◆ d_constants

QMap<QString, double> FunctionCurve::d_constants
private

◆ d_formulas

QStringList FunctionCurve::d_formulas
private

◆ d_from

double FunctionCurve::d_from
private

◆ d_function_type

FunctionType FunctionCurve::d_function_type
private

◆ d_to

double FunctionCurve::d_to
private

◆ d_variable

QString FunctionCurve::d_variable
private

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