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

Extension to QwtScaleDraw. More...

#include <ScaleDraw.h>

Inheritance diagram for ScaleDraw:
DateScaleDraw DateTimeScaleDraw MonthScaleDraw QwtSupersciptsScaleDraw QwtTextScaleDraw TimeScaleDraw WeekDayScaleDraw

List of all members.

Public Types

enum  TicksStyle { None = 0, Out = 1, Both = 2, In = 3 }

Public Member Functions

QString formulaString ()
virtual QwtText label (double value) const
void labelFormat (char &f, int &prec) const
 Return the number format for the major scale labels.
int labelNumericPrecision () const
int majorTicksStyle () const
int minorTicksStyle () const
 ScaleDraw (const QString &s=QString::null)
 ScaleDraw (const ScaleDraw &other, const QString &s=QString::null)
void setFormulaString (const QString &formula)
void setLabelFormat (char f, int prec)
 Set the number format for the major scale labels.
void setMajorTicksStyle (TicksStyle type)
void setMinorTicksStyle (TicksStyle type)
double transformValue (double value) const
virtual ~ScaleDraw ()

Protected Member Functions

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

Private Attributes

char d_fmt
int d_majTicks
int d_minTicks
int d_prec
QString formula_string

Detailed Description

Extension to QwtScaleDraw.


Member Enumeration Documentation

Enumerator:
None 
Out 
Both 
In 

Constructor & Destructor Documentation

ScaleDraw::ScaleDraw ( const QString &  s = QString::null)
ScaleDraw::ScaleDraw ( const ScaleDraw other,
const QString &  s = QString::null 
)

References d_fmt, d_prec, and labelFormat().

virtual ScaleDraw::~ScaleDraw ( )
inlinevirtual

Member Function Documentation

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

References d_majTicks, d_minTicks, In, and None.

QString ScaleDraw::formulaString ( )
inline

References formula_string.

virtual QwtText ScaleDraw::label ( double  value) const
inlinevirtual
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:
setLabelFormat()

References d_fmt, and d_prec.

Referenced by Plot::axisLabelFormat(), QwtSupersciptsScaleDraw::label(), and ScaleDraw().

int ScaleDraw::labelNumericPrecision ( ) const
inline

References d_prec.

Referenced by Plot::axisLabelPrecision().

int ScaleDraw::majorTicksStyle ( ) const
inline

References d_majTicks.

Referenced by Plot::drawItems(), and Plot::getMajorTicksType().

int ScaleDraw::minorTicksStyle ( ) const
inline

References d_minTicks.

Referenced by Plot::drawItems(), and Plot::getMinorTicksType().

void ScaleDraw::setFormulaString ( const QString &  formula)
inline
void ScaleDraw::setLabelFormat ( char  f,
int  prec 
)

Set the number format for the major scale labels.

Format character and precision have the same meaning as for sprintf().

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

References d_fmt, and d_prec.

Referenced by Plot::setAxisLabelFormat(), and Graph::setLabelsNumericFormat().

void ScaleDraw::setMajorTicksStyle ( TicksStyle  type)
inline
void ScaleDraw::setMinorTicksStyle ( TicksStyle  type)
inline
double ScaleDraw::transformValue ( double  value) const

Member Data Documentation

char ScaleDraw::d_fmt
private
int ScaleDraw::d_majTicks
private
int ScaleDraw::d_minTicks
private
int ScaleDraw::d_prec
private
QString ScaleDraw::formula_string
private

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