ErrorBarsCurve Class Reference

Error bars curve. More...

`#include <ErrorBarsCurve.h>`

Inheritance diagram for ErrorBarsCurve:

## Public Types

enum | Orientation { Horizontal = 0, Vertical = 1 }

## Public Member Functions

QwtDoubleRect | boundingRect () const
int | capLength ()
QColor | color ()
void | copy (const ErrorBarsCurve *e)
void | detachFromMasterCurve ()
| Causes the master curve to delete this curve from its managed error bars list. More...
int | direction ()
void | drawMinusSide (bool yes)
void | drawPlusSide (bool yes)
void | drawThroughSymbol (bool yes)
| ErrorBarsCurve (int orientation, Table *t, const QString &name)
| ErrorBarsCurve (Table *t, const QString &name)
QwtArray< double > | errors ()
double | errorValue (int i)
void | loadData ()
DataCurve * | masterCurve ()
| Returns the master curve to which this error bars curve is attached. More...
bool | minusSide ()
QStringList | plotAssociation ()
| A list of data sources for this curve. More...
bool | plusSide ()
void | setCapLength (int t)
void | setColor (const QColor &c)
void | setDirection (int o)
void | setErrors (const QwtArray< double > &data)
void | setMasterCurve (DataCurve *c)
void | setWidth (double w)
void | setXErrors (bool yes)
bool | throughSymbol ()
bool | updateData (Table *t, const QString &colName)
double | width ()
bool | xErrors ()
Public Member Functions inherited from DataCurve
void | addErrorBars (ErrorBarsCurve *c)
| Adds a single error bars curve to the list of attached error bars. More...
void | clearErrorBars ()
| Clears the list of attached error bars. More...
void | clearLabels ()
| Clears the list of attached text labels. More...
void | clone (DataCurve *c)
| DataCurve (Table *t, const QString &xColName, const QString &name, int startRow=0, int endRow=-1)
| DataCurve (Table *xt, const QString &xColName, Table *yt, const QString &name, int startRow=0, int endRow=-1)
void | enableSpeedMode ()
int | endRow ()
QList< ErrorBarsCurve * > | errorBarsList ()
| The list of attached error bars. More...
bool | hasLabels ()
bool | hasSelectedLabels ()
bool | hasVisibleLabels ()
bool | isFullRange ()
int | labelsAlignment ()
QColor | labelsColor ()
QString | labelsColumnName ()
QFont | labelsFont ()
double | labelsRotation ()
bool | labelsWhiteOut ()
int | labelsXOffset ()
int | labelsYOffset ()
void | moveLabels (const QPoint &pos)
void | remove ()
void | removeErrorBars (ErrorBarsCurve *c)
| Remove a single error bars curve from the list of attached error bars. More...
void | restoreLabels (const QStringList &lst)
virtual QString | saveToString ()
bool | selectedLabels (const QPoint &pos)
void | setDataSource (Table *yt, int ycol=1, Table *xt=NULL, int xcol=0)
void | setFullRange ()
void | setLabelsAlignment (int flags)
void | setLabelsColor (const QColor &c)
void | setLabelsColumnName (const QString &name)
void | setLabelsFont (const QFont &font)
void | setLabelsOffset (int x, int y)
void | setLabelsRotation (double angle)
void | setLabelsSelected (bool on=true)
void | setLabelsWhiteOut (bool whiteOut=true)
void | setRowRange (int startRow, int endRow)
void | setVisible (bool on)
void | setVisibleLabels (bool on=true)
void | setXColumnName (const QString &name)
int | startRow ()
Table * | table ()
int | tableRow (int point)
| Returns the row index in the data source table corresponding to the data point index. More...
virtual void | updateColumnNames (const QString &oldName, const QString &newName, bool updateTableName)
virtual void | updateLabelsPosition ()
QString | xColumnName ()
Table * | xTable ()
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 ()

## Private Member Functions

