An annotation item which represents a vertical line (or more precisely a line along the gravity axis, i.e. it could also be horizontal) and text label on top.
More...
#include <OpenMS/VISUAL/ANNOTATION/Annotation1DVerticalLineItem.h>
|
| Annotation1DVerticalLineItem (const PointXYType ¢er_pos, const QColor &color=QColor("as_before"), const QString &text="") |
|
| Annotation1DVerticalLineItem (const PointXYType ¢er_pos, const float width, const int alpha255=128, const bool dashed_line=false, const QColor &color=QColor("as_before"), const QString &text="") |
|
| Annotation1DVerticalLineItem (const Annotation1DVerticalLineItem &rhs)=default |
| Copy constructor. More...
|
|
| ~Annotation1DVerticalLineItem () 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 &gr, 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 PointXYType &pos) |
| Sets the center position of the line (the widths will extend from there) More...
|
|
const PointXYType & | getPosition () const |
| Returns the position on the non-gravity-axis. More...
|
|
QRectF | getTextRect () const |
| size of the painted text (width and height of the rectangle) More...
|
|
void | setTextOffset (int offset) |
| offset the text by this much downwards in y-direction (to avoid overlaps etc) More...
|
|
Annotation1DItem * | clone () const override |
| Creates a copy of the item on the heap and returns a pointer. More...
|
|
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 () |
|
|
PointXYType | pos_ |
| The position of the line (gravity axis is ignored) More...
|
|
int | text_offset_ {0} |
| offset (in pixel coordinates of gravity axis) in for the text (to avoid overlaps) More...
|
|
float | width_ = 0 |
| width of the item in unit coordinates (allowing to show a 'band'; use =0 to make a thin line and not a band) More...
|
|
int | alpha255_ = 128 |
| transparency 0...255 of the band/line More...
|
|
bool | dashed_ {false} |
| is the band/line dashed? More...
|
|
QColor | color_ = Qt::black |
| The color of the line; if invalid, the current painter color will be used. More...
|
|
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...
|
|
An annotation item which represents a vertical line (or more precisely a line along the gravity axis, i.e. it could also be horizontal) and text label on top.
- See also
- Annotation1DItem
◆ Annotation1DVerticalLineItem() [1/3]
Constructor for a single vertical line of 1px width.
- Parameters
-
center_pos | Center of the line in unit coordinates (only the non-gravity component will be used) |
color | Optional color. If invalid (=default), the current painter color will be used when this is painted |
text | Optional text displayed next to the line. Can contain '
' which will force multiple lines. |
Referenced by Annotation1DVerticalLineItem::clone().
◆ Annotation1DVerticalLineItem() [2/3]
Annotation1DVerticalLineItem |
( |
const PointXYType & |
center_pos, |
|
|
const float |
width, |
|
|
const int |
alpha255 = 128 , |
|
|
const bool |
dashed_line = false , |
|
|
const QColor & |
color = QColor("as_before") , |
|
|
const QString & |
text = "" |
|
) |
| |
Constructor for a single vertical line of 1px width or a broader line (band) with the given width
- Parameters
-
center_pos | Center of the line in unit coordinates (only the non-gravity component will be used) |
width | Full width of the band in unit coordinates; use =0 to make a thin line and not a band; |
alpha255 | A transparency value from 0 (not visible), to 255 (fully opaque) |
dashed_line | Should the line/band be dashed |
color | Optional color. If invalid (=default), the current painter color will be used when this is painted |
text | Optional text displayed next to the line/band. Can contain '
' which will force multiple lines. Text will be plotted at the very top (modify using setTextYOffset()) |
◆ Annotation1DVerticalLineItem() [3/3]
◆ ~Annotation1DVerticalLineItem()
◆ clone()
◆ draw()
void draw |
( |
Plot1DCanvas *const |
canvas, |
|
|
QPainter & |
painter, |
|
|
bool |
flipped = false |
|
) |
| |
|
overridevirtual |
◆ ensureWithinDataRange()
void ensureWithinDataRange |
( |
Plot1DCanvas *const |
canvas, |
|
|
const int |
layer_index |
|
) |
| |
|
overridevirtual |
Ensures that the item has coordinates within the visible area of the canvas.
Implements Annotation1DItem.
◆ getPosition()
Returns the position on the non-gravity-axis.
◆ getTextRect()
QRectF getTextRect |
( |
| ) |
const |
size of the painted text (width and height of the rectangle)
◆ move()
Moves the item on the drawing canvas; behavior depends on item type and is implemented in the subclasses.
Implements Annotation1DItem.
◆ setPosition()
Sets the center position of the line (the widths will extend from there)
◆ setTextOffset()
void setTextOffset |
( |
int |
offset | ) |
|
offset the text by this much downwards in y-direction (to avoid overlaps etc)
◆ alpha255_
transparency 0...255 of the band/line
◆ color_
QColor color_ = Qt::black |
|
protected |
The color of the line; if invalid, the current painter color will be used.
◆ dashed_
◆ pos_
The position of the line (gravity axis is ignored)
◆ text_offset_
offset (in pixel coordinates of gravity axis) in for the text (to avoid overlaps)
◆ width_
width of the item in unit coordinates (allowing to show a 'band'; use =0 to make a thin line and not a band)