Public Types | Public Member Functions | Private Attributes
QwtScaleDiv Class Reference

A class representing a scale division. More...

#include <qwt_scale_div.h>

List of all members.

Public Types

enum  TickType {
  NoTick = -1, MinorTick, MediumTick, MajorTick,
  NTickTypes
}
 Scale tick types. More...

Public Member Functions

QwtScaleDiv bounded (double lowerBound, double upperBound) const
bool contains (double value) const
QwtInterval interval () const
void invert ()
QwtScaleDiv inverted () const
bool isEmpty () const
 Check if the scale division is empty( lowerBound() == upperBound() )
bool isIncreasing () const
 Check if the scale division is increasing( lowerBound() <= upperBound() )
double lowerBound () const
bool operator!= (const QwtScaleDiv &) const
 Inequality.
bool operator== (const QwtScaleDiv &) const
 Equality operator.
 QwtScaleDiv (double lowerBound=0.0, double upperBound=0.0)
 QwtScaleDiv (const QwtInterval &, QList< double >[NTickTypes])
 QwtScaleDiv (double lowerBound, double upperBound, QList< double >[NTickTypes])
 QwtScaleDiv (double lowerBound, double upperBound, const QList< double > &minorTicks, const QList< double > &mediumTicks, const QList< double > &majorTicks)
double range () const
void setInterval (double lowerBound, double upperBound)
void setInterval (const QwtInterval &)
void setLowerBound (double)
void setTicks (int tickType, const QList< double > &)
void setUpperBound (double)
QList< double > ticks (int tickType) const
double upperBound () const

Private Attributes

double d_lowerBound
QList< double > d_ticks [NTickTypes]
double d_upperBound

Detailed Description

A class representing a scale division.

A Qwt scale is defined by its boundaries and 3 list for the positions of the major, medium and minor ticks.

The upperBound() might be smaller than the lowerBound() to indicate inverted scales.

Scale divisions can be calculated from a QwtScaleEngine.

See also:
QwtScaleEngine::divideScale(), QwtPlot::setAxisScaleDiv(), QwtAbstractSlider::setScaleDiv()

Definition at line 36 of file qwt_scale_div.h.


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.

Definition at line 40 of file qwt_scale_div.h.


Constructor & Destructor Documentation

QwtScaleDiv::QwtScaleDiv ( double  lowerBound = 0.0,
double  upperBound = 0.0 
) [explicit]

Construct a division without ticks

Parameters:
lowerBoundFirst boundary
upperBoundSecond boundary
Note:
lowerBound might be greater than upperBound for inverted scales

Definition at line 22 of file qwt_scale_div.cpp.

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

Construct a scale division

Parameters:
intervalInterval
ticksList of major, medium and minor ticks

Definition at line 34 of file qwt_scale_div.cpp.

QwtScaleDiv::QwtScaleDiv ( double  lowerBound,
double  upperBound,
QList< double >  ticks[NTickTypes] 
) [explicit]

Construct a scale division

Parameters:
lowerBoundFirst boundary
upperBoundSecond boundary
ticksList of major, medium and minor ticks
Note:
lowerBound might be greater than upperBound for inverted scales

Definition at line 52 of file qwt_scale_div.cpp.

QwtScaleDiv::QwtScaleDiv ( double  lowerBound,
double  upperBound,
const QList< double > &  minorTicks,
const QList< double > &  mediumTicks,
const QList< double > &  majorTicks 
) [explicit]

Construct a scale division

Parameters:
lowerBoundFirst boundary
upperBoundSecond boundary
minorTicksList of minor ticks
mediumTicksList medium ticks
majorTicksList of major ticks
Note:
lowerBound might be greater than upperBound for inverted scales

Definition at line 72 of file qwt_scale_div.cpp.


Member Function Documentation

QwtScaleDiv QwtScaleDiv::bounded ( double  lowerBound,
double  upperBound 
) const

