![]() |
OpenMS
|
An annotation item which paints a set of carets on the canvas. More...
#include <OpenMS/VISUAL/ANNOTATION/Annotation1DCaret.h>
Public Types | |
| typedef std::vector< DataPoint > | PositionsType |
| using | PointType = DataPoint |
Public Member Functions | |
| Annotation1DCaret (const PositionsType &caret_positions, const QString &text, const QColor &color, const QColor &connection_line_color) | |
| Constructor. More... | |
| Annotation1DCaret (const Annotation1DCaret &rhs)=default | |
| Copy constructor. More... | |
| ~Annotation1DCaret () override=default | |
| Destructor. 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 | 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... | |
| const PositionsType & | getCaretPositions () const |
| Returns the positions of the lines (in unit coordinates) More... | |
| void | setPosition (const DataPoint &position) |
| Sets the position of the label (in unit coordinates) More... | |
| const DataPoint & | getPosition () const |
| Returns the position of the annotated peak (in unit coordinates) More... | |
| void | setColor (const QColor &color) |
| Set the color of the carets (color of text must be set using html) More... | |
| const QColor & | getColor () const |
| Returns the color of the carets. More... | |
| void | setRichText (const QString &text) |
| 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 | |
| PositionsType | caret_positions_ |
| DataPoint | position_ |
| The position of the label (in unit coordinates) More... | |
| QColor | color_ |
| The color of the label. More... | |
| QColor | connection_line_color_ |
| The color of the (optional) dashed line connecting peak and label. More... | |
| QStaticText | st_ |
| Holds the (rich) text. 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... | |
An annotation item which paints a set of carets on the canvas.
Most useful to visualize (theoretical) isotope distributions (one caret per isotope position). Additionally, a text annotation can be provided.
| using PointType = DataPoint |
| typedef std::vector<DataPoint> PositionsType |
|
inline |
Constructor.
References Annotation1DCaret< DataPoint >::st_.
Referenced by Annotation1DCaret< DataPoint >::clone().
|
default |
Copy constructor.
|
overridedefault |
Destructor.
|
inlineoverridevirtual |
Creates a copy of the item on the heap and returns a pointer.
Implements Annotation1DItem.
References Annotation1DCaret< DataPoint >::Annotation1DCaret().
|
inlineoverridevirtual |
Draws the item on painter.
Implements Annotation1DItem.
References Annotation1DItem::bounding_box_, Annotation1DCaret< DataPoint >::caret_positions_, Annotation1DCaret< DataPoint >::color_, Plot1DCanvas::dataToWidget(), Annotation1DItem::drawBoundingBox_(), PainterBase::drawCaret(), PlotCanvas::getMapper(), OpenMS::GUIHelpers::intersectionPoint(), DimMapper< N_DIM >::map(), Annotation1DCaret< DataPoint >::position_, Annotation1DItem::selected_, and Annotation1DCaret< DataPoint >::st_.
|
inlineoverridevirtual |
Ensures that the item has coordinates within the visible area of the canvas.
Implements Annotation1DItem.
References Annotation1DCaret< DataPoint >::position_, and Plot1DCanvas::pushIntoDataRange().
|
inline |
Returns the positions of the lines (in unit coordinates)
References Annotation1DCaret< DataPoint >::caret_positions_.
|
inline |
Returns the color of the carets.
References Annotation1DCaret< DataPoint >::color_.
|
inline |
Returns the position of the annotated peak (in unit coordinates)
References Annotation1DCaret< 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 Annotation1DCaret< DataPoint >::position_.
|
inline |
Set the color of the carets (color of text must be set using html)
References Annotation1DCaret< DataPoint >::color_.
|
inline |
Sets the position of the label (in unit coordinates)
References Annotation1DCaret< DataPoint >::position_.
|
inline |
The text to display (optional). Rendered using QStaticText, so HTML formatting is allowed.
References Annotation1DCaret< DataPoint >::st_, and Annotation1DItem::text_.
|
protected |
The positions of points (in unit coordinates) Ensure positions are sorted by m/z axis (or equivalent) when assigning
Referenced by Annotation1DCaret< DataPoint >::draw(), and Annotation1DCaret< DataPoint >::getCaretPositions().
|
protected |
The color of the label.
Referenced by Annotation1DCaret< DataPoint >::draw(), Annotation1DCaret< DataPoint >::getColor(), and Annotation1DCaret< DataPoint >::setColor().
|
protected |
The color of the (optional) dashed line connecting peak and label.
|
protected |
The position of the label (in unit coordinates)
Referenced by Annotation1DCaret< DataPoint >::draw(), Annotation1DCaret< DataPoint >::ensureWithinDataRange(), Annotation1DCaret< DataPoint >::getPosition(), Annotation1DCaret< DataPoint >::move(), and Annotation1DCaret< DataPoint >::setPosition().
|
protected |
Holds the (rich) text.
Referenced by Annotation1DCaret< DataPoint >::Annotation1DCaret(), Annotation1DCaret< DataPoint >::draw(), and Annotation1DCaret< DataPoint >::setRichText().