35 #ifndef OPENMS_VISUAL_ANNOTATION_ANNOTATION1DITEM_H 36 #define OPENMS_VISUAL_ANNOTATION_ANNOTATION1DITEM_H 40 #include <QtCore/QRectF> 41 #include <QtCore/QString> 47 class Spectrum1DCanvas;
86 void setText(
const QString & text);
89 const QString &
getText()
const;
99 virtual void draw(
Spectrum1DCanvas *
const canvas, QPainter & painter,
bool flipped =
false) = 0;
102 virtual void move(
const PointType & delta) = 0;
An abstract class acting as an interface for the different 1D annotation items.
Definition: Annotation1DItem.h:60
bool selected_
Determines whether this item is currently selected on the canvas.
Definition: Annotation1DItem.h:118
bool isSelected() const
Returns true if this item is currently selected on the canvas, else false.
virtual ~Annotation1DItem()
Destructor.
virtual void draw(Spectrum1DCanvas *const canvas, QPainter &painter, bool flipped=false)=0
Draws the item on painter.
const QRectF & boundingBox() const
Returns the current bounding box of this item on the canvas where it has last been drawn...
void drawBoundingBox_(QPainter &painter)
Draws the bounding_box_.
Annotation1DItem(const QString &text)
Constructor.
const QString & getText() const
Returns the text of the item.
void setSelected(bool selected)
Sets whether this item is currently selected on the canvas or not.
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
DPosition< 2 > PointType
Type of the Points.
Definition: Annotation1DItem.h:65
QRectF bounding_box_
The current bounding box of this item on the canvas where it has last been drawn. ...
Definition: Annotation1DItem.h:115
void setText(const QString &text)
Sets the text of the item.
Canvas for visualization of one or several spectra.
Definition: Spectrum1DCanvas.h:68
float IntensityType
Intensity type.
Definition: Annotation1DItem.h:68
double CoordinateType
Coordinate type.
Definition: Annotation1DItem.h:71
virtual void ensureWithinDataRange(Spectrum1DCanvas *const canvas)=0
Ensures that the item has coordinates within the visible area of the canvas.
virtual void move(const PointType &delta)=0
Moves the item; behaviour depends on item type and is implemented in the subclasses.
QString text_
The displayed text.
Definition: Annotation1DItem.h:121