QtiPlot  0.9.8.2
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ScaleDraw Class Reference

Extension to QwtScaleDraw. More...

#include <ScaleDraw.h>

Inheritance diagram for ScaleDraw:

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

Detailed Description

Extension to QwtScaleDraw.

Member Enumeration Documentation

§ NameFormat

Enumerator
ShortName 
LongName 
Initial 

§ NumericFormat

Enumerator
Automatic 
Decimal 
Scientific 
Superscripts 
Engineering 
SuperscriptsGER 

§ ScaleType

Enumerator
Numeric 
Text 
Day 
Month 
Time 
Date 
ColHeader 

§ ShowTicksPolicy

Enumerator
ShowAll 
HideBegin 
HideEnd 
HideBeginEnd 

§ TicksStyle

Enumerator
None 
Out 
Both 
In 

Constructor & Destructor Documentation

§ ScaleDraw() [1/3]

ScaleDraw::ScaleDraw ( Graph plot,
ScaleDraw sd 
)

§ ScaleDraw() [2/3]

ScaleDraw::ScaleDraw ( Graph plot,
const QString &  formula = QString::null 
)

§ ScaleDraw() [3/3]

ScaleDraw::ScaleDraw ( Graph plot,
const QStringList &  labels,
const QString &  format,
ScaleType  type = Text 
)

Member Function Documentation

§ axis()

int ScaleDraw::axis ( ) const

§ draw()

void ScaleDraw::draw ( QPainter *  painter,
const QPalette &  palette 
) const
protectedvirtual

§ drawBackbone()

void ScaleDraw::drawBackbone ( QPainter *  painter) const
protectedvirtual

§ drawBreak()

void ScaleDraw::drawBreak ( QPainter *  painter) const
protected

§ drawInwardTick()

void ScaleDraw::drawInwardTick ( QPainter *  painter,
double  value,
int  len 
) const
protected

§ drawLabel()

void ScaleDraw::drawLabel ( QPainter *  painter,
double  value 
) const
protectedvirtual

§ drawTick()

void ScaleDraw::drawTick ( QPainter *  p,
double  value,
int  len 
) const
protectedvirtual

§ formatString()

QString ScaleDraw::formatString ( )
inline

§ formula()

QString ScaleDraw::formula ( )
inline

§ label()

QwtText ScaleDraw::label ( double  value) const
virtual

References d_plot, d_prefix, d_suffix, and labelString().

Referenced by setFormula().

§ labelFormat()

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

Parameters
fformat character 'e', 'f' or 'g'
prec
  • for 'e', 'f': the number of digits after the radix character (point)
  • for 'g': the maximum number of significant digits
See also
setNumericFormat()

References d_fmt, and d_prec.

Referenced by Graph::axisLabelFormat(), and setScaleType().

§ labelNumericFormat()

NumericFormat ScaleDraw::labelNumericFormat ( )
inline

§ labelNumericPrecision()

int ScaleDraw::labelNumericPrecision ( ) const
inline

References d_prec.

Referenced by Graph::axisLabelPrecision().

§ labelsList()

QStringList ScaleDraw::labelsList ( )
inline

§ labelString()

QString ScaleDraw::labelString ( double  value) const

§ majorTicksStyle()

int ScaleDraw::majorTicksStyle ( ) const
inline

§ minorTicksStyle()

int ScaleDraw::minorTicksStyle ( ) const
inline

§ nameFormat()

NameFormat ScaleDraw::nameFormat ( )
inline

§ plot()

Graph* ScaleDraw::plot ( )
inline

References d_plot.

§ prefix()

QString ScaleDraw::prefix ( )
inline

§ scaleType()

ScaleType ScaleDraw::scaleType ( )
inline

§ setDateFormat()

void ScaleDraw::setDateFormat ( const QString &  format)

§ setDayFormat()

void ScaleDraw::setDayFormat ( NameFormat  format)

§ setFormula()

void ScaleDraw::setFormula ( const QString &  formula)
inline

§ setLabelsList()

void ScaleDraw::setLabelsList ( const QStringList &  list)
inline

References d_text_labels.

§ setMajorTicksStyle()

void ScaleDraw::setMajorTicksStyle ( TicksStyle  type)
inline