virtual void | draw (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
void | drawErrorBars (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
void | init ()

## Private Attributes

int | d_cap_length
| Length of the bar cap decoration. More...
DataCurve * | d_master_curve
| Reference to the master curve to which this error bars curve is attached. More...
QwtArray< double > | err
| Stores the error bar values. More...
bool | minus
bool | plus
bool | through
int | type
| Orientation of the bars: Horizontal or Vertical. More...

## Additional Inherited Members

Protected Member Functions inherited from DataCurve
virtual void | drawCurve (QPainter *p, int style, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
virtual void | loadLabels ()
bool | validCurveType ()
Protected Member Functions inherited from PlotCurve
QwtDoubleRect | boundingRect () 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 DataCurve
double | d_click_pos_x
| Keep track of the coordinates of the point where the user clicked when selecting the labels. More...
double | d_click_pos_y
std::vector< DataRange > | d_data_ranges
int | d_end_row
QList< ErrorBarsCurve * > | d_error_bars
| List of the error bar curves associated to this curve. More...
int | d_labels_align
double | d_labels_angle
QColor | d_labels_color
QString | d_labels_column
| The name of the column used for text labels. More...
QFont | d_labels_font
QList< PlotMarker * > | d_labels_list
| List of the text labels associated to this curve. More...
int | d_labels_x_offset
int | d_labels_y_offset
PlotMarker * | d_selected_label
| Keeps track of the plot marker on which the user clicked when selecting the labels. More...
bool | d_show_labels
int | d_start_row
Table * | d_table
| The data source table. More...
bool | d_white_out_labels
QString | d_x_column
| The name of the column used for abscissae values. More...
Table * | d_x_table
| The data source table in case X and Y datasets are from different tables. 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

## Detailed Description

Error bars curve.

## Member Enumeration Documentation

## Orientation

enum ErrorBarsCurve::Orientation

Enumerator
Horizontal |
Vertical |

## Constructor & Destructor Documentation

## ErrorBarsCurve() [1/2]

ErrorBarsCurve::ErrorBarsCurve | ( | int | orientation,
|  | Table * | t,
|  | const QString & | name
| ) |  |

References init(), and PlotCurve::type().

## ErrorBarsCurve() [2/2]

ErrorBarsCurve::ErrorBarsCurve | ( | Table * | t,
|  | const QString & | name
| ) |  |

References init(), PlotCurve::type(), and Vertical.

## Member Function Documentation

## boundingRect()

QwtDoubleRect ErrorBarsCurve::boundingRect | ( |  | ) | const

References err, min, PlotCurve::type(), and Vertical.

## capLength()

int ErrorBarsCurve::capLength | ( |  | ) |

inline

References d_cap_length.

Referenced by Graph::saveCurves(), PlotDialog::setActiveCurve(), and Graph::updateErrorBars().

## color()

QColor ErrorBarsCurve::color | ( |  | ) |

inline

References setColor().

Referenced by PlotDialog::applyErrorBarFormatToCurve(), Graph::saveCurves(), PlotDialog::setActiveCurve(), and Graph::updateErrorBars().

## copy()

void ErrorBarsCurve::copy | ( | const ErrorBarsCurve * | e | ) |

References d_cap_length, err, minus, plus, through, PlotCurve::type(), and type.

## detachFromMasterCurve()

void ErrorBarsCurve::detachFromMasterCurve | ( |  | ) |

inline

Causes the master curve to delete this curve from its managed error bars list.

References d_master_curve, draw(), drawErrorBars(), init(), loadData(), plotAssociation(), DataCurve::removeErrorBars(), and updateData().

## direction()

int ErrorBarsCurve::direction | ( |  | ) |

inline

References PlotCurve::type().

Referenced by Graph::saveCurves().

## draw()

void ErrorBarsCurve::draw | ( | QPainter * | painter,
|  | const QwtScaleMap & | xMap,
|  | const QwtScaleMap & | yMap,
|  | int | from,
|  | int | to
| ) |  | const

private virtual

References drawErrorBars().

Referenced by detachFromMasterCurve().

## drawErrorBars()

void ErrorBarsCurve::drawErrorBars | ( | QPainter * | painter,
|  | const QwtScaleMap & | xMap,
|  | const QwtScaleMap & | yMap,
|  | int | from,
|  | int | to
| ) |  | const

private

References d_cap_length, d_master_curve, PlotCurve::d_skip_symbols, err, Horizontal, Graph::HorizontalBars, ScaleTransformation::Log10, minus, plus, PlotCurve::skipSymbolsCount(), through, PlotCurve::type(), ScaleEngine::type(), Vertical, and Graph::VerticalBars.

Referenced by detachFromMasterCurve(), and draw().

## drawMinusSide()

void ErrorBarsCurve::drawMinusSide | ( | bool | yes | ) |

inline

References minus.

Referenced by Graph::addErrorBars(), and Graph::updateErrorBars().

## drawPlusSide()

void ErrorBarsCurve::drawPlusSide | ( | bool | yes | ) |

inline

References plus.

Referenced by Graph::addErrorBars(), and Graph::updateErrorBars().

## drawThroughSymbol()

void ErrorBarsCurve::drawThroughSymbol | ( | bool | yes | ) |

inline

References through.

Referenced by Graph::addErrorBars(), and Graph::updateErrorBars().

## errors()

QwtArray<double> ErrorBarsCurve::errors | ( |  | ) |

inline

References err.

## errorValue()

double ErrorBarsCurve::errorValue | ( | int | i | ) |

References err.

Referenced by Fit::setDataCurve(), and Fit::setWeightingData().

## init()

void ErrorBarsCurve::init | ( |  | ) |

private

References Graph::ErrorBars, minus, plus, PlotCurve::setPlotStyle(), PlotCurve::setType(), and through.

Referenced by detachFromMasterCurve(), and ErrorBarsCurve().

## loadData()

void ErrorBarsCurve::loadData | ( |  | ) |

virtual

Reimplemented from DataCurve.

References Table::colIndex(), DataCurve::d_end_row, d_master_curve, DataCurve::d_start_row, DataCurve::d_table, DataCurve::endRow(), err, setErrors(), DataCurve::startRow(), DataCurve::table(), Table::text(), and DataCurve::xColumnName().

Referenced by AssociationsDialog::changePlotAssociation(), detachFromMasterCurve(), DataCurve::setFullRange(), setMasterCurve(), DataCurve::setRowRange(), and updateData().

## masterCurve()

DataCurve* ErrorBarsCurve::masterCurve | ( |  | ) |

inline

Returns the master curve to which this error bars curve is attached.

References d_master_curve, and setMasterCurve().

Referenced by Graph::addCurves(), AssociationsDialog::changePlotAssociation(), Graph::guessUniqueCurveLayout(), Graph::masterCurve(), Graph::saveCurves(), Graph::setGrayScale(), and Graph::setIndexedColors().

## minusSide()

bool ErrorBarsCurve::minusSide | ( |  | ) |

inline

References minus.

Referenced by Graph::saveCurves(), PlotDialog::setActiveCurve(), and Graph::updateErrorBars().

## plotAssociation()

QStringList ErrorBarsCurve::plotAssociation | ( |  | ) |

virtual

A list of data sources for this curve.

Elements must be in either of the following forms:

- <id of X column> "(X)," <id of Y column> "(Y)" [ "," <id of error column> ("(xErr)" | "(yErr)") ]
- <id of Xstart column> "(X)," <id of Ystart column>"(Y)," <id of Xend column> "(X)," <id of Yend column> "(Y)"
  (denoting start and end coordinates for the #VectXYXY style)
- <id of Xstart column> "(X)," <id of Ystart column> "(Y)," <id of angle column> "(A)," <id of magnitude column> "(M)"
  (denoting start coordinates, angle in radians and length for the #VectXYAM style)

Column ids are of the form '<name of table> "_" <name of column>'.

Reimplemented from DataCurve.

References d_master_curve, Horizontal, PlotCurve::type(), and DataCurve::xColumnName().

Referenced by detachFromMasterCurve().

## plusSide()

bool ErrorBarsCurve::plusSide | ( |  | ) |

inline

References plus.

Referenced by Graph::saveCurves(), PlotDialog::setActiveCurve(), and Graph::updateErrorBars().

## setCapLength()

void ErrorBarsCurve::setCapLength | ( | int | t | ) |

inline

References d_cap_length.

Referenced by Graph::addErrorBars(), and Graph::updateErrorBars().

## setColor()

void ErrorBarsCurve::setColor | ( | const QColor & | c | ) |

Referenced by ErrDialog::add(), Graph::addCurves(), Graph::addErrorBars(), color(), Graph::setGrayScale(), Graph::setIndexedColors(), and Graph::updateErrorBars().

## setDirection()

void ErrorBarsCurve::setDirection | ( | int | o | ) |

inline

References setXErrors(), PlotCurve::type(), and xErrors().

Referenced by AssociationsDialog::changePlotAssociation().

## setErrors()

void ErrorBarsCurve::setErrors | ( | const QwtArray< double > & | data | ) |

inline

References err.

Referenced by loadData().

## setMasterCurve()

void ErrorBarsCurve::setMasterCurve | ( | DataCurve * | c | ) |

References DataCurve::addErrorBars(), DataCurve::d_end_row, d_master_curve, DataCurve::d_start_row, DataCurve::endRow(), loadData(), and DataCurve::startRow().

Referenced by Graph::addErrorBars(), AssociationsDialog::changePlotAssociation(), Graph::loadErrorBars(), and masterCurve().

## setWidth()

void ErrorBarsCurve::setWidth | ( | double | w | ) |

Referenced by Graph::addErrorBars(), Graph::updateErrorBars(), and width().

## setXErrors()

void ErrorBarsCurve::setXErrors | ( | bool | yes | ) |

References Horizontal, PlotCurve::type(), and Vertical.

Referenced by setDirection(), and Graph::updateErrorBars().

## throughSymbol()

bool ErrorBarsCurve::throughSymbol | ( |  | ) |

inline

References through.

Referenced by Graph::saveCurves(), PlotDialog::setActiveCurve(), and Graph::updateErrorBars().

## updateData()

bool ErrorBarsCurve::updateData | ( | Table * | t,
|  | const QString & | colName
| ) |  |

virtual

Reimplemented from DataCurve.

References DataCurve::d_table, and loadData().

Referenced by detachFromMasterCurve().

## width()

double ErrorBarsCurve::width | ( |  | ) |

inline

References setWidth().

Referenced by Graph::saveCurves(), PlotDialog::setActiveCurve(), and Graph::updateErrorBars().

## xErrors()

bool ErrorBarsCurve::xErrors | ( |  | ) |

References Horizontal, and PlotCurve::type().

Referenced by PlotDialog::setActiveCurve(), Fit::setDataCurve(), setDirection(), Fit::setWeightingData(), and Graph::updateErrorBars().

## Member Data Documentation

## d_cap_length

int ErrorBarsCurve::d_cap_length

private

Length of the bar cap decoration.

Referenced by capLength(), copy(), drawErrorBars(), and setCapLength().

## d_master_curve

DataCurve* ErrorBarsCurve::d_master_curve

private

Reference to the master curve to which this error bars curve is attached.

Referenced by detachFromMasterCurve(), drawErrorBars(), loadData(), masterCurve(), plotAssociation(), and setMasterCurve().

## err

QwtArray<double> ErrorBarsCurve::err

private

Stores the error bar values.

Referenced by boundingRect(), copy(), drawErrorBars(), errors(), errorValue(), loadData(), and setErrors().

## minus

bool ErrorBarsCurve::minus

private

Referenced by copy(), drawErrorBars(), drawMinusSide(), init(), and minusSide().

## plus

bool ErrorBarsCurve::plus

private

Referenced by copy(), drawErrorBars(), drawPlusSide(), init(), and plusSide().

## through

bool ErrorBarsCurve::through

private

Referenced by copy(), drawErrorBars(), drawThroughSymbol(), init(), and throughSymbol().

## type

int ErrorBarsCurve::type

private

Orientation of the bars: Horizontal or Vertical.

Referenced by copy().

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

- qtiplot/src/plot2D/ErrorBarsCurve.h
- qtiplot/src/plot2D/ErrorBarsCurve.cpp