Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

AxisWidget Class Reference
[Visual]

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

#include <OpenMS/VISUAL/AxisWidget.h>

Inheritance diagram for AxisWidget:
QWidget

List of all members.



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

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<DoubleReal> > 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

DoubleReal getAxisMaximum (  )  const

returns the maximum value displayed on the axis

DoubleReal 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 ( DoubleReal  min,
DoubleReal  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

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

DoubleReal max_ [protected]

maximum value on the axis

DoubleReal 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 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:58 using doxygen 1.7.1