OpenMS  3.0.0
Painter2DBase Class Referenceabstract

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

#include <OpenMS/VISUAL/Painter2DBase.h>

Inheritance diagram for Painter2DBase:
Painter2DChrom Painter2DConsensus Painter2DFeature Painter2DIdent Painter2DIonMobility Painter2DPeak

Public Member Functions

virtual ~Painter2DBase ()=default
 
virtual void paint (QPainter *painter, Plot2DCanvas *canvas, int layer_index)=0
 Paints items using the given painter onto the canvas. More...
 
virtual void highlightElement (QPainter *painter, Plot2DCanvas *canvas, const PeakIndex element)
 Emphasize a certain element (e.g. feature), e.g. when mouse hovering. By default, nothing is highlighted. Override for subclasses if you need highlighting. More...
 

Static Protected Member Functions

static void paintIcon_ (const QPoint &pos, const QRgb &color, const String &icon, Size s, QPainter &p)
 draws squares, circles etc More...
 
static void paintConvexHull_ (QPainter &painter, Plot2DCanvas *canvas, const ConvexHull2D &hull, bool has_identifications)
 Paints a convex hull. More...
 
static void paintConvexHulls_ (QPainter &painter, Plot2DCanvas *canvas, const std::vector< ConvexHull2D > &hulls, bool has_identifications)
 Paints convex hulls. More...
 
static void paintPeptideIDs_ (QPainter *painter, Plot2DCanvas *canvas, const IPeptideIds::PepIds &ids, int layer_index)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ~Painter2DBase()

virtual ~Painter2DBase ( )
virtualdefault

Member Function Documentation

◆ highlightElement()

virtual void highlightElement ( QPainter *  painter,
Plot2DCanvas canvas,
const PeakIndex  element 
)
virtual

Emphasize a certain element (e.g. feature), e.g. when mouse hovering. By default, nothing is highlighted. Override for subclasses if you need highlighting.

Parameters
painterThe painter used for drawing
canvasThe canvas to paint onto (should expose all the details needed, like canvas size, draw mode, colors etc)
elementWhich item of the current layer should be drawn?

Reimplemented in Painter2DConsensus, and Painter2DFeature.

◆ paint()

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

Paints items using the given painter onto the canvas.

Parameters
painterThe painter used for drawing
canvasThe canvas to paint onto (should expose all the details needed, like canvas size, draw mode, colors etc)
layer_indexWhich layer is currently painted

Implemented in Painter2DIdent, Painter2DConsensus, Painter2DFeature, Painter2DIonMobility, Painter2DChrom, and Painter2DPeak.

◆ paintConvexHull_()

static void paintConvexHull_ ( QPainter &  painter,
Plot2DCanvas canvas,
const ConvexHull2D hull,
bool  has_identifications 
)
staticprotected

Paints a convex hull.

Parameters
painterThe QPainter to paint on
canvasThe canvas (for configuration details)
hullReference to convex hull
has_identificationsDraw hulls in green (true) or blue color (false)

◆ paintConvexHulls_()

static void paintConvexHulls_ ( QPainter &  painter,
Plot2DCanvas canvas,
const std::vector< ConvexHull2D > &  hulls,
bool  has_identifications 
)
staticprotected

Paints convex hulls.

Parameters
painterThe QPainter to paint on
canvasThe canvas (for configuration details)
hullsReference to convex hulls
has_identificationsDraw hulls in green (true) or blue color (false)

◆ paintIcon_()

static void paintIcon_ ( const QPoint &  pos,
const QRgb &  color,
const String icon,
Size  s,
QPainter &  p 
)
staticprotected

draws squares, circles etc

◆ paintPeptideIDs_()

static void paintPeptideIDs_ ( QPainter *  painter,
Plot2DCanvas canvas,
const IPeptideIds::PepIds ids,
int  layer_index 
)
staticprotected