OpenMS
PainterBase Class Reference

An empty base class with some static convenience functions. More...

#include <OpenMS/VISUAL/PainterBase.h>

Inheritance diagram for PainterBase:
[legend]

Static Public Member Functions

static ShapeIcon toShapeIcon (const String &icon)
 
static void drawDashedLine (const QPoint &from, const QPoint &to, QPainter *painter, const QColor &color)
 static method to draw a dashed line More...
 
static void drawCross (const QPoint &position, QPainter *painter, const int size=8)
 draw a cross at position, using a certain size (= width = height) of the cross More...
 
static void drawCaret (const QPoint &position, QPainter *painter, const int size=8)
 draw a caret '^' at position, using a certain size (= width) of the caret More...
 
static void drawDiamond (const QPoint &position, QPainter *painter, const int size=8)
 draw an unfilled diamond at position, using a certain size (= width = height) of the diamond More...
 
static void drawIcon (const QPoint &pos, const QRgb &color, const ShapeIcon icon, Size s, QPainter &p)
 draws squares, circles etc More...
 
static QPainterPath getOpenArrow (int arrow_width)
 An arrow head which is open, i.e. '>'. More...
 
static QPainterPath getClosedArrow (int arrow_width)
 An arrow head which is closed, i.e. a triangle. More...
 
static QRectF drawLineWithArrows (QPainter *painter, const QPen &pen, const QPoint &start, const QPoint &end, const QPainterPath &arrow_start=QPainterPath(), const QPainterPath &arrow_end=QPainterPath())
 

Detailed Description

An empty base class with some static convenience functions.

Member Function Documentation

◆ drawCaret()

static void drawCaret ( const QPoint &  position,
QPainter *  painter,
const int  size = 8 
)
static

draw a caret '^' at position, using a certain size (= width) of the caret

Referenced by Annotation1DCaret< DataPoint >::draw().

◆ drawCross()

static void drawCross ( const QPoint &  position,
QPainter *  painter,
const int  size = 8 
)
static

draw a cross at position, using a certain size (= width = height) of the cross

◆ drawDashedLine()

static void drawDashedLine ( const QPoint &  from,
const QPoint &  to,
QPainter *  painter,
const QColor &  color 
)
static

static method to draw a dashed line

◆ drawDiamond()

static void drawDiamond ( const QPoint &  position,
QPainter *  painter,
const int  size = 8 
)
static

draw an unfilled diamond at position, using a certain size (= width = height) of the diamond

◆ drawIcon()

static void drawIcon ( const QPoint &  pos,
const QRgb &  color,
const ShapeIcon  icon,
Size  s,
QPainter &  p 
)
static

draws squares, circles etc

◆ drawLineWithArrows()

static QRectF drawLineWithArrows ( QPainter *  painter,
const QPen &  pen,
const QPoint &  start,
const QPoint &  end,
const QPainterPath &  arrow_start = QPainterPath(),
const QPainterPath &  arrow_end = QPainterPath() 
)
static
Parameters
painterThe painter to paint with
penFor setting line width and color
startStart position of the line
endEnd position of the line
arrow_startAn (optional) arrow head. Use 'getOpenArrow' or 'getClosedArrow' for predefined arrows
arrow_endAn (optional) arrow tail. Use 'getOpenArrow' or 'getClosedArrow' for predefined arrows
Returns
The bounding rectangle of the line and arrows (if any)

◆ getClosedArrow()

static QPainterPath getClosedArrow ( int  arrow_width)
static

An arrow head which is closed, i.e. a triangle.

◆ getOpenArrow()

static QPainterPath getOpenArrow ( int  arrow_width)
static

An arrow head which is open, i.e. '>'.

◆ toShapeIcon()

static ShapeIcon toShapeIcon ( const String icon)
static

translates 'diamond', 'square', 'circle', 'triangle' into a ShapeIcon

Exceptions
Exception::InvalidValueotherwise