VectorCurve Class Reference

Vector curve class. More...

`#include <VectorCurve.h>`

Inheritance diagram for VectorCurve:

## Public Types

enum | Position { Tail, Middle, Head }
enum | VectorStyle { XYXY, XYAM }

## Public Member Functions

QwtDoubleRect | boundingRect () const
QColor | color ()
void | copy (const VectorCurve *vc)
void | fillArrowHead (bool fill)
bool | filledArrowHead ()
int | headAngle ()
int | headLength ()
void | loadData ()
QStringList | plotAssociation ()
| A list of data sources for this curve. More...
int | position ()
void | setColor (const QColor &c)
void | setHeadAngle (int a)
void | setHeadLength (int l)
void | setPosition (int pos)
void | setVectorEnd (const QString &xColName, const QString &yColName)
void | setVectorPen (const QPen &pen)
void | setVectorStyle (int style)
void | setWidth (double w)
void | updateColumnNames (const QString &oldName, const QString &newName, bool updateTableName)
bool | updateData (Table *t, const QString &colName)
| VectorCurve (VectorStyle style, Table *t, const QString &xColName, const char *name, const QString &endCol1, const QString &endCol2, int startRow, int endRow)
QString | vectorEndXAColName ()
QString | vectorEndYMColName ()
QPen | vectorPen ()
int | vectorStyle ()
double | width ()
| ~VectorCurve ()
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 | 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 ()

## Protected Attributes

QString | d_end_x_a
QString | d_end_y_m
int | d_headAngle
int | d_headLength
QPen | d_pen
int | d_position
int | d_style
bool | filledArrow
QwtArrayData * | vectorEnd
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

## Private Member Functions