Return a scale division with an interval [lowerBound, upperBound] where all ticks outside this interval are removed

Parameters:
lowerBoundLower bound
upperBoundUpper bound
Returns:
Scale division with all ticks inside of the given interval
Note:
lowerBound might be greater than upperBound for inverted scales

Definition at line 264 of file qwt_scale_div.cpp.

bool QwtScaleDiv::contains ( double  value) const

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

Parameters:
valueValue
Returns:
true/false

Definition at line 213 of file qwt_scale_div.cpp.

Returns:
lowerBound -> upperBound

Definition at line 112 of file qwt_scale_div.cpp.

Invert the scale division

See also:
inverted()

Definition at line 225 of file qwt_scale_div.cpp.

Returns:
A scale division with inverted boundaries and ticks
See also:
invert()

Definition at line 245 of file qwt_scale_div.cpp.

bool QwtScaleDiv::isEmpty ( ) const

Check if the scale division is empty( lowerBound() == upperBound() )

Definition at line 196 of file qwt_scale_div.cpp.

bool QwtScaleDiv::isIncreasing ( ) const

Check if the scale division is increasing( lowerBound() <= upperBound() )

Definition at line 202 of file qwt_scale_div.cpp.

double QwtScaleDiv::lowerBound ( ) const
Returns:
First boundary
See also:
upperBound()

Definition at line 132 of file qwt_scale_div.cpp.

bool QwtScaleDiv::operator!= ( const QwtScaleDiv other) const

Inequality.

Returns:
true if this instance is not equal to other

Definition at line 190 of file qwt_scale_div.cpp.

bool QwtScaleDiv::operator== ( const QwtScaleDiv other) const

Equality operator.

Returns:
true if this instance is equal to other

Definition at line 169 of file qwt_scale_div.cpp.

double QwtScaleDiv::range ( ) const
Returns:
upperBound() - lowerBound()

Definition at line 160 of file qwt_scale_div.cpp.

void QwtScaleDiv::setInterval ( double  lowerBound,
double  upperBound 
)

Change the interval

Parameters:
lowerBoundFirst boundary
upperBoundSecond boundary
Note:
lowerBound might be greater than upperBound for inverted scales

Definition at line 92 of file qwt_scale_div.cpp.

void QwtScaleDiv::setInterval ( const QwtInterval interval)

Change the interval

Parameters:
intervalInterval

Definition at line 103 of file qwt_scale_div.cpp.

void QwtScaleDiv::setLowerBound ( double  lowerBound)

Set the first boundary

Parameters:
lowerBoundFirst boundary
See also:
lowerBiound(), setUpperBound()

Definition at line 123 of file qwt_scale_div.cpp.

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

Assign ticks

Parameters:
typeMinorTick, MediumTick or MajorTick
ticksValues of the tick positions

Definition at line 298 of file qwt_scale_div.cpp.

void QwtScaleDiv::setUpperBound ( double  upperBound)

Set the second boundary

Parameters:
upperBoundSecond boundary
See also:
upperBound(), setLowerBound()

Definition at line 143 of file qwt_scale_div.cpp.

QList< double > QwtScaleDiv::ticks ( int  type) const

Return a list of ticks

Parameters:
typeMinorTick, MediumTick or MajorTick
Returns:
Tick list

Definition at line 310 of file qwt_scale_div.cpp.

double QwtScaleDiv::upperBound ( ) const
Returns:
upper bound
See also:
lowerBound()

Definition at line 152 of file qwt_scale_div.cpp.


Member Data Documentation

double QwtScaleDiv::d_lowerBound [private]

Definition at line 99 of file qwt_scale_div.h.

QList<double> QwtScaleDiv::d_ticks[NTickTypes] [private]

Definition at line 101 of file qwt_scale_div.h.

double QwtScaleDiv::d_upperBound [private]

Definition at line 100 of file qwt_scale_div.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Fri Sep 1 2017 02:41:58