SciDAVis  1.D4
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
DataCurve Class Reference

#include <PlotCurve.h>

Inheritance diagram for DataCurve:
PlotCurve BoxCurve QwtBarCurve QwtErrorPlotCurve QwtPieCurve VectorCurve QwtHistogram

List of all members.

Public Member Functions

void addErrorBars (DataCurve *c)
 Adds a single error bars curve to the list of attached error bars.
void clearErrorBars ()
 Clears the list of attached error bars.
QList< QVector< double > > convertData (const QList< Column * > &cols, const QList< int > &axes) const
 DataCurve (Table *t, const QString &xColName, const QString &name, int startRow=0, int endRow=-1)
int endRow ()
QList< DataCurve * > errorBarsList ()
 The list of attached error bars.
bool hasSelectedLabels ()
bool isFullRange ()
virtual bool loadData ()
virtual QString plotAssociation ()
 A list of data sources for this curve.
void remove ()
void removeErrorBars (DataCurve *c)
 Remove a single error bars curve from the list of attached error bars.
void setFullRange ()
void setLabelsSelected (bool on=true)
void setRowRange (int startRow, int endRow)
void setVisible (bool on)
void setXColumnName (const QString &name)
void setYColumnName (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.
virtual void updateColumnNames (const QString &oldName, const QString &newName, bool updateTableName)
virtual bool updateData (Table *t, const QString &colName)
QString xColumnName ()
QString yColumnName ()
- Public Member Functions inherited from PlotCurve
QwtDoubleRect boundingRect () const
 PlotCurve (const QString &name=QString::null)
void setType (int t)
int type () const

Protected Attributes

int d_end_row
 Last row of #d_tabel to be plotted, provided all relevant columns have valid entries.
QList< DataCurve * > d_error_bars
 List of the error bar curves associated to this curve.
int d_start_row
 First row of #d_tabel to be plotted, provided all relevant columns have valid entries.
Tabled_table
 The data source table.
QString d_x_column
 The name of the column used for abscissae values.
- Protected Attributes inherited from PlotCurve
int d_type

Private Member Functions

bool validCurveType ()

Private Attributes

QVector< int > d_index_to_row
 Mapping of curve indices to row indices in d_table.

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


Member Function Documentation

void DataCurve::addErrorBars ( DataCurve c)
inline

Adds a single error bars curve to the list of attached error bars.

References d_error_bars.

Referenced by QwtErrorPlotCurve::setMasterCurve().

void DataCurve::clearErrorBars ( )

Clears the list of attached error bars.

References d_error_bars, and remove().

Referenced by Graph::setCurveType().

QList< QVector< double > > DataCurve::convertData ( const QList< Column * > &  cols,
const QList< int > &  axes 
) const
int DataCurve::endRow ( )
inline
QList<DataCurve *> DataCurve::errorBarsList ( )
inline

The list of attached error bars.

References d_error_bars.

Referenced by Fit::setYErrorSource(), and ApplicationWindow::showCurveContextMenu().

bool DataCurve::hasSelectedLabels ( )
bool DataCurve::isFullRange ( )
bool DataCurve::loadData ( )
virtual
QString 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 VectorCurve, and QwtErrorPlotCurve.

References d_x_column.

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

void DataCurve::remove ( )
void DataCurve::removeErrorBars ( DataCurve c)

Remove a single error bars curve from the list of attached error bars.

References d_error_bars.

Referenced by QwtErrorPlotCurve::detachFromMasterCurve().

void DataCurve::setFullRange ( )
void DataCurve::setLabelsSelected ( bool  on = true)
void DataCurve::setRowRange ( int  startRow,
int  endRow 
)
void DataCurve::setVisible ( bool  on)

References d_error_bars, and setVisible().

Referenced by Graph::plotPie(), and setVisible().

void DataCurve::setXColumnName ( const QString &  name)
inline
void DataCurve::setYColumnName ( const QString &  name)
inline
int DataCurve::startRow ( )
inline
Table* DataCurve::table ( )
inline
int DataCurve::tableRow ( int  point)

Returns the row index in the data source table corresponding to the data point index.

References d_index_to_row.

Referenced by TranslateCurveTool::selectDestination().

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 QwtErrorPlotCurve, and VectorCurve.

References d_table, d_x_column, and loadData().

bool DataCurve::validCurveType ( )
private
QString DataCurve::xColumnName ( )
inline
QString DataCurve::yColumnName ( )
inline

Member Data Documentation

int DataCurve::d_end_row
protected
QList<DataCurve *> DataCurve::d_error_bars
protected

List of the error bar curves associated to this curve.

Referenced by addErrorBars(), clearErrorBars(), errorBarsList(), loadData(), VectorCurve::loadData(), removeErrorBars(), setFullRange(), setRowRange(), and setVisible().

QVector<int> DataCurve::d_index_to_row
mutableprivate

Mapping of curve indices to row indices in d_table.

Besides d_start_row and d_end_row, this takes into account rows which had invalid entries in one of the relevant columns the last time convertData() was called. Usually, changes in validity should cause the curve to be updated via updateData(); however, subclasses of DataCurve may depend on more columns than X and Y (in particular, this is true of vector curves); so DataCurve cannot (within the current architecture) compute this mapping on demand and has to store it like this.

Referenced by convertData(), and tableRow().

int DataCurve::d_start_row
protected
Table* DataCurve::d_table
protected
QString DataCurve::d_x_column
protected

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