QtiPlot  0.9.8.2
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DataCurve Class Reference

#include <PlotCurve.h>

Inheritance diagram for DataCurve:
PlotCurve BoxCurve ErrorBarsCurve PieCurve QwtBarCurve VectorCurve QwtHistogram

Classes

struct  DataRange
 

Public Member Functions

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 ()
 
virtual void loadData ()
 
void moveLabels (const QPoint &pos)
 
virtual QStringList plotAssociation ()
 A list of data sources for this curve. More...
 
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 ()
 
Tabletable ()
 
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 bool updateData (Table *t, const QString &colName)
 
virtual void updateLabelsPosition ()
 
QString xColumnName ()
 
TablexTable ()
 
- 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 ()
 

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 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

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< DataRanged_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
 
PlotMarkerd_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
 
Tabled_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...
 
Tabled_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
 

Constructor & Destructor Documentation

DataCurve::DataCurve ( Table t,
const QString &  xColName,
const QString &  name,
int  startRow = 0,
int  endRow = -1 
)

References d_end_row, and Table::numRows().

DataCurve::DataCurve ( Table xt,
const QString &  xColName,
Table yt,
const QString &  name,
int  startRow = 0,
int  endRow = -1 
)

References d_end_row, and Table::numRows().

Member Function Documentation

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.

References d_labels_list, d_show_labels, and validCurveType().

Referenced by PlotDialog::acceptParams(), QwtHistogram::loadLabels(), BoxCurve::loadLabels(), and loadLabels().

void DataCurve::clone ( DataCurve c)
void DataCurve::drawCurve ( QPainter *  p,
int  style,
const QwtScaleMap &  xMap,
const QwtScaleMap &  yMap,
int  from,
int  to 
) const
protectedvirtual
void DataCurve::enableSpeedMode ( )
int DataCurve::endRow ( )
inline
QList<ErrorBarsCurve *> DataCurve::errorBarsList ( )
inline

The list of attached error bars.

References d_error_bars.

Referenced by Fit::setWeightingData().

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 ( )
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
void DataCurve::loadLabels ( )
protectedvirtual
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:

  • <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 in ErrorBarsCurve, and VectorCurve.

References d_labels_column, and d_x_column.

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

void DataCurve::remove ( )
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)
QString DataCurve::saveToString ( )
virtual
bool DataCurve::selectedLabels ( const QPoint &  pos)
void DataCurve::setDataSource ( Table yt,
int  ycol = 1,
Table xt = NULL,
int  xcol = 0 
)
void DataCurve::setFullRange ( )
void DataCurve::setLabelsAlignment ( int  flags)
void DataCurve::setLabelsColor ( const QColor &  c)
void DataCurve::setLabelsColumnName ( const QString &  name)
void DataCurve::setLabelsFont ( const QFont &  font)
void DataCurve::setLabelsOffset ( int  x,
int  y 
)
void DataCurve::setLabelsRotation ( double  angle)
void DataCurve::setLabelsSelected ( bool  on = true)
void DataCurve::setLabelsWhiteOut ( bool  whiteOut = true)
void DataCurve::setRowRange ( int  startRow,
int  endRow 
)
void DataCurve::setVisible ( bool  on)
void DataCurve::setVisibleLabels ( bool  on = true)
inline

References d_show_labels.

void DataCurve::setXColumnName ( const QString &  name)
inline
int DataCurve::startRow ( )
inline
Table* DataCurve::table ( )
inline
int DataCurve::tableRow ( int  point)
void DataCurve::updateColumnNames ( const QString &  oldName,
const QString &  newName,
bool  updateTableName 
)
virtual

Reimplemented in VectorCurve.

References d_x_column.

Referenced by Graph::updateCurveNames().

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
bool DataCurve::validCurveType ( )
protected
QString DataCurve::xColumnName ( )
inline
Table* DataCurve::xTable ( )
inline

Member Data Documentation

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
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
QString DataCurve::d_labels_column
protected
QFont DataCurve::d_labels_font
protected
QList<PlotMarker *> DataCurve::d_labels_list
protected
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
int DataCurve::d_start_row
protected
Table* DataCurve::d_table
protected
bool DataCurve::d_white_out_labels
protected
QString DataCurve::d_x_column
protected
Table* DataCurve::d_x_table
protected

The data source table in case X and Y datasets are from different tables.

Referenced by loadData(), setDataSource(), and xTable().


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