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