OpenMS
Loading...
Searching...
No Matches
Painter1DBase Class Referenceabstract

A base class for painting all items from a data layer (as supported by class derived from here) onto a 1D Canvas. More...

#include <OpenMS/VISUAL/Painter1DBase.h>

Inheritance diagram for Painter1DBase:
[legend]
Collaboration diagram for Painter1DBase:
[legend]

Public Member Functions

virtual ~Painter1DBase ()=default
 
virtual void paint (QPainter *painter, Plot1DCanvas *canvas, int layer_index)=0
 Paints items using the given painter onto the canvas.
 
void drawAnnotations_ (const LayerData1DBase *layer, QPainter &painter, Plot1DCanvas *canvas) const
 

Additional Inherited Members

- Static Public Member Functions inherited from PainterBase
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
 
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
 
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
 
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
 
static void drawIcon (const QPoint &pos, const QRgb &color, const ShapeIcon icon, Size s, QPainter &p)
 draws squares, circles etc
 
static QPainterPath getOpenArrow (int arrow_width)
 An arrow head which is open, i.e. '>'.
 
static QPainterPath getClosedArrow (int arrow_width)
 An arrow head which is closed, i.e. a triangle.
 
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

A base class for painting all items from a data layer (as supported by class derived from here) onto a 1D Canvas.

Constructor & Destructor Documentation

◆ ~Painter1DBase()

virtual ~Painter1DBase ( )
virtualdefault

Member Function Documentation

◆ drawAnnotations_()

void drawAnnotations_ ( const LayerData1DBase layer,
QPainter &  painter,
Plot1DCanvas canvas 
) const

◆ paint()

virtual void paint ( QPainter *  painter,
Plot1DCanvas canvas,
int  layer_index 
)
pure virtual

Paints items using the given painter onto the canvas.

Parameters
[in]painterThe painter used for drawing
[in]canvasThe canvas to paint onto (should expose all the details needed, like canvas size, draw mode, colors etc)
[in]layer_indexWhich layer is currently painted (FIXME: remove when Canvas1D::DrawMode and PenStyle are factored out)

Implemented in Painter1DPeak, Painter1DChrom, and Painter1DIonMobility.