An abstract class acting as an interface for the different 1D annotation items. More...
#include <OpenMS/VISUAL/ANNOTATION/Annotation1DItem.h>
Public Types | |
typedef DPosition< 2 > | PointType |
Type of the Points. More... | |
typedef float | IntensityType |
Intensity type. More... | |
typedef double | CoordinateType |
Coordinate type. More... | |
Public Member Functions | |
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 () |
virtual void | ensureWithinDataRange (Spectrum1DCanvas *const canvas)=0 |
Ensures that the item has coordinates within the visible area of the canvas. More... | |
virtual void | draw (Spectrum1DCanvas *const canvas, QPainter &painter, bool flipped=false)=0 |
Draws the item on painter . More... | |
virtual void | move (const PointType &delta)=0 |
Moves the item; behaviour depends on item type and is implemented in the subclasses. More... | |
Protected Member Functions | |
Annotation1DItem (const QString &text) | |
Constructor. More... | |
Annotation1DItem (const Annotation1DItem &rhs) | |
Copy constructor. More... | |
void | drawBoundingBox_ (QPainter &painter) |
Draws the bounding_box_. More... | |
Protected Attributes | |
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 abstract class acting as an interface for the different 1D annotation items.
This is an abstract polymorphic class which acts as an interface between its subclasses and all containers and methods that contain or handle Annotation1DItem objects.
If you want to add new kinds of annotation items, inherit this class, implement the pure virtual methods, and add everything else the item should have or be capable of.
typedef double CoordinateType |
Coordinate type.
typedef float IntensityType |
Intensity type.
|
virtual |
Destructor.
|
protected |
Constructor.
|
protected |
Copy constructor.
const QRectF& boundingBox | ( | ) | const |
Returns the current bounding box of this item on the canvas where it has last been drawn.
|
pure virtual |
Draws the item on painter
.
Implemented in Annotation1DCaret, Annotation1DPeakItem, Annotation1DTextItem, and Annotation1DDistanceItem.
|
protected |
Draws the bounding_box_.
bool editText | ( | ) |
open a GUI input field and let the user edit the text If the text was changed, true is returned; otherwise false.
|
pure virtual |
Ensures that the item has coordinates within the visible area of the canvas.
Implemented in Annotation1DCaret, Annotation1DPeakItem, Annotation1DTextItem, and Annotation1DDistanceItem.
const QString& getText | ( | ) | const |
Returns the text of the item.
bool isSelected | ( | ) | const |
Returns true if this item is currently selected on the canvas, else false.
|
pure virtual |
Moves the item; behaviour depends on item type and is implemented in the subclasses.
Implemented in Annotation1DCaret, Annotation1DPeakItem, and Annotation1DTextItem.
void setSelected | ( | bool | selected | ) |
Sets whether this item is currently selected on the canvas or not.
void setText | ( | const QString & | text | ) |
Sets the text of the item.
|
protected |
The current bounding box of this item on the canvas where it has last been drawn.
|
protected |
Determines whether this item is currently selected on the canvas.
|
protected |
The displayed text.
OpenMS / TOPP release 2.3.0 | Documentation generated on Tue Jan 9 2018 18:22:07 using doxygen 1.8.13 |