PieCurve Class Reference

Pie plot class. More...

`#include <PieCurve.h>`

Inheritance diagram for PieCurve:

## Public Member Functions

PieLabel * | addLabel (PieLabel *l, bool clone=false)
void | clearLabels ()
void | clone (PieCurve *c)
QColor | color (int i) const
bool | counterClockwise ()
int | firstColor ()
bool | fixedLabelsPosition ()
double | horizontalOffset ()
void | initLabels ()
bool | labelCategories ()
bool | labelsAutoFormat ()
double | labelsEdgeDistance ()
QList< PieLabel * > | labelsList ()
bool | labelsPercentagesFormat ()
bool | labelsValuesFormat ()
void | loadData ()
Qt::BrushStyle | pattern ()
| PieCurve (Table *t, const QString &name, int startRow, int endRow)
int | radius ()
void | setBrushStyle (const Qt::BrushStyle &style)
void | setCounterClockwise (bool on)
void | setFirstColor (int index)
void | setFixedLabelsPosition (bool on)
void | setHorizontalOffset (double d)
void | setLabelCategories (bool on)
void | setLabelPercentagesFormat (bool on)
void | setLabelsAutoFormat (bool on)
void | setLabelsEdgeDistance (double d)
void | setLabelValuesFormat (bool on)
void | setRadius (int size)
void | setStartAzimuth (double angle)
void | setThickness (double t)
void | setViewAngle (double a)
double | startAzimuth ()
double | thickness ()
double | viewAngle ()
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)
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 ()
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 bool | updateData (Table *t, const QString &colName)
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

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

## Private Attributes

bool | d_auto_labeling
bool | d_categories
bool | d_counter_clockwise
double | d_edge_dist
int | d_first_color
bool | d_fixed_labels_pos
double | d_horizontal_offset
bool | d_percentages
int | d_pie_ray
double | d_start_azimuth
QVarLengthArray< int > | d_table_rows
| Stores table row indices to be displayed in PieLabels if d_categories is true. More...
QList< PieLabel * > | d_texts_list
double | d_thickness
bool | d_values
double | d_view_angle

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

Pie plot class.

## Constructor & Destructor Documentation

## PieCurve()

PieCurve::PieCurve | ( | Table * | t,
|  | const QString & | name,
|  | int | startRow,
|  | int | endRow
| ) |  |

References d_table_rows, Graph::Pie, PlotCurve::setPlotStyle(), and PlotCurve::setType().

## Member Function Documentation

## addLabel()

PieLabel * PieCurve::addLabel | ( | PieLabel * | l,
|  | bool | clone = `false`
| ) |  |

References LegendWidget::clone(), PieLabel::customText(), d_texts_list, PieLabel::setCustomText(), PieLabel::setPieCurve(), and LegendWidget::text().

Referenced by clone(), firstColor(), and Graph::insertText().

## clearLabels()

void PieCurve::clearLabels | ( |  | ) |

References d_auto_labeling, d_texts_list, and LegendWidget::setText().

Referenced by firstColor().

## clone()

void PieCurve::clone | ( | PieCurve * | c | ) |

References addLabel(), counterClockwise(), d_auto_labeling, d_categories, d_counter_clockwise, d_edge_dist, d_first_color, d_fixed_labels_pos, d_horizontal_offset, d_percentages, d_pie_ray, d_start_azimuth, d_table_rows, d_thickness, d_values, d_view_angle, firstColor(), fixedLabelsPosition(), horizontalOffset(), labelCategories(), labelsAutoFormat(), labelsEdgeDistance(), labelsList(), labelsPercentagesFormat(), labelsValuesFormat(), radius(), startAzimuth(), thickness(), and viewAngle().

## color()

QColor PieCurve::color | ( | int | i | ) | const

References ColorBox::color(), d_first_color, and ColorBox::numPredefinedColors().

Referenced by drawDisk(), drawSlices(), LegendWidget::drawSymbol(), Graph::savePieCurveLayout(), PlotDialog::setActiveCurve(), and setFixedLabelsPosition().

## counterClockwise()

bool PieCurve::counterClockwise | ( |  | ) |

inline

References d_counter_clockwise.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## draw()

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

private

