OpenMS  2.7.0
Public Types | Static Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
AxisPainter Class Reference

Draws a coordinate axis. It has only static methods, that's why the constructor is private. More...

#include <OpenMS/VISUAL/AxisPainter.h>

Public Types

enum  Alignment { TOP , BOTTOM , LEFT , RIGHT }
 Where the axis is placed. More...
 
typedef std::vector< std::vector< double > > GridVector
 Typedef for the grid vector. More...
 

Static Public Member Functions

static void paint (QPainter *painter, QPaintEvent *e, const double &min, const double &max, const GridVector &grid, const Int width, const Int height, const Alignment alignment, const UInt margin, const bool show_legend, const String legend, const bool shorten_number, const bool is_log, const bool is_inverse_orientation)
 Draws an axis. More...
 

Private Member Functions

 AxisPainter ()
 Constructor: only static methods. More...
 

Static Private Member Functions

static void getShortenedNumber_ (QString &short_num, double number)
 sets short_num to a shortened string representation ("123.4 k/M/G") of number More...
 
static double scale_ (double x, bool is_log)
 Scale axis values to correct value (i.e. reverse log, unit conversion) More...
 

Detailed Description

Draws a coordinate axis. It has only static methods, that's why the constructor is private.

Member Typedef Documentation

◆ GridVector

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

Typedef for the grid vector.

Member Enumeration Documentation

◆ Alignment

enum Alignment

Where the axis is placed.

Enumerator
TOP 
BOTTOM 
LEFT 
RIGHT 

Constructor & Destructor Documentation

◆ AxisPainter()

AxisPainter ( )
private

Constructor: only static methods.

Member Function Documentation

◆ getShortenedNumber_()

static void getShortenedNumber_ ( QString &  short_num,
double  number 
)
staticprivate

sets short_num to a shortened string representation ("123.4 k/M/G") of number

◆ paint()

static void paint ( QPainter *  painter,
QPaintEvent *  e,
const double &  min,
const double &  max,
const GridVector grid,
const Int  width,
const Int  height,
const Alignment  alignment,
const UInt  margin,
const bool  show_legend,
const String  legend,
const bool  shorten_number,
const bool  is_log,
const bool  is_inverse_orientation 
)
static

Draws an axis.

◆ scale_()

static double scale_ ( double  x,
bool  is_log 
)
staticprivate

Scale axis values to correct value (i.e. reverse log, unit conversion)