OpenMS
Painter2DConsensus Class Reference

Painter2D for ConsensusFeatures. More...

#include <OpenMS/VISUAL/Painter2DBase.h>

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

Public Member Functions

 Painter2DConsensus (const LayerDataConsensus *parent)
 C'tor which remembers the layer to paint. More...
 
void paint (QPainter *, Plot2DCanvas *canvas, int layer_index) override
 Paints items using the given painter onto the canvas. More...
 
void highlightElement (QPainter *painter, Plot2DCanvas *canvas, const PeakIndex element) override
 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...
 
- Public Member Functions inherited from Painter2DBase
virtual ~Painter2DBase ()=default
 

Protected Member Functions

void paintConsensusElements_ (QPainter *painter, Plot2DCanvas *canvas, Size layer_index)
 Paints the consensus elements of a consensus features layer. More...
 
void paintConsensusElement_ (QPainter *painter, Plot2DCanvas *canvas, Size layer_index, const ConsensusFeature &cf)
 Paints one consensus element of a consensus features layer. More...
 
bool isConsensusFeatureVisible_ (const Plot2DCanvas *canvas, const ConsensusFeature &cf, Size layer_index)
 checks if any element of a consensus feature is currently visible. More...
 

Protected Attributes

const LayerDataConsensuslayer_
 the data to paint More...
 

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 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())
 
- Static Protected Member Functions inherited from Painter2DBase
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

Painter2D for ConsensusFeatures.

Constructor & Destructor Documentation

◆ Painter2DConsensus()

C'tor which remembers the layer to paint.

Member Function Documentation

◆ highlightElement()

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

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 from Painter2DBase.

◆ isConsensusFeatureVisible_()

bool isConsensusFeatureVisible_ ( const Plot2DCanvas canvas,
const ConsensusFeature cf,
Size  layer_index 
)
protected

checks if any element of a consensus feature is currently visible.

Parameters
canvasThe canvas (for configuration details)
cfThe ConsensusFeature that needs checking
layer_indexIndex of the layer.

◆ paint()

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

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

Implements Painter2DBase.

◆ paintConsensusElement_()

void paintConsensusElement_ ( QPainter *  painter,
Plot2DCanvas canvas,
Size  layer_index,
const ConsensusFeature cf 
)
protected

Paints one consensus element of a consensus features layer.

Parameters
painterThe QPainter to paint on
canvasThe canvas (for configuration details)
layer_indexIndex of the layer
cfReference to the consensus feature to be painted

◆ paintConsensusElements_()

void paintConsensusElements_ ( QPainter *  painter,
Plot2DCanvas canvas,
Size  layer_index 
)
protected

Paints the consensus elements of a consensus features layer.

Parameters
painterThe QPainter to paint on
canvasThe canvas (for configuration details)
layer_indexIndex of the layer

Member Data Documentation

◆ layer_

const LayerDataConsensus* layer_
protected

the data to paint