void | draw (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
void | drawArrowHead (QPainter *p, int xs, int ys, int xe, int ye) const
void | drawVector (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
void | setVectorEnd (const QwtArray< double > &x, const QwtArray< double > &y)
double | theta (int x0, int y0, int x1, int y1) const

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

## Detailed Description

Vector curve class.

## Member Enumeration Documentation

## Position

enum VectorCurve::Position

Enumerator
Tail |
Middle |
Head |

## VectorStyle

enum VectorCurve::VectorStyle

Enumerator
XYXY |
XYAM |

## Constructor & Destructor Documentation

## VectorCurve()

VectorCurve::VectorCurve | ( | VectorStyle | style,
|  | Table * | t,
|  | const QString & | xColName,
|  | const char * | name,
|  | const QString & | endCol1,
|  | const QString & | endCol2,
|  | int | startRow,
|  | int | endRow
| ) |  |

References d_pen, PlotCurve::setPlotStyle(), PlotCurve::setType(), Graph::VectXYAM, Graph::VectXYXY, XYAM, and XYXY.

## ~VectorCurve()

VectorCurve::~VectorCurve | ( |  | ) |

References vectorEnd.

## Member Function Documentation

## boundingRect()

QwtDoubleRect VectorCurve::boundingRect | ( |  | ) | const

References d_position, d_style, Head, Middle, Tail, vectorEnd, and XYXY.

## color()

QColor VectorCurve::color | ( |  | ) |

References d_pen.

Referenced by LegendWidget::drawVector(), Graph::saveCurveLayout(), PlotDialog::setActiveCurve(), and vectorEndYMColName().

## copy()

void VectorCurve::copy | ( | const VectorCurve * | vc | ) |

References d_headAngle, d_headLength, d_pen, d_position, d_style, filledArrow, and vectorEnd.

## draw()

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

private

References d_pen, and drawVector().

Referenced by setVectorPen().

## drawArrowHead()

void VectorCurve::drawArrowHead | ( | QPainter * | p,
|  | int | xs,
|  | int | ys,
|  | int | xe,
|  | int | ye
| ) |  | const

private

References d_headAngle, d_headLength, d_pen, filledArrow, headLength(), and theta().

Referenced by drawVector(), and setVectorPen().

## drawVector()

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

private

References d_position, d_style, drawArrowHead(), Head, Middle, Tail, vectorEnd, and XYAM.

Referenced by draw(), and setVectorPen().

## fillArrowHead()

void VectorCurve::fillArrowHead | ( | bool | fill | ) |

References filledArrow.

Referenced by filledArrowHead(), and Graph::updateVectorsLayout().

## filledArrowHead()

bool VectorCurve::filledArrowHead | ( |  | ) |

inline

References fillArrowHead(), and filledArrow.

Referenced by LegendWidget::drawVector(), Graph::saveCurveLayout(), and PlotDialog::setActiveCurve().

## headAngle()

int VectorCurve::headAngle | ( |  | ) |

inline

References d_headAngle, and setHeadAngle().

Referenced by LegendWidget::drawVector(), Graph::saveCurveLayout(), and PlotDialog::setActiveCurve().

## headLength()

int VectorCurve::headLength | ( |  | ) |

inline

References d_headLength, and setHeadLength().

Referenced by drawArrowHead(), LegendWidget::drawVector(), Graph::saveCurveLayout(), and PlotDialog::setActiveCurve().

## loadData()

void VectorCurve::loadData | ( |  | ) |

virtual

Reimplemented from DataCurve.

References Table::colIndex(), DataCurve::d_end_row, d_end_x_a, d_end_y_m, DataCurve::d_error_bars, DataCurve::d_start_row, DataCurve::d_table, DataCurve::d_x_column, setVectorEnd(), and Table::text().

Referenced by AssociationsDialog::changePlotAssociation(), Graph::plotVectors(), setVectorEnd(), setVectorStyle(), and updateData().

## plotAssociation()

QStringList VectorCurve::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_end_x_a, d_end_y_m, DataCurve::d_labels_column, d_style, DataCurve::d_x_column, and XYAM.

Referenced by PlotDialog::acceptParams(), Graph::saveCurveLayout(), and setVectorStyle().

## position()

int VectorCurve::position | ( |  | ) |

inline

References d_position.

Referenced by Graph::saveCurveLayout(), and PlotDialog::setActiveCurve().

## setColor()

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

References d_pen.

Referenced by Graph::updateVectorsLayout(), and vectorEndYMColName().

## setHeadAngle()

void VectorCurve::setHeadAngle | ( | int | a | ) |

References d_headAngle.

Referenced by headAngle(), and Graph::updateVectorsLayout().

## setHeadLength()

void VectorCurve::setHeadLength | ( | int | l | ) |

References d_headLength.

Referenced by headLength(), and Graph::updateVectorsLayout().

## setPosition()

void VectorCurve::setPosition | ( | int | pos | ) |

inline

References d_position.

Referenced by Graph::updateVectorsLayout().

## setVectorEnd() [1/2]

void VectorCurve::setVectorEnd | ( | const QString & | xColName,
|  | const QString & | yColName
| ) |  |

References d_end_x_a, d_end_y_m, and loadData().

Referenced by AssociationsDialog::changePlotAssociation(), loadData(), setVectorPen(), Graph::updateVectorsLayout(), and vectorEndYMColName().

## setVectorEnd() [2/2]

void VectorCurve::setVectorEnd | ( | const QwtArray< double > & | x,
|  | const QwtArray< double > & | y
| ) |  |

private

References vectorEnd.

## setVectorPen()

void VectorCurve::setVectorPen | ( | const QPen & | pen | ) |

inline

References d_pen, draw(), drawArrowHead(), drawVector(), setVectorEnd(), and theta().

Referenced by Graph::print().

## setVectorStyle()

void VectorCurve::setVectorStyle | ( | int | style | ) |

inline

References d_style, loadData(), plotAssociation(), updateColumnNames(), and updateData().

Referenced by PlotDialog::changePlotType().

## setWidth()

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

References d_pen.

Referenced by Graph::updateVectorsLayout(), and vectorEndYMColName().

## theta()

double VectorCurve::theta | ( | int | x0,
|  | int | y0,
|  | int | x1,
|  | int | y1
| ) |  | const

private

Referenced by drawArrowHead(), and setVectorPen().

## updateColumnNames()

void VectorCurve::updateColumnNames | ( | const QString & | oldName,
|  | const QString & | newName,
|  | bool | updateTableName
| ) |  |

virtual

Reimplemented from DataCurve.

References d_end_x_a, d_end_y_m, and DataCurve::d_x_column.

Referenced by setVectorStyle().

## updateData()

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

virtual

Reimplemented from DataCurve.

References d_end_x_a, d_end_y_m, DataCurve::d_table, DataCurve::d_x_column, and loadData().

Referenced by setVectorStyle().

## vectorEndXAColName()

QString VectorCurve::vectorEndXAColName | ( |  | ) |

inline

References d_end_x_a.

Referenced by AssociationsDialog::changePlotAssociation().

## vectorEndYMColName()

QString VectorCurve::vectorEndYMColName | ( |  | ) |

inline

References color(), d_end_y_m, setColor(), setVectorEnd(), setWidth(), and width().

Referenced by AssociationsDialog::changePlotAssociation().

## vectorPen()

QPen VectorCurve::vectorPen | ( |  | ) |

inline

References d_pen.

Referenced by LegendWidget::drawVector(), and Graph::print().

## vectorStyle()

int VectorCurve::vectorStyle | ( |  | ) |

inline

References d_style.

## width()

double VectorCurve::width | ( |  | ) |

References d_pen.

Referenced by Graph::saveCurveLayout(), PlotDialog::setActiveCurve(), and vectorEndYMColName().

## Member Data Documentation

## d_end_x_a

QString VectorCurve::d_end_x_a

protected

Referenced by loadData(), plotAssociation(), setVectorEnd(), updateColumnNames(), updateData(), and vectorEndXAColName().

## d_end_y_m

QString VectorCurve::d_end_y_m

protected

Referenced by loadData(), plotAssociation(), setVectorEnd(), updateColumnNames(), updateData(), and vectorEndYMColName().

## d_headAngle

int VectorCurve::d_headAngle

protected

Referenced by copy(), drawArrowHead(), headAngle(), and setHeadAngle().

## d_headLength

int VectorCurve::d_headLength

protected

Referenced by copy(), drawArrowHead(), headLength(), and setHeadLength().

## d_pen

QPen VectorCurve::d_pen

protected

Referenced by color(), copy(), draw(), drawArrowHead(), setColor(), setVectorPen(), setWidth(), VectorCurve(), vectorPen(), and width().

## d_position

int VectorCurve::d_position

protected

Referenced by boundingRect(), copy(), drawVector(), position(), and setPosition().

## d_style

int VectorCurve::d_style

protected

Referenced by boundingRect(), copy(), drawVector(), plotAssociation(), setVectorStyle(), and vectorStyle().

## filledArrow

bool VectorCurve::filledArrow

protected

Referenced by copy(), drawArrowHead(), fillArrowHead(), and filledArrowHead().

## vectorEnd

QwtArrayData* VectorCurve::vectorEnd

protected

Referenced by boundingRect(), copy(), drawVector(), setVectorEnd(), and ~VectorCurve().

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

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