39 #include <QtGui/QColor>
69 const QString& text =
"");
81 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:62
An annotation item which represents a vertical line (or more precisely a line along the gravity axis,...
Definition: Annotation1DVerticalLineItem.h:48
PointXYType pos_
The position of the line (gravity axis is ignored)
Definition: Annotation1DVerticalLineItem.h:105
Annotation1DItem * clone() const override
Creates a copy of the item on the heap and returns a pointer.
Definition: Annotation1DVerticalLineItem.h:99
bool dashed_
is the band/line dashed?
Definition: Annotation1DVerticalLineItem.h:113
Annotation1DVerticalLineItem(const PointXYType ¢er_pos, const QColor &color=QColor("as_before"), const QString &text="")
void draw(Plot1DCanvas *const canvas, QPainter &painter, bool flipped=false) override
Draws the item on painter.
QColor color_
The color of the line; if invalid, the current painter color will be used.
Definition: Annotation1DVerticalLineItem.h:115
QRectF getTextRect() const
size of the painted text (width and height of the rectangle)
void ensureWithinDataRange(Plot1DCanvas *const canvas, const int layer_index) override
Ensures that the item has coordinates within the visible area of the canvas.
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.
int text_offset_
offset (in pixel coordinates of gravity axis) in for the text (to avoid overlaps)
Definition: Annotation1DVerticalLineItem.h:107
const PointXYType & getPosition() const
Returns the position on the non-gravity-axis.
void setTextOffset(int offset)
offset the text by this much downwards in y-direction (to avoid overlaps etc)
int alpha255_
transparency 0...255 of the band/line
Definition: Annotation1DVerticalLineItem.h:111
float width_
width of the item in unit coordinates (allowing to show a 'band'; use =0 to make a thin line and not ...
Definition: Annotation1DVerticalLineItem.h:109
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 subclas...
void setPosition(const PointXYType &pos)
Sets the center position of the line (the widths will extend from there)
~Annotation1DVerticalLineItem() override=default
Destructor.
Manipulates X or Y component of points in the X-Y plane, by assuming one axis (either X or Y axis) ha...
Definition: Plot1DCanvas.h:68
Canvas for visualization of one or several spectra.
Definition: Plot1DCanvas.h:321
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48