QtiPlot
0.9.8.2
|
Extension to QwtScaleDraw. More...
#include <ScaleDraw.h>
Public Types | |
enum | NameFormat { ShortName, LongName, Initial } |
enum | NumericFormat { Automatic, Decimal, Scientific, Superscripts, Engineering, SuperscriptsGER } |
enum | ScaleType { Numeric = 0, Text = 1, Day = 2, Month = 3, Time = 4, Date = 5, ColHeader = 6 } |
enum | ShowTicksPolicy { ShowAll = 0, HideBegin = 1, HideEnd = 2, HideBeginEnd = 3 } |
enum | TicksStyle { None = 0, Out = 1, Both = 2, In = 3 } |
Public Member Functions | |
int | axis () const |
QString | formatString () |
QString | formula () |
virtual QwtText | label (double value) const |
void | labelFormat (char &f, int &prec) const |
Return the number format for the major scale labels. More... | |
NumericFormat | labelNumericFormat () |
int | labelNumericPrecision () const |
QStringList | labelsList () |
QString | labelString (double value) const |
int | majorTicksStyle () const |
int | minorTicksStyle () const |
NameFormat | nameFormat () |
Graph * | plot () |
QString | prefix () |
ScaleDraw (Graph *plot, ScaleDraw *sd) | |
Constructs a new scale draw which is a clone of sd. More... | |
ScaleDraw (Graph *plot, const QString &formula=QString::null) | |
ScaleDraw (Graph *plot, const QStringList &labels, const QString &format, ScaleType type=Text) | |
ScaleType | scaleType () |
void | setDateFormat (const QString &format) |
void | setDayFormat (NameFormat format) |
void | setFormula (const QString &formula) |
void | setLabelsList (const QStringList &list) |
void | setMajorTicksStyle (TicksStyle type) |
void | setMinorTicksStyle (TicksStyle type) |
void | setMonthFormat (NameFormat format) |
void | setNumericFormat (NumericFormat format) |
void | setNumericPrecision (int prec) |
void | setPrefix (const QString &s) |
void | setScaleType (ScaleType type) |
void | setSelected (bool select=true) |
void | setShowTicksPolicy (const ShowTicksPolicy &policy) |
void | setSuffix (const QString &s) |
void | setTimeFormat (const QString &format) |
ShowTicksPolicy | showTicksPolicy () |
QString | suffix () |
double | transformValue (double value) const |
Protected Member Functions | |
virtual void | draw (QPainter *, const QPalette &) const |
virtual void | drawBackbone (QPainter *painter) const |
void | drawBreak (QPainter *) const |
void | drawInwardTick (QPainter *painter, double value, int len) const |
virtual void | drawLabel (QPainter *painter, double value) const |
virtual void | drawTick (QPainter *p, double value, int len) const |
Private Attributes | |
char | d_fmt |
Numerical format specification. More... | |
QString | d_format_info |
Stores extra format information: More... | |
QString | d_formula |
A mathematical expression used to calculate the label values. More... | |
int | d_majTicks |
Max ticks style. More... | |
int | d_minTicks |
Min ticks style. More... | |
NameFormat | d_name_format |
Stores the scale name format for Day and Month scales. More... | |
NumericFormat | d_numeric_format |
Stores the scale numeric format: Automatic, Decimal, Scientific, Superscripts. More... | |
Graph * | d_plot |
Pointer to the parent plot. More... | |
int | d_prec |
Numerical precision. More... | |
QString | d_prefix |
bool | d_selected |
Flag telling if the scale labels are selected (a blue frame is drawn around each labels if true) More... | |
ShowTicksPolicy | d_show_ticks_policy |
QString | d_suffix |
QStringList | d_text_labels |
Stores the labels for Txt scales. More... | |
ScaleType | d_type |
Stores the scale type (numeric, text, etc...). See: enum NumericFormat. More... | |
Extension to QwtScaleDraw.
enum ScaleDraw::ScaleType |
Constructs a new scale draw which is a clone of sd.
References d_fmt, d_format_info, d_formula, d_majTicks, d_minTicks, d_name_format, d_numeric_format, d_prec, d_prefix, d_selected, d_show_ticks_policy, d_suffix, d_text_labels, d_type, prefix(), showTicksPolicy(), and suffix().
ScaleDraw::ScaleDraw | ( | Graph * | plot, |
const QString & | formula = QString::null |
||
) |
ScaleDraw::ScaleDraw | ( | Graph * | plot, |
const QStringList & | labels, | ||
const QString & | format, | ||
ScaleType | type = Text |
||
) |
int ScaleDraw::axis | ( | ) | const |
Referenced by drawBackbone(), drawBreak(), drawInwardTick(), drawLabel(), drawTick(), and labelString().
|
protectedvirtual |
References Both, d_majTicks, d_minTicks, d_plot, drawBreak(), drawInwardTick(), Graph::isPrinting(), Graph::majorTickLength(), and Graph::minorTickLength().
Referenced by drawInwardTick().
|
protectedvirtual |
|
protected |
References axis(), ScaleEngine::axisBreakLeft(), ScaleEngine::axisBreakRight(), d_plot, ScaleEngine::hasBreak(), ScaleEngine::hasBreakDecoration(), Graph::isPrinting(), and Graph::majorTickLength().
Referenced by draw().
|
protected |
References axis(), ScaleEngine::axisBreakLeft(), ScaleEngine::axisBreakRight(), d_plot, draw(), and ScaleEngine::hasBreak().
Referenced by draw().
|
protectedvirtual |
|
protectedvirtual |
|
inline |
|
inline |
References d_formula.
Referenced by Graph::axisFormula(), Graph::copyScaleDraw(), Graph::saveAxesFormulas(), setFormula(), Graph::setLabelsNumericFormat(), and Graph::showAxis().
|
virtual |
References d_prefix, d_suffix, and labelString().
void ScaleDraw::labelFormat | ( | char & | f, |
int & | prec | ||
) | const |
Return the number format for the major scale labels.
Format character and precision have the same meaning as for sprintf().
f | format character 'e', 'f' or 'g' |
prec |
|
Referenced by Graph::axisLabelFormat().
|
inline |
References d_numeric_format.
Referenced by Graph::axisLabelFormat().
|
inline |
References d_prec.
Referenced by Graph::axisLabelPrecision().
|
inline |
References d_text_labels.
Referenced by Graph::copyScaleDraw(), and Graph::setLabelsTextFormat().
QString ScaleDraw::labelString | ( | double | value | ) | const |
References axis(), ScaleEngine::axisBreakLeft(), ScaleEngine::axisBreakRight(), ColHeader, d_fmt, d_format_info, d_name_format, d_numeric_format, d_plot, d_prec, d_text_labels, d_type, Date, Table::dateTime(), Day, Engineering, ScaleEngine::hasBreak(), Initial, LongName, Month, Graph::multiLayer(), Numeric, ShortName, sign, Superscripts, SuperscriptsGER, Text, Time, and transformValue().
Referenced by label().
|
inline |
References d_majTicks.
Referenced by Graph::copyScaleDraw(), Graph::drawItems(), and Graph::getMajorTicksType().
|
inline |
References d_minTicks.
Referenced by Graph::copyScaleDraw(), Graph::drawItems(), and Graph::getMinorTicksType().
|
inline |
References d_name_format.
Referenced by Graph::copyScaleDraw(), and Graph::updateSecondaryAxis().
|
inline |
References d_prefix.
Referenced by Graph::copyScaleDraw(), Graph::saveLabelsPrefixAndSuffix(), ScaleDraw(), Graph::showAxis(), and AxesDialog::updateCurrentAxis().
|
inline |
void ScaleDraw::setDateFormat | ( | const QString & | format | ) |
References d_format_info, d_type, and Date.
Referenced by Graph::setLabelsDateTimeFormat().
void ScaleDraw::setDayFormat | ( | NameFormat | format | ) |
References d_name_format, d_type, and Day.
Referenced by Graph::setLabelsDayFormat().
|
inline |
References d_formula, and formula().
Referenced by Graph::setAxisFormula().
|
inline |
References d_text_labels.
|
inline |
References d_majTicks.
Referenced by Graph::setAxisTicksLength(), and Graph::setMajorTicksType().
|
inline |
References d_minTicks.
Referenced by Graph::setAxisTicksLength(), and Graph::setMinorTicksType().
void ScaleDraw::setMonthFormat | ( | NameFormat | format | ) |
References d_name_format, d_type, and Month.
Referenced by Graph::setLabelsMonthFormat().
void ScaleDraw::setNumericFormat | ( | NumericFormat | format | ) |
References Automatic, d_fmt, d_numeric_format, d_type, Decimal, Engineering, Numeric, Scientific, Superscripts, and SuperscriptsGER.
Referenced by Graph::setLabelsNumericFormat().
|
inline |
References d_prec.
Referenced by Graph::setLabelsNumericFormat().
|
inline |
References d_prefix.
Referenced by Graph::copyScaleDraw(), ApplicationWindow::openGraph(), and Graph::showAxis().
|
inline |
References d_selected.
Referenced by ScalePicker::deselect(), and ScalePicker::selectLabels().
|
inline |
References d_show_ticks_policy.
Referenced by AxesDialog::applyAxisFormatToLayer(), Graph::copyScaleDraw(), ApplicationWindow::openGraph(), FFT::outputGraphs(), Graph::plotBox(), and Graph::showAxis().
|
inline |
References d_suffix.
Referenced by Graph::copyScaleDraw(), ApplicationWindow::openGraph(), and Graph::showAxis().
void ScaleDraw::setTimeFormat | ( | const QString & | format | ) |
References d_format_info, d_type, and Time.
Referenced by Graph::setLabelsDateTimeFormat().
|
inline |
References d_show_ticks_policy.
Referenced by Graph::copyScaleDraw(), Graph::saveTickLabelsSpace(), ScaleDraw(), Graph::showAxis(), and AxesDialog::updateCurrentAxis().
|
inline |
References d_suffix.
Referenced by Graph::copyScaleDraw(), Graph::saveLabelsPrefixAndSuffix(), ScaleDraw(), Graph::showAxis(), and AxesDialog::updateCurrentAxis().
double ScaleDraw::transformValue | ( | double | value | ) | const |
References d_formula.
Referenced by labelString().
|
private |
Numerical format specification.
Referenced by labelFormat(), labelString(), ScaleDraw(), and setNumericFormat().
|
private |
Stores extra format information:
Referenced by formatString(), labelString(), ScaleDraw(), setDateFormat(), and setTimeFormat().
|
private |
A mathematical expression used to calculate the label values.
Referenced by formula(), ScaleDraw(), setFormula(), and transformValue().
|
private |
Max ticks style.
Referenced by draw(), drawTick(), majorTicksStyle(), ScaleDraw(), and setMajorTicksStyle().
|
private |
Min ticks style.
Referenced by draw(), drawTick(), minorTicksStyle(), ScaleDraw(), and setMinorTicksStyle().
|
private |
Stores the scale name format for Day and Month scales.
Referenced by labelString(), nameFormat(), ScaleDraw(), setDayFormat(), and setMonthFormat().
|
private |
Stores the scale numeric format: Automatic, Decimal, Scientific, Superscripts.
Referenced by labelNumericFormat(), labelString(), ScaleDraw(), and setNumericFormat().
|
private |
Pointer to the parent plot.
Referenced by draw(), drawBackbone(), drawBreak(), drawInwardTick(), drawLabel(), drawTick(), labelString(), and plot().
|
private |
Numerical precision.
Referenced by labelFormat(), labelNumericPrecision(), labelString(), ScaleDraw(), and setNumericPrecision().
|
private |
Referenced by label(), prefix(), ScaleDraw(), and setPrefix().
|
private |
Flag telling if the scale labels are selected (a blue frame is drawn around each labels if true)
Referenced by drawLabel(), ScaleDraw(), and setSelected().
|
private |
Referenced by drawLabel(), drawTick(), ScaleDraw(), setShowTicksPolicy(), and showTicksPolicy().
|
private |
Referenced by label(), ScaleDraw(), setSuffix(), and suffix().
|
private |
Stores the labels for Txt scales.
Referenced by labelsList(), labelString(), ScaleDraw(), and setLabelsList().
|
private |
Stores the scale type (numeric, text, etc...). See: enum NumericFormat.
Referenced by labelString(), ScaleDraw(), scaleType(), setDateFormat(), setDayFormat(), setMonthFormat(), setNumericFormat(), setScaleType(), and setTimeFormat().