An annotation item which represents a vertical line and text label on top.
More...
#include <OpenMS/VISUAL/ANNOTATION/Annotation1DVerticalLineItem.h>
|
| Annotation1DVerticalLineItem (const double x_pos, const QColor &color=QColor("as_before"), const QString &text="") |
|
| Annotation1DVerticalLineItem (const double x_center_pos, const double 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) 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 PointType &delta) override |
| Moves the item; behaviour depends on item type and is implemented in the subclasses. More...
|
|
void | setPosition (const double &x) |
| Sets the uppermost position of the line. More...
|
|
const double & | getPosition () const |
| Returns the position. More...
|
|
QRectF | getTextRect () const |
| size of the painted text (width and height of the rectangle) More...
|
|
void | setTextYOffset (int y_offset) |
| offset the text by this much downwards in y-direction (to avoid overlaps etc) 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 () |
|
|
double | x_ = -1 |
| The position of the vertical line. More...
|
|
int | y_text_offset_ {0} |
| offset in y for the text (to avoid overlaps) More...
|
|
float | width_ = 1 |
| width of the item (allowing to show a 'band' if > 1) More...
|
|
float | 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 and text label on top.
- See also
- Annotation1DItem
◆ Annotation1DVerticalLineItem() [1/3]
Constructor for a single vertical line of 1px width.
- Parameters
-
x_pos | X-coordinate as show on the axis |
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. |
◆ Annotation1DVerticalLineItem() [2/3]
Annotation1DVerticalLineItem |
( |
const double |
x_center_pos, |
|
|
const double |
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
-
x_center_pos | X-coordinate of the center as show on the axis |
width | Full width of the band; use 0 or 1 for a 1px line. |
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()
◆ draw()
void draw |
( |
Plot1DCanvas *const |
canvas, |
|
|
QPainter & |
painter, |
|
|
bool |
flipped = false |
|
) |
| |
|
overridevirtual |
◆ ensureWithinDataRange()
Ensures that the item has coordinates within the visible area of the canvas.
Implements Annotation1DItem.
◆ getPosition()
const double& getPosition |
( |
| ) |
const |
◆ getTextRect()
QRectF getTextRect |
( |
| ) |
const |
size of the painted text (width and height of the rectangle)
◆ move()
Moves the item; behaviour depends on item type and is implemented in the subclasses.
Implements Annotation1DItem.
◆ setPosition()
void setPosition |
( |
const double & |
x | ) |
|
Sets the uppermost position of the line.
◆ setTextYOffset()
void setTextYOffset |
( |
int |
y_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_
◆ width_
width of the item (allowing to show a 'band' if > 1)
◆ x_
The position of the vertical line.
◆ y_text_offset_
offset in y for the text (to avoid overlaps)