References drawDisk(), and drawSlices().

Referenced by labelsList().

## drawDisk()

void PieCurve::drawDisk | ( | QPainter * | painter,
|  | const QwtScaleMap & | xMap,
|  | const QwtScaleMap & | yMap
| ) |  | const

private

References color(), PieLabel::customText(), d_auto_labeling, d_categories, d_edge_dist, d_fixed_labels_pos, d_horizontal_offset, d_percentages, d_pie_ray, d_start_azimuth, d_table_rows, d_texts_list, d_thickness, d_values, d_view_angle, M_PI, FrameWidget::setOriginCoord(), and LegendWidget::setText().

Referenced by draw(), and labelsList().

## drawSlices()

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

private

References color(), PieLabel::customText(), d_auto_labeling, d_categories, d_counter_clockwise, d_edge_dist, d_fixed_labels_pos, d_horizontal_offset, d_percentages, d_pie_ray, d_start_azimuth, d_table_rows, d_texts_list, d_thickness, d_values, d_view_angle, M_PI, FrameWidget::setOriginCoord(), LegendWidget::setText(), and sign.

Referenced by draw(), and labelsList().

## firstColor()

int PieCurve::firstColor | ( |  | ) |

inline

References addLabel(), clearLabels(), d_first_color, initLabels(), and loadData().

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## fixedLabelsPosition()

bool PieCurve::fixedLabelsPosition | ( |  | ) |

inline

References d_fixed_labels_pos.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## horizontalOffset()

double PieCurve::horizontalOffset | ( |  | ) |

inline

References d_horizontal_offset.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## initLabels()

void PieCurve::initLabels | ( |  | ) |

References Table::cell(), Table::colIndex(), DataCurve::d_end_row, DataCurve::d_start_row, DataCurve::d_table, d_texts_list, Graph::multiLayer(), LegendWidget::setText(), and Table::text().

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

## labelCategories()

bool PieCurve::labelCategories | ( |  | ) |

inline

References d_categories.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## labelsAutoFormat()

bool PieCurve::labelsAutoFormat | ( |  | ) |

inline

References d_auto_labeling.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## labelsEdgeDistance()

double PieCurve::labelsEdgeDistance | ( |  | ) |

inline

References d_edge_dist.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## labelsList()

QList<PieLabel *> PieCurve::labelsList | ( |  | ) |

inline

References d_texts_list, draw(), drawDisk(), and drawSlices().

Referenced by clone(), PieLabel::restore(), and PieLabel::saveToString().

## labelsPercentagesFormat()

bool PieCurve::labelsPercentagesFormat | ( |  | ) |

inline

References d_percentages.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## labelsValuesFormat()

bool PieCurve::labelsValuesFormat | ( |  | ) |

inline

References d_values.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## loadData()

void PieCurve::loadData | ( |  | ) |

virtual

Reimplemented from DataCurve.

References Table::colIndex(), DataCurve::d_end_row, DataCurve::d_start_row, DataCurve::d_table, d_table_rows, d_texts_list, Graph::multiLayer(), and Table::text().

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

## pattern()

Qt::BrushStyle PieCurve::pattern | ( |  | ) |

inline

References setBrushStyle().

