Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
List of all members
AxisWidget Class Reference

Widget that represents an axis of a graph. More...

#include <OpenMS/VISUAL/AxisWidget.h>

Inheritance diagram for AxisWidget:
QWidget
typedef std::vector< std::vector< double > > GridVector
 Type definitions. More...
 
GridVector grid_line_
 Vector that defines the position of the ticks/gridlines and the shown values on axis. More...
 
bool is_log_
 format of axis scale (linear or logarithmic) More...
 
bool show_legend_
 display of legend enabled or not More...
 
AxisPainter::Alignment alignment_
 Position of the axis (right, left, top, down as defined in ALIGNMENT_ENUM) More...
 
bool is_inverse_orientation_
 true if axis label are displayed in inverse order (left to right or bottom to top) More...
 
UInt margin_
 margin of axis More...
 
double min_
 minimum value on the axis More...
 
double max_
 maximum value on the axis More...
 
String legend_
 text/unit on axis More...
 
UInt tick_level_
 maximum number of tick levels (default=2) More...
 
bool allow_short_numbers_
 true if k/M/G units can be used More...
 
 AxisWidget (AxisPainter::Alignment alignment, const char *legend="", QWidget *parent=0)
 constructor More...
 
virtual ~AxisWidget ()
 destructor More...
 
void setMargin (UInt size)
 sets the margin on the top/right side (default is 0) More...
 
UInt margin ()
 returns the margin More...
 
void showLegend (bool show_legend)
 enable the display of the legend (default true) More...
 
bool isLegendShown () const
 returns true if legend is shown More...
 
void setLegend (const String &legend)
 sets the legend text More...
 
const StringgetLegend ()
 returns the actual legend text More...
 
const GridVectorgridLines ()
 returns the currently used grid lines More...
 
void setLogScale (bool is_log)
 sets the axis to logarithmic scale More...
 
bool isLogScale ()
 returns true if the axis has logarithmic scale More...
 
void setInverseOrientation (bool inverse_orientation)
 set true to display the axis label in inverse order (left to right or bottom to top) More...
 
bool hasInverseOrientation ()
 returns if the axis label is displayed in inverse order More...
 
void setAllowShortNumbers (bool short_nums)
 set true to allow for shortened numbers (with k/M/G units) on the axis label More...
 
double getAxisMinimum () const
 returns the minimum value displayed on the axis More...
 
double getAxisMaximum () const
 returns the maximum value displayed on the axis More...
 
void paint (QPainter *painter, QPaintEvent *e)
 Actual painting takes place here. More...
 
void setAxisBounds (double min, double max)
 sets min/max of the axis More...
 
void setTickLevel (UInt level)
 set maximum number of tick levels ('1' or '2', default: '2') More...
 
void paintEvent (QPaintEvent *)
 Reimplemented Qt event (calls paint with "this") More...
 

Detailed Description

Widget that represents an axis of a graph.

Additional to ticks and tick values a label e.g. the unit can be displayed. It supports both linear and logarithmic scale.

AxisWidget.png

The above image shows a horizontal example axis.

Member Typedef Documentation

typedef std::vector<std::vector<double> > GridVector

Type definitions.

Vector of vector of doubles that defines the grid

Constructor & Destructor Documentation

AxisWidget ( AxisPainter::Alignment  alignment,
const char *  legend = "",
QWidget parent = 0 
)

constructor

virtual ~AxisWidget ( )
virtual

destructor

Member Function Documentation

double getAxisMaximum ( ) const

returns the maximum value displayed on the axis

double getAxisMinimum ( ) const

returns the minimum value displayed on the axis

const String& getLegend ( )

returns the actual legend text

const GridVector& gridLines ( )

returns the currently used grid lines

bool hasInverseOrientation ( )

returns if the axis label is displayed in inverse order

bool isLegendShown ( ) const

returns true if legend is shown

bool isLogScale ( )

returns true if the axis has logarithmic scale

UInt margin ( )

returns the margin

void paint ( QPainter *  painter,
QPaintEvent *  e 
)

Actual painting takes place here.

void paintEvent ( QPaintEvent *  )
protected

Reimplemented Qt event (calls paint with "this")

void setAllowShortNumbers ( bool  short_nums)

set true to allow for shortened numbers (with k/M/G units) on the axis label

void setAxisBounds ( double  min,
double  max 
)
slot

sets min/max of the axis

void setInverseOrientation ( bool  inverse_orientation)

set true to display the axis label in inverse order (left to right or bottom to top)

void setLegend ( const String legend)
void setLogScale ( bool  is_log)

sets the axis to logarithmic scale

void setMargin ( UInt  size)

sets the margin on the top/right side (default is 0)

void setTickLevel ( UInt  level)
slot

set maximum number of tick levels ('1' or '2', default: '2')

void showLegend ( bool  show_legend)

enable the display of the legend (default true)

Member Data Documentation

AxisPainter::Alignment alignment_
protected

Position of the axis (right, left, top, down as defined in ALIGNMENT_ENUM)

bool allow_short_numbers_
protected

true if k/M/G units can be used

GridVector grid_line_
protected

Vector that defines the position of the ticks/gridlines and the shown values on axis.

bool is_inverse_orientation_
protected

true if axis label are displayed in inverse order (left to right or bottom to top)

bool is_log_
protected

format of axis scale (linear or logarithmic)

String legend_
protected

text/unit on axis

UInt margin_
protected

margin of axis

double max_
protected

maximum value on the axis

double min_
protected

minimum value on the axis

bool show_legend_
protected

display of legend enabled or not

UInt tick_level_
protected

maximum number of tick levels (default=2)


OpenMS / TOPP release 2.0.0 Documentation generated on Tue Nov 1 2016 16:34:46 using doxygen 1.8.11