§ setMinorTicksStyle()

void ScaleDraw::setMinorTicksStyle ( TicksStyle  type)
inline

§ setMonthFormat()

void ScaleDraw::setMonthFormat ( NameFormat  format)

§ setNumericFormat()

void ScaleDraw::setNumericFormat ( NumericFormat  format)

§ setNumericPrecision()

void ScaleDraw::setNumericPrecision ( int  prec)
inline

References d_prec.

Referenced by Graph::setLabelsNumericFormat().

§ setPrefix()

void ScaleDraw::setPrefix ( const QString &  s)
inline

§ setScaleType()

void ScaleDraw::setScaleType ( ScaleType  type)
inline

References d_type, and labelFormat().

§ setSelected()

void ScaleDraw::setSelected ( bool  select = true)
inline

§ setShowTicksPolicy()

void ScaleDraw::setShowTicksPolicy ( const ShowTicksPolicy policy)
inline

§ setSuffix()

void ScaleDraw::setSuffix ( const QString &  s)
inline

§ setTimeFormat()

void ScaleDraw::setTimeFormat ( const QString &  format)

§ showTicksPolicy()

ShowTicksPolicy ScaleDraw::showTicksPolicy ( )
inline

§ suffix()

QString ScaleDraw::suffix ( )
inline

§ transformValue()

double ScaleDraw::transformValue ( double  value) const

References d_formula.

Referenced by labelString(), and setFormula().

Member Data Documentation

§ d_fmt

char ScaleDraw::d_fmt
private

Numerical format specification.

Referenced by labelFormat(), labelString(), ScaleDraw(), and setNumericFormat().

§ d_format_info

QString ScaleDraw::d_format_info
private

Stores extra format information:

Referenced by formatString(), labelString(), ScaleDraw(), setDateFormat(), and setTimeFormat().

§ d_formula

QString ScaleDraw::d_formula
private

A mathematical expression used to calculate the label values.

Referenced by formula(), ScaleDraw(), setFormula(), and transformValue().

§ d_majTicks

int ScaleDraw::d_majTicks
private

Max ticks style.

Referenced by draw(), drawTick(), majorTicksStyle(), ScaleDraw(), and setMajorTicksStyle().

§ d_minTicks

int ScaleDraw::d_minTicks
private

Min ticks style.

Referenced by draw(), drawTick(), minorTicksStyle(), ScaleDraw(), and setMinorTicksStyle().

§ d_name_format

NameFormat ScaleDraw::d_name_format
private

Stores the scale name format for Day and Month scales.

Referenced by labelString(), nameFormat(), ScaleDraw(), setDayFormat(), and setMonthFormat().

§ d_numeric_format

NumericFormat ScaleDraw::d_numeric_format
private

Stores the scale numeric format: Automatic, Decimal, Scientific, Superscripts.

Referenced by labelNumericFormat(), labelString(), ScaleDraw(), and setNumericFormat().

§ d_plot

Graph* ScaleDraw::d_plot
private

Pointer to the parent plot.

Referenced by draw(), drawBackbone(), drawBreak(), drawInwardTick(), drawLabel(), drawTick(), label(), labelString(), and plot().

§ d_prec

int ScaleDraw::d_prec
private

§ d_prefix

QString ScaleDraw::d_prefix
private

Referenced by label(), prefix(), ScaleDraw(), and setPrefix().

§ d_selected

bool ScaleDraw::d_selected
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().

§ d_show_ticks_policy

ShowTicksPolicy ScaleDraw::d_show_ticks_policy
private

§ d_suffix

QString ScaleDraw::d_suffix
private

Referenced by label(), ScaleDraw(), setSuffix(), and suffix().

§ d_text_labels

QStringList ScaleDraw::d_text_labels
private

Stores the labels for Txt scales.

Referenced by labelsList(), labelString(), ScaleDraw(), and setLabelsList().

§ d_type

ScaleType ScaleDraw::d_type
private

Stores the scale type (numeric, text, etc...). See: enum NumericFormat.

Referenced by labelString(), ScaleDraw(), scaleType(), setDateFormat(), setDayFormat(), setMonthFormat(), setNumericFormat(), setScaleType(), and setTimeFormat().


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