40 #include <QtGui/QColor> 69 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 =
"");
77 void draw(
Plot1DCanvas*
const canvas, QPainter& painter,
bool flipped =
false)
override;
An abstract class acting as an interface for the different 1D annotation items.
Definition: Annotation1DItem.h:59
void draw(Plot1DCanvas *const canvas, QPainter &painter, bool flipped=false) override
Draws the item on painter.
Annotation1DVerticalLineItem(const double x_pos, const QColor &color=QColor("as_before"), const QString &text="")
int y_text_offset_
offset in y for the text (to avoid overlaps)
Definition: Annotation1DVerticalLineItem.h:95
QColor color_
The color of the line; if invalid, the current painter color will be used.
Definition: Annotation1DVerticalLineItem.h:105
Canvas for visualization of one or several spectra.
Definition: Plot1DCanvas.h:70
~Annotation1DVerticalLineItem() override=default
Destructor.
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
void ensureWithinDataRange(Plot1DCanvas *const canvas) override
Ensures that the item has coordinates within the visible area of the canvas.
void move(const PointType &delta) override
Moves the item; behaviour depends on item type and is implemented in the subclasses.
An annotation item which represents a vertical line and text label on top.
Definition: Annotation1DVerticalLineItem.h:47
const double & getPosition() const
Returns the position.
QRectF getTextRect() const
size of the painted text (width and height of the rectangle)
void setPosition(const double &x)
Sets the uppermost position of the line.
void setTextYOffset(int y_offset)
offset the text by this much downwards in y-direction (to avoid overlaps etc)
float width_
width of the item (allowing to show a 'band' if > 1)
Definition: Annotation1DVerticalLineItem.h:98
bool dashed_
is the band/line dashed?
Definition: Annotation1DVerticalLineItem.h:102
float alpha255_
transparency 0...255 of the band/line
Definition: Annotation1DVerticalLineItem.h:100
double x_
The position of the vertical line.
Definition: Annotation1DVerticalLineItem.h:93