Referenced by LegendWidget::drawSymbol(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## radius()

int PieCurve::radius | ( |  | ) |

inline

References d_pie_ray.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## setBrushStyle()

void PieCurve::setBrushStyle | ( | const Qt::BrushStyle & | style | ) |

Referenced by PlotDialog::acceptParams(), pattern(), and Graph::plotPie().

## setCounterClockwise()

void PieCurve::setCounterClockwise | ( | bool | on | ) |

inline

References d_counter_clockwise.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setFirstColor()

void PieCurve::setFirstColor | ( | int | index | ) |

inline

References d_first_color.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setFixedLabelsPosition()

void PieCurve::setFixedLabelsPosition | ( | bool | on | ) |

inline

References color(), and d_fixed_labels_pos.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setHorizontalOffset()

void PieCurve::setHorizontalOffset | ( | double | d | ) |

inline

References d_horizontal_offset.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setLabelCategories()

void PieCurve::setLabelCategories | ( | bool | on | ) |

inline

References d_categories.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setLabelPercentagesFormat()

void PieCurve::setLabelPercentagesFormat | ( | bool | on | ) |

inline

References d_percentages.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setLabelsAutoFormat()

void PieCurve::setLabelsAutoFormat | ( | bool | on | ) |

inline

References d_auto_labeling.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setLabelsEdgeDistance()

void PieCurve::setLabelsEdgeDistance | ( | double | d | ) |

inline

References d_edge_dist.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setLabelValuesFormat()

void PieCurve::setLabelValuesFormat | ( | bool | on | ) |

inline

References d_values.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setRadius()

void PieCurve::setRadius | ( | int | size | ) |

inline

References d_pie_ray.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setStartAzimuth()

void PieCurve::setStartAzimuth | ( | double | angle | ) |

inline

References d_start_azimuth.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setThickness()

void PieCurve::setThickness | ( | double | t | ) |

inline

References d_thickness.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## setViewAngle()

void PieCurve::setViewAngle | ( | double | a | ) |

inline

References d_view_angle.

Referenced by PlotDialog::acceptParams(), and Graph::plotPie().

## startAzimuth()

double PieCurve::startAzimuth | ( |  | ) |

inline

References d_start_azimuth.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## thickness()

double PieCurve::thickness | ( |  | ) |

inline

References d_thickness.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## viewAngle()

double PieCurve::viewAngle | ( |  | ) |

inline

References d_view_angle.

Referenced by clone(), Graph::savePieCurveLayout(), and PlotDialog::setActiveCurve().

## Member Data Documentation

## d_auto_labeling

bool PieCurve::d_auto_labeling

private

Referenced by clearLabels(), clone(), drawDisk(), drawSlices(), labelsAutoFormat(), and setLabelsAutoFormat().

## d_categories

bool PieCurve::d_categories

private

Referenced by clone(), drawDisk(), drawSlices(), labelCategories(), and setLabelCategories().

## d_counter_clockwise

bool PieCurve::d_counter_clockwise

private

Referenced by clone(), counterClockwise(), drawSlices(), and setCounterClockwise().

## d_edge_dist

double PieCurve::d_edge_dist

private

Referenced by clone(), drawDisk(), drawSlices(), labelsEdgeDistance(), and setLabelsEdgeDistance().

## d_first_color

int PieCurve::d_first_color

private

Referenced by clone(), color(), firstColor(), and setFirstColor().

## d_fixed_labels_pos

bool PieCurve::d_fixed_labels_pos

private

Referenced by clone(), drawDisk(), drawSlices(), fixedLabelsPosition(), and setFixedLabelsPosition().

## d_horizontal_offset

double PieCurve::d_horizontal_offset

private

Referenced by clone(), drawDisk(), drawSlices(), horizontalOffset(), and setHorizontalOffset().

## d_percentages

bool PieCurve::d_percentages

private

Referenced by clone(), drawDisk(), drawSlices(), labelsPercentagesFormat(), and setLabelPercentagesFormat().

## d_pie_ray

int PieCurve::d_pie_ray

private

Referenced by clone(), drawDisk(), drawSlices(), radius(), and setRadius().

## d_start_azimuth

double PieCurve::d_start_azimuth

private

Referenced by clone(), drawDisk(), drawSlices(), setStartAzimuth(), and startAzimuth().

## d_table_rows

QVarLengthArray<int> PieCurve::d_table_rows

private

Stores table row indices to be displayed in PieLabels if d_categories is true.

Referenced by clone(), drawDisk(), drawSlices(), loadData(), and PieCurve().

## d_texts_list

QList<PieLabel *> PieCurve::d_texts_list

private

Referenced by addLabel(), clearLabels(), drawDisk(), drawSlices(), initLabels(), labelsList(), and loadData().

## d_thickness

double PieCurve::d_thickness

private

Referenced by clone(), drawDisk(), drawSlices(), setThickness(), and thickness().

## d_values

bool PieCurve::d_values

private

Referenced by clone(), drawDisk(), drawSlices(), labelsValuesFormat(), and setLabelValuesFormat().

## d_view_angle

double PieCurve::d_view_angle

private

Referenced by clone(), drawDisk(), drawSlices(), setViewAngle(), and viewAngle().

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

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