QtiPlot 0.9.8.2
|
#include <PlotCurve.h>
Classes | |
struct | DataRange |
Public Member Functions | |
void | addErrorBars (ErrorBarsCurve *c) |
Adds a single error bars curve to the list of attached error bars. | |
void | clearErrorBars () |
Clears the list of attached error bars. | |
void | clearLabels () |
Clears the list of attached text labels. | |
void | clone (DataCurve *c) |
DataCurve (Table *t, const QString &xColName, const QString &name, int startRow=0, int endRow=-1) | |
void | enableSpeedMode () |
int | endRow () |
QList< ErrorBarsCurve * > | errorBarsList () |
The list of attached error bars. | |
bool | hasLabels () |
bool | hasSelectedLabels () |
bool | hasVisibleLabels () |
bool | isFullRange () |
int | labelsAlignment () |
QColor | labelsColor () |
QString | labelsColumnName () |
QFont | labelsFont () |
double | labelsRotation () |
bool | labelsWhiteOut () |
int | labelsXOffset () |
int | labelsYOffset () |
virtual void | loadData () |
void | moveLabels (const QPoint &pos) |
virtual QStringList | plotAssociation () |
A list of data sources for this curve. | |
void | remove () |
void | removeErrorBars (ErrorBarsCurve *c) |
Remove a single error bars curve from the list of attached error bars. | |
void | restoreLabels (const QStringList &lst) |
virtual QString | saveToString () |
bool | selectedLabels (const QPoint &pos) |
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. | |
virtual void | updateColumnNames (const QString &oldName, const QString &newName, bool updateTableName) |
virtual bool | updateData (Table *t, const QString &colName) |
virtual void | updateLabelsPosition () |
QString | xColumnName () |
Protected Member Functions | |
virtual void | drawCurve (QPainter *p, int style, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const |
virtual void | loadLabels () |
bool | validCurveType () |
Protected Attributes | |
double | d_click_pos_x |
Keep track of the coordinates of the point where the user clicked when selecting the labels. | |
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. | |
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. | |
QFont | d_labels_font |
QList< PlotMarker * > | d_labels_list |
List of the text labels associated to this curve. | |
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. | |
bool | d_show_labels |
int | d_start_row |
Table * | d_table |
The data source table. | |
bool | d_white_out_labels |
QString | d_x_column |
The name of the column used for abscissae values. |
DataCurve::DataCurve | ( | Table * | t, |
const QString & | xColName, | ||
const QString & | name, | ||
int | startRow = 0 , |
||
int | endRow = -1 |
||
) |
References d_end_row, and Table::numRows().
void DataCurve::addErrorBars | ( | ErrorBarsCurve * | c | ) | [inline] |
Adds a single error bars curve to the list of attached error bars.
References d_error_bars.
Referenced by ErrorBarsCurve::setMasterCurve().
void DataCurve::clearErrorBars | ( | ) |
Clears the list of attached error bars.
References d_error_bars, and remove().
void DataCurve::clearLabels | ( | ) |
Clears the list of attached text labels.
Reimplemented in PieCurve.
References d_labels_list, d_show_labels, and validCurveType().
Referenced by PlotDialog::acceptParams(), QwtHistogram::loadLabels(), loadLabels(), and BoxCurve::loadLabels().
void DataCurve::clone | ( | DataCurve * | c | ) |
References d_labels_align, d_labels_angle, d_labels_color, d_labels_font, d_labels_x_offset, d_labels_y_offset, d_show_labels, PlotCurve::d_skip_symbols, d_white_out_labels, hasVisibleLabels(), labelsAlignment(), labelsColor(), labelsColumnName(), labelsFont(), labelsRotation(), labelsWhiteOut(), labelsXOffset(), labelsYOffset(), setLabelsColumnName(), PlotCurve::skipSymbolsCount(), and validCurveType().
Referenced by BoxCurve::copy().
void DataCurve::drawCurve | ( | QPainter * | p, |
int | style, | ||
const QwtScaleMap & | xMap, | ||
const QwtScaleMap & | yMap, | ||
int | from, | ||
int | to | ||
) | const [protected, virtual] |
Reimplemented from PlotCurve.
References d_data_ranges, PlotCurve::d_side_lines, PlotCurve::drawCurve(), and PlotCurve::drawSideLines().
void DataCurve::enableSpeedMode | ( | ) |
References Graph::getDouglasPeukerTolerance(), and Graph::speedModeMaxPoints().
Referenced by Graph::insertCurve(), and loadData().
int DataCurve::endRow | ( | ) | [inline] |
References d_end_row.
Referenced by ErrDialog::add(), Graph::analysableCurvesList(), Graph::copyCurves(), SubtractLineTool::finalize(), SubtractDataDialog::interpolate(), ErrorBarsCurve::loadData(), Graph::masterCurve(), Graph::saveCurves(), Graph::savePieCurveLayout(), CurveRangeDialog::setCurvesToModify(), ErrorBarsCurve::setMasterCurve(), setRowRange(), CurvesDialog::showCurveRange(), and BaselineDialog::subtractBaseline().
QList<ErrorBarsCurve *> DataCurve::errorBarsList | ( | ) | [inline] |
bool DataCurve::hasLabels | ( | ) | [inline] |
References d_labels_list.
Referenced by Graph::closestCurve().
bool DataCurve::hasSelectedLabels | ( | ) |
References d_labels_list, and validCurveType().
Referenced by PlotDialog::insertTabs().
bool DataCurve::hasVisibleLabels | ( | ) | [inline] |
References d_show_labels.
Referenced by clone(), and PlotDialog::setActiveCurve().
bool DataCurve::isFullRange | ( | ) |
References d_end_row, d_start_row, d_table, and Table::numRows().
int DataCurve::labelsAlignment | ( | ) | [inline] |
References d_labels_align.
Referenced by clone(), and PlotDialog::setActiveCurve().
QColor DataCurve::labelsColor | ( | ) | [inline] |
References d_labels_color.
Referenced by clone(), and PlotDialog::setActiveCurve().
QString DataCurve::labelsColumnName | ( | ) | [inline] |
References d_labels_column.
Referenced by clone(), and PlotDialog::setActiveCurve().
QFont DataCurve::labelsFont | ( | ) | [inline] |
References d_labels_font.
Referenced by clone().
double DataCurve::labelsRotation | ( | ) | [inline] |
References d_labels_angle.
Referenced by clone(), and PlotDialog::setActiveCurve().
bool DataCurve::labelsWhiteOut | ( | ) | [inline] |
References d_white_out_labels.
Referenced by clone(), and PlotDialog::setActiveCurve().
int DataCurve::labelsXOffset | ( | ) | [inline] |
References d_labels_x_offset.
Referenced by clone(), and PlotDialog::setActiveCurve().
int DataCurve::labelsYOffset | ( | ) | [inline] |
References d_labels_y_offset.
Referenced by clone(), and PlotDialog::setActiveCurve().
void DataCurve::loadData | ( | ) | [virtual] |
Reimplemented in BoxCurve, ErrorBarsCurve, PieCurve, QwtHistogram, and VectorCurve.
References Table::colIndex(), Table::columnFormat(), Table::columnType(), d_data_ranges, d_end_row, d_error_bars, d_labels_list, d_start_row, d_table, PlotCurve::d_type, d_x_column, ScaleDraw::Date, Table::Date, ScaleDraw::dateTimeOrigin(), enableSpeedMode(), DataCurve::DataRange::from, Graph::HorizontalBars, Graph::isCurveAntialiasingEnabled(), loadLabels(), ScaleDraw::scaleType(), Graph::setLabelsTextFormat(), ScaleDraw::Text, Table::Text, Table::text(), ScaleDraw::Time, Table::Time, and DataCurve::DataRange::to.
Referenced by CurvesDialog::addCurveFromTable(), AssociationsDialog::changePlotAssociation(), Graph::insertCurve(), setFullRange(), setRowRange(), and updateData().
void DataCurve::loadLabels | ( | ) | [protected, virtual] |
Reimplemented in BoxCurve, and QwtHistogram.
References clearLabels(), Table::colIndex(), d_end_row, d_labels_align, d_labels_angle, d_labels_color, d_labels_column, d_labels_font, d_labels_list, d_labels_x_offset, d_labels_y_offset, d_show_labels, d_start_row, d_table, d_white_out_labels, d_x_column, Table::numCols(), Table::text(), and validCurveType().
Referenced by loadData(), and setLabelsColumnName().
void DataCurve::moveLabels | ( | const QPoint & | pos | ) |
QStringList DataCurve::plotAssociation | ( | ) | [virtual] |
A list of data sources for this curve.
Elements must be in either of the following forms:
Column ids are of the form '<name of table> "_" <name of column>'.
Reimplemented in ErrorBarsCurve, and VectorCurve.
References d_labels_column, and d_x_column.
Referenced by AssociationsDialog::changePlotAssociation(), Graph::masterCurve(), and Graph::updateCurveNames().
void DataCurve::remove | ( | ) |
References Graph::removeCurve().
Referenced by AssociationsDialog::changePlotAssociation(), and clearErrorBars().
void DataCurve::removeErrorBars | ( | ErrorBarsCurve * | c | ) |
Remove a single error bars curve from the list of attached error bars.
References d_error_bars.
Referenced by ErrorBarsCurve::detachFromMasterCurve().
void DataCurve::restoreLabels | ( | const QStringList & | lst | ) |
References setLabelsAlignment(), setLabelsColor(), setLabelsColumnName(), setLabelsFont(), setLabelsOffset(), setLabelsRotation(), and setLabelsWhiteOut().
Referenced by Graph::restoreCurveLabels().
QString DataCurve::saveToString | ( | ) | [virtual] |
Reimplemented in QwtBarCurve.
References Graph::Box, d_labels_align, d_labels_angle, d_labels_color, d_labels_column, d_labels_font, d_labels_list, d_labels_x_offset, d_labels_y_offset, PlotCurve::d_skip_symbols, d_white_out_labels, Graph::Function, PlotCurve::saveCurveSymbolImage(), PlotCurve::type(), and validCurveType().
Referenced by Graph::saveCurves().
bool DataCurve::selectedLabels | ( | const QPoint & | pos | ) |
References d_click_pos_x, d_click_pos_y, d_labels_angle, d_labels_list, d_selected_label, setLabelsSelected(), and validCurveType().
Referenced by Graph::closestCurve().
void DataCurve::setFullRange | ( | ) |
References d_end_row, d_error_bars, d_start_row, d_table, ErrorBarsCurve::loadData(), loadData(), and Table::numRows().
Referenced by DrawPointTool::appendPoint(), and Graph::setCurveFullRange().
void DataCurve::setLabelsAlignment | ( | int | flags | ) |
References d_labels_align, updateLabelsPosition(), and validCurveType().
Referenced by PlotDialog::applyLabelsFormatToItem(), and restoreLabels().
void DataCurve::setLabelsColor | ( | const QColor & | c | ) |
References d_labels_color, d_labels_list, and validCurveType().
Referenced by PlotDialog::applyLabelsFormatToItem(), and restoreLabels().
void DataCurve::setLabelsColumnName | ( | const QString & | name | ) |
References d_labels_column, d_labels_list, loadLabels(), and validCurveType().
Referenced by PlotDialog::acceptParams(), Graph::addCurves(), clone(), and restoreLabels().
void DataCurve::setLabelsFont | ( | const QFont & | font | ) |
References d_labels_font, d_labels_list, updateLabelsPosition(), and validCurveType().
Referenced by restoreLabels().
void DataCurve::setLabelsOffset | ( | int | x, |
int | y | ||
) |
References d_labels_x_offset, d_labels_y_offset, updateLabelsPosition(), and validCurveType().
Referenced by PlotDialog::applyLabelsFormatToItem(), and restoreLabels().
void DataCurve::setLabelsRotation | ( | double | angle | ) |
References d_labels_angle, d_labels_list, PlotMarker::setAngle(), and validCurveType().
Referenced by PlotDialog::applyLabelsFormatToItem(), and restoreLabels().
void DataCurve::setLabelsSelected | ( | bool | on = true | ) |
References d_labels_color, d_labels_font, d_labels_list, Graph::deselectMarker(), Graph::notifyColorChange(), Graph::notifyFontChange(), Graph::selectTitle(), and validCurveType().
Referenced by PlotDialog::insertTabs(), and selectedLabels().
void DataCurve::setLabelsWhiteOut | ( | bool | whiteOut = true | ) |
References d_labels_list, d_white_out_labels, and validCurveType().
Referenced by PlotDialog::applyLabelsFormatToItem(), and restoreLabels().
void DataCurve::setRowRange | ( | int | startRow, |
int | endRow | ||
) |
References d_end_row, d_error_bars, d_start_row, endRow(), ErrorBarsCurve::loadData(), loadData(), and startRow().
Referenced by CurveRangeDialog::accept().
void DataCurve::setVisible | ( | bool | on | ) |
References d_error_bars, d_labels_list, and setVisible().
Referenced by Graph::plotPie(), Graph::restoreHistogram(), and setVisible().
void DataCurve::setVisibleLabels | ( | bool | on = true | ) | [inline] |
References d_show_labels.
void DataCurve::setXColumnName | ( | const QString & | name | ) | [inline] |
References d_x_column.
Referenced by AssociationsDialog::changePlotAssociation().
int DataCurve::startRow | ( | ) | [inline] |
References d_start_row.
Referenced by ErrDialog::add(), Graph::analysableCurvesList(), Graph::copyCurves(), SubtractLineTool::finalize(), SubtractDataDialog::interpolate(), ErrorBarsCurve::loadData(), Graph::masterCurve(), Graph::saveCurves(), Graph::savePieCurveLayout(), CurveRangeDialog::setCurvesToModify(), ErrorBarsCurve::setMasterCurve(), setRowRange(), CurvesDialog::showCurveRange(), and BaselineDialog::subtractBaseline().
Table* DataCurve::table | ( | ) | [inline] |
References d_table.
Referenced by PlotDialog::acceptParams(), Graph::copyCurves(), SubtractLineTool::finalize(), SubtractDataDialog::interpolate(), ErrorBarsCurve::loadData(), Graph::parseAxisTitle(), TranslateCurveTool::selectCurvePoint(), PlotDialog::setActiveCurve(), CurveRangeDialog::setCurvesToModify(), and BaselineDialog::subtractBaseline().
int DataCurve::tableRow | ( | int | point | ) |
Returns the row index in the data source table corresponding to the data point index.
References Table::cell(), Table::colIndex(), Table::columnFormat(), Table::columnType(), d_end_row, d_start_row, d_table, PlotCurve::d_type, d_x_column, Table::Date, Graph::HorizontalBars, Graph::Pie, Table::Text, Table::text(), and Table::Time.
Referenced by TranslateCurveTool::selectDestination().
void DataCurve::updateColumnNames | ( | const QString & | oldName, |
const QString & | newName, | ||
bool | updateTableName | ||
) | [virtual] |
bool DataCurve::updateData | ( | Table * | t, |
const QString & | colName | ||
) | [virtual] |
Reimplemented in ErrorBarsCurve, and VectorCurve.
References d_labels_column, d_table, d_x_column, and loadData().
void DataCurve::updateLabelsPosition | ( | ) | [virtual] |
Reimplemented in BoxCurve.
References d_labels_align, d_labels_list, d_labels_x_offset, d_labels_y_offset, PlotMarker::index(), and validCurveType().
Referenced by moveLabels(), setLabelsAlignment(), setLabelsFont(), and setLabelsOffset().
bool DataCurve::validCurveType | ( | ) | [protected] |
References Graph::ColorMap, Graph::Contour, Graph::Function, Graph::GrayScale, Graph::ImagePlot, Graph::Pie, and PlotCurve::type().
Referenced by clearLabels(), clone(), hasSelectedLabels(), loadLabels(), moveLabels(), saveToString(), selectedLabels(), setLabelsAlignment(), setLabelsColor(), setLabelsColumnName(), setLabelsFont(), setLabelsOffset(), setLabelsRotation(), setLabelsSelected(), setLabelsWhiteOut(), and updateLabelsPosition().
QString DataCurve::xColumnName | ( | ) | [inline] |
References d_x_column.
Referenced by ErrDialog::add(), Graph::copyCurves(), SubtractDataDialog::interpolate(), ErrorBarsCurve::loadData(), Graph::parseAxisTitle(), ErrorBarsCurve::plotAssociation(), Graph::saveCurves(), TranslateCurveTool::selectCurvePoint(), TranslateCurveTool::selectDestination(), and BaselineDialog::subtractBaseline().
double DataCurve::d_click_pos_x [protected] |
Keep track of the coordinates of the point where the user clicked when selecting the labels.
Referenced by moveLabels(), and selectedLabels().
double DataCurve::d_click_pos_y [protected] |
Referenced by moveLabels(), and selectedLabels().
std::vector<DataRange> DataCurve::d_data_ranges [protected] |
Referenced by drawCurve(), and loadData().
int DataCurve::d_end_row [protected] |
Referenced by DataCurve(), endRow(), PieCurve::initLabels(), isFullRange(), VectorCurve::loadData(), QwtHistogram::loadData(), loadData(), PieCurve::loadData(), ErrorBarsCurve::loadData(), BoxCurve::loadData(), loadLabels(), setFullRange(), ErrorBarsCurve::setMasterCurve(), setRowRange(), and tableRow().
QList<ErrorBarsCurve *> DataCurve::d_error_bars [protected] |
List of the error bar curves associated to this curve.
Referenced by addErrorBars(), clearErrorBars(), errorBarsList(), VectorCurve::loadData(), loadData(), removeErrorBars(), setFullRange(), setRowRange(), and setVisible().
int DataCurve::d_labels_align [protected] |
double DataCurve::d_labels_angle [protected] |
QColor DataCurve::d_labels_color [protected] |
Referenced by clone(), BoxCurve::createLabel(), labelsColor(), QwtHistogram::loadLabels(), loadLabels(), saveToString(), setLabelsColor(), and setLabelsSelected().
QString DataCurve::d_labels_column [protected] |
The name of the column used for text labels.
Referenced by labelsColumnName(), loadLabels(), VectorCurve::plotAssociation(), plotAssociation(), saveToString(), setLabelsColumnName(), and updateData().
QFont DataCurve::d_labels_font [protected] |
Referenced by clone(), BoxCurve::createLabel(), labelsFont(), QwtHistogram::loadLabels(), loadLabels(), saveToString(), setLabelsFont(), and setLabelsSelected().
QList<PlotMarker *> DataCurve::d_labels_list [protected] |
List of the text labels associated to this curve.
Referenced by clearLabels(), BoxCurve::createLabel(), hasLabels(), hasSelectedLabels(), loadData(), QwtHistogram::loadLabels(), loadLabels(), moveLabels(), saveToString(), selectedLabels(), setLabelsColor(), setLabelsColumnName(), setLabelsFont(), setLabelsRotation(), setLabelsSelected(), setLabelsWhiteOut(), setVisible(), BoxCurve::updateLabels(), and updateLabelsPosition().
int DataCurve::d_labels_x_offset [protected] |
int DataCurve::d_labels_y_offset [protected] |
PlotMarker* DataCurve::d_selected_label [protected] |
Keeps track of the plot marker on which the user clicked when selecting the labels.
Referenced by moveLabels(), and selectedLabels().
bool DataCurve::d_show_labels [protected] |
Referenced by clearLabels(), clone(), hasVisibleLabels(), QwtHistogram::loadData(), BoxCurve::loadData(), QwtHistogram::loadDataFromMatrix(), QwtHistogram::loadLabels(), loadLabels(), BoxCurve::loadLabels(), setVisibleLabels(), BoxCurve::showBoxLabels(), BoxCurve::showWhiskerLabels(), and BoxCurve::updateLabels().
int DataCurve::d_start_row [protected] |
Table* DataCurve::d_table [protected] |
The data source table.
Referenced by PieCurve::initLabels(), isFullRange(), VectorCurve::loadData(), QwtHistogram::loadData(), loadData(), PieCurve::loadData(), ErrorBarsCurve::loadData(), BoxCurve::loadData(), loadLabels(), setFullRange(), table(), tableRow(), VectorCurve::updateData(), updateData(), and ErrorBarsCurve::updateData().
bool DataCurve::d_white_out_labels [protected] |
Referenced by clone(), BoxCurve::createLabel(), labelsWhiteOut(), QwtHistogram::loadLabels(), loadLabels(), saveToString(), and setLabelsWhiteOut().
QString DataCurve::d_x_column [protected] |
The name of the column used for abscissae values.
Referenced by VectorCurve::loadData(), loadData(), loadLabels(), VectorCurve::plotAssociation(), plotAssociation(), setXColumnName(), tableRow(), VectorCurve::updateColumnNames(), updateColumnNames(), VectorCurve::updateData(), updateData(), and xColumnName().