Qwt User's Guide svn
Public Types | Public Member Functions
QwtScaleDiv Class Reference

#include <qwt_scale_div.h>

List of all members.

Public Types

enum  TickType {
  NoTick = -1,
  MinorTick,
  MediumTick,
  MajorTick,
  NTickTypes
}

Public Member Functions

bool contains (double v) const
QwtInterval interval () const
void invalidate ()
void invert ()
bool isValid () const
double lowerBound () const
bool operator!= (const QwtScaleDiv &s) const
bool operator== (const QwtScaleDiv &s) const
 QwtScaleDiv ()
 QwtScaleDiv (const QwtInterval &, QList< double >[NTickTypes])
 QwtScaleDiv (double lowerBound, double upperBound, QList< double >[NTickTypes])
double range () const
void setInterval (double lowerBound, double upperBound)
void setInterval (const QwtInterval &)
void setTicks (int type, const QList< double > &)
const QList< double > & ticks (int type) const
double upperBound () const

Detailed Description

A class representing a scale division.

A scale division consists of its limits and 3 list of tick values qualified as major, medium and minor ticks.

In most cases scale divisions are calculated by a QwtScaleEngine.

See also:
subDivideInto(), subDivide()

Member Enumeration Documentation

Scale tick types.

Enumerator:
NoTick 

No ticks.

MinorTick 

Minor ticks.

MediumTick 

Medium ticks.

MajorTick 

Major ticks.

NTickTypes 

Number of valid tick types.


Constructor & Destructor Documentation

QwtScaleDiv::QwtScaleDiv ( ) [explicit]

Construct an invalid QwtScaleDiv instance.

QwtScaleDiv::QwtScaleDiv ( const QwtInterval interval,
QList< double >  ticks[NTickTypes] 
) [explicit]

Construct QwtScaleDiv instance.

Parameters:
intervalInterval
ticksList of major, medium and minor ticks
QwtScaleDiv::QwtScaleDiv ( double  lowerBound,
double  upperBound,
QList< double >  ticks[NTickTypes] 
) [explicit]

Construct QwtScaleDiv instance.

Parameters:
lowerBoundFirst interval limit
upperBoundSecond interval limit
ticksList of major, medium and minor ticks

Member Function Documentation

bool QwtScaleDiv::contains ( double  value) const

Return if a value is between lowerBound() and upperBound()

Parameters:
valueValue
Returns:
true/false
QwtInterval QwtScaleDiv::interval ( ) const [inline]
Returns:
lowerBound -> upperBound
void QwtScaleDiv::invalidate ( )

Invalidate the scale division.

void QwtScaleDiv::invert ( )

Invert the scale divison.

bool QwtScaleDiv::isValid ( ) const

Check if the scale division is valid.

double QwtScaleDiv::lowerBound ( ) const [inline]
Returns:
lower bound
See also:
upperBound()
bool QwtScaleDiv::operator!= ( const QwtScaleDiv s) const

Inequality.

Returns:
true if this instance is not equal to s
bool QwtScaleDiv::operator== ( const QwtScaleDiv other) const

Equality operator.

Returns:
true if this instance is equal to other
double QwtScaleDiv::range ( ) const [inline]
void QwtScaleDiv::setInterval ( double  lowerBound,
double  upperBound 
) [inline]

Change the interval

Parameters:
lowerBoundlower bound
upperBoundupper bound
void QwtScaleDiv::setInterval ( const QwtInterval interval)

Change the interval

Parameters:
intervalInterval
void QwtScaleDiv::setTicks ( int  type,
const QList< double > &  ticks 
)

Assign ticks

Parameters:
typeMinorTick, MediumTick or MajorTick
ticksValues of the tick positions
const QList< double > & QwtScaleDiv::ticks ( int  type) const

Return a list of ticks

Parameters:
typeMinorTick, MediumTick or MajorTick
double QwtScaleDiv::upperBound ( ) const [inline]
Returns:
upper bound
See also:
lowerBound()
qmi style