OpenMS  2.6.0
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Annotation1DPeakItem Class Reference

A peak annotation item. More...

#include <OpenMS/VISUAL/ANNOTATION/Annotation1DPeakItem.h>

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

Public Member Functions

 Annotation1DPeakItem (const PointType &peak_position, const QString &text, const QColor &color)
 Constructor. More...
 
 Annotation1DPeakItem (const Annotation1DPeakItem &rhs)
 Copy constructor. More...
 
 ~Annotation1DPeakItem () override
 Destructor. More...
 
void ensureWithinDataRange (Spectrum1DCanvas *const canvas) override
 Docu in base class. More...
 
void draw (Spectrum1DCanvas *const canvas, QPainter &painter, bool flipped=false) override
 Docu in base class. More...
 
void move (const PointType &) override
 Docu in base class. More...
 
const PointTypegetPeakPosition () const
 Returns the position of the label (peak) (in MZ/intensity coordinates) More...
 
void setPosition (const PointType &position)
 Sets the position of the label (in MZ/intensity coordinates) More...
 
const PointTypegetPosition () const
 Returns the position of the annotated peak (in MZ/intensity coordinates) More...
 
void setColor (const QColor &color)
 Set the color of the label. More...
 
const QColor & getColor () const
 Returns the color of the label. More...
 
- Public Member Functions inherited from Annotation1DItem
virtual ~Annotation1DItem ()
 Destructor. More...
 
const QRectF & boundingBox () const
 Returns the current bounding box of this item on the canvas where it has last been drawn. More...
 
bool isSelected () const
 Returns true if this item is currently selected on the canvas, else false. More...
 
void setSelected (bool selected)
 Sets whether this item is currently selected on the canvas or not. More...
 
void setText (const QString &text)
 Sets the text of the item. More...
 
const QString & getText () const
 Returns the text of the item. More...
 
bool editText ()
 

Static Public Member Functions

static QRectF calculateBoundingBox (const PointType &peak_position, const PointType &position, const QString &text, Spectrum1DCanvas *const canvas, bool flipped, QPoint &position_widget, QPoint &peak_position_widget, double &horizontal_shift, double &vertical_shift)
 Calculate bounding box in widget coordinates. More...
 

Protected Attributes

PointType peak_position_
 The position of the anchor (peak) (in MZ / intensity coordinates) More...
 
PointType position_
 The position of the label (in MZ / intensity coordinates) More...
 
QColor color_
 The color of the label. More...
 
- Protected Attributes inherited from Annotation1DItem
QRectF bounding_box_
 The current bounding box of this item on the canvas where it has last been drawn. More...
 
bool selected_
 Determines whether this item is currently selected on the canvas. More...
 
QString text_
 The displayed text. More...
 

Additional Inherited Members

- Public Types inherited from Annotation1DItem
typedef DPosition< 2 > PointType
 Type of the Points. More...
 
typedef float IntensityType
 Intensity type. More...
 
typedef double CoordinateType
 Coordinate type. More...
 
- Protected Member Functions inherited from Annotation1DItem
 Annotation1DItem (const QString &text)
 Constructor. More...
 
 Annotation1DItem (const Annotation1DItem &rhs)
 Copy constructor. More...
 
void drawBoundingBox_ (QPainter &painter)
 Draws the bounding_box_. More...
 

Detailed Description

A peak annotation item.

See also
Annotation1DItem

Constructor & Destructor Documentation

◆ Annotation1DPeakItem() [1/2]

Annotation1DPeakItem ( const PointType peak_position,
const QString &  text,
const QColor &  color 
)

Constructor.

◆ Annotation1DPeakItem() [2/2]

Copy constructor.

◆ ~Annotation1DPeakItem()

~Annotation1DPeakItem ( )
override

Destructor.

Member Function Documentation

◆ calculateBoundingBox()

static QRectF calculateBoundingBox ( const PointType peak_position,
const PointType position,
const QString &  text,
Spectrum1DCanvas *const  canvas,
bool  flipped,
QPoint &  position_widget,
QPoint &  peak_position_widget,
double horizontal_shift,
double vertical_shift 
)
static

Calculate bounding box in widget coordinates.

◆ draw()

void draw ( Spectrum1DCanvas *const  canvas,
QPainter &  painter,
bool  flipped = false 
)
overridevirtual

Docu in base class.

Implements Annotation1DItem.

◆ ensureWithinDataRange()

void ensureWithinDataRange ( Spectrum1DCanvas *const  canvas)
overridevirtual

Docu in base class.

Implements Annotation1DItem.

◆ getColor()

const QColor& getColor ( ) const

Returns the color of the label.

◆ getPeakPosition()

const PointType& getPeakPosition ( ) const

Returns the position of the label (peak) (in MZ/intensity coordinates)

◆ getPosition()

const PointType& getPosition ( ) const

Returns the position of the annotated peak (in MZ/intensity coordinates)

◆ move()

void move ( const PointType )
overridevirtual

Docu in base class.

Implements Annotation1DItem.

◆ setColor()

void setColor ( const QColor &  color)

Set the color of the label.

◆ setPosition()

void setPosition ( const PointType position)

Sets the position of the label (in MZ/intensity coordinates)

Member Data Documentation

◆ color_

QColor color_
protected

The color of the label.

◆ peak_position_

PointType peak_position_
protected

The position of the anchor (peak) (in MZ / intensity coordinates)

◆ position_

PointType position_
protected

The position of the label (in MZ / intensity coordinates)