OpenMS
|
A peak annotation item. More...
#include <OpenMS/VISUAL/ANNOTATION/Annotation1DPeakItem.h>
Public Member Functions | |
Annotation1DPeakItem (const DataPoint &peak_position, const QString &text, const QColor &color) | |
Constructor. More... | |
Annotation1DPeakItem (const Annotation1DPeakItem &rhs)=default | |
Copy constructor. More... | |
~Annotation1DPeakItem () override=default | |
Destructor. More... | |
void | draw (Plot1DCanvas *const canvas, QPainter &painter, bool flipped=false) override |
Draws the item on painter . More... | |
void | move (const PointXYType delta, const Gravitator &, const DimMapper< 2 > &dim_mapper) override |
Moves the item on the drawing canvas; behavior depends on item type and is implemented in the subclasses. More... | |
void | setPosition (const DataPoint &position) |
Sets the position of the label. More... | |
const DataPoint & | getPosition () const |
Returns the position of the label (peak) More... | |
const DataPoint & | getPeakPosition () const |
Returns the position of the annotated peak. More... | |
void | ensureWithinDataRange (Plot1DCanvas *const canvas, const int layer_index) override |
Ensures that the item has coordinates within the visible area of the canvas. More... | |
void | setColor (const QColor &color) |
Set the color of the label. More... | |
const QColor & | getColor () const |
Returns the color of the label. More... | |
PeptideHit::PeakAnnotation | toPeakAnnotation () const |
Convert the 'text()' to a Peptide::PeakAnnotation. More... | |
Annotation1DItem * | clone () const override |
Creates a copy of the item on the heap and returns a pointer. 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 () |
Protected Attributes | |
DataPoint | peak_position_ |
The position of the anchor (e.g. the Peak1D) More... | |
DataPoint | position_ |
The position of the label (e.g. the Peak1D) 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 | |
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... | |
A peak annotation item.
|
inline |
Constructor.
Referenced by Annotation1DPeakItem< DataPoint >::clone().
|
default |
Copy constructor.
|
overridedefault |
Destructor.
|
inlineoverridevirtual |
Creates a copy of the item on the heap and returns a pointer.
Implements Annotation1DItem.
References Annotation1DPeakItem< DataPoint >::Annotation1DPeakItem().
|
inlineoverridevirtual |
Draws the item on painter
.
Implements Annotation1DItem.
References DPosition< D, TCoordinateType >::abs(), Annotation1DItem::bounding_box_, Annotation1DPeakItem< DataPoint >::color_, Plot1DCanvas::dataToWidget(), Annotation1DItem::drawBoundingBox_(), Plot1DCanvas::getGravitator(), PlotCanvas::getMapper(), Annotation1DItem::getText(), Gravitator::gravitateZero(), OpenMS::Constants::h, OpenMS::GUIHelpers::intersectionPoint(), DimMapper< N_DIM >::map(), Annotation1DPeakItem< DataPoint >::peak_position_, Annotation1DPeakItem< DataPoint >::position_, Annotation1DItem::selected_, Gravitator::swap(), Annotation1DItem::text_, and Plot1DCanvas::widgetToDataDistance().
|
inlineoverridevirtual |
Ensures that the item has coordinates within the visible area of the canvas.
Implements Annotation1DItem.
References Annotation1DPeakItem< DataPoint >::position_, and Plot1DCanvas::pushIntoDataRange().
|
inline |
Returns the color of the label.
References Annotation1DPeakItem< DataPoint >::color_.
|
inline |
Returns the position of the annotated peak.
References Annotation1DPeakItem< DataPoint >::peak_position_.
Referenced by Annotation1DPeakItem< DataPoint >::toPeakAnnotation().
|
inline |
Returns the position of the label (peak)
References Annotation1DPeakItem< DataPoint >::position_.
|
inlineoverridevirtual |
Moves the item on the drawing canvas; behavior depends on item type and is implemented in the subclasses.
Implements Annotation1DItem.
References DimMapper< N_DIM >::fromXY(), DimMapper< N_DIM >::map(), and Annotation1DPeakItem< DataPoint >::position_.
|
inline |
Set the color of the label.
References Annotation1DPeakItem< DataPoint >::color_.
|
inline |
Sets the position of the label.
References Annotation1DPeakItem< DataPoint >::position_.
|
inline |
Convert the 'text()' to a Peptide::PeakAnnotation.
References PeptideHit::PeakAnnotation::annotation, PeptideHit::PeakAnnotation::charge, Annotation1DPeakItem< DataPoint >::getPeakPosition(), Annotation1DItem::getText(), PeptideHit::PeakAnnotation::intensity, and PeptideHit::PeakAnnotation::mz.
|
protected |
The color of the label.
Referenced by Annotation1DPeakItem< DataPoint >::draw(), Annotation1DPeakItem< DataPoint >::getColor(), and Annotation1DPeakItem< DataPoint >::setColor().
|
protected |
The position of the anchor (e.g. the Peak1D)
Referenced by Annotation1DPeakItem< DataPoint >::draw(), and Annotation1DPeakItem< DataPoint >::getPeakPosition().
|
protected |
The position of the label (e.g. the Peak1D)
Referenced by Annotation1DPeakItem< DataPoint >::draw(), Annotation1DPeakItem< DataPoint >::ensureWithinDataRange(), Annotation1DPeakItem< DataPoint >::getPosition(), Annotation1DPeakItem< DataPoint >::move(), and Annotation1DPeakItem< DataPoint >::setPosition().