Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

Annotation1DItem Class Reference

An abstract class acting as an interface for the different 1D annotation items. More...

#include <OpenMS/VISUAL/ANNOTATION/Annotation1DItem.h>

Inheritance diagram for Annotation1DItem:
Annotation1DDistanceItem Annotation1DPeakItem Annotation1DTextItem

List of all members.

Public Types

typedef DPosition< 2 > PointType
 Type of the Points.
typedef Real IntensityType
 Intensity type.
typedef DoubleReal CoordinateType
 Coordinate type.

Public Member Functions

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.
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.
const QString & getText () const
 Returns the text of the item.
virtual void ensureWithinDataRange (Spectrum1DCanvas *const canvas)=0
 Ensures that the item has coordinates within the visible area of the canvas.
virtual void draw (Spectrum1DCanvas *const canvas, QPainter &painter, bool flipped=false)=0
 Draws the item on painter.
virtual void move (const PointType &delta)=0
 Moves the item; behaviour depends on item type and is implemented in the subclasses.

Protected Member Functions

 Annotation1DItem (const QString &text)
 Constructor.
 Annotation1DItem (const Annotation1DItem &rhs)
 Copy constructor.
void drawBoundingBox_ (QPainter &painter)
 Draws the bounding_box_.

Protected Attributes

QRectF bounding_box_
 The current bounding box of this item on the canvas where it has last been drawn.
bool selected_
 Determines whether this item is currently selected on the canvas.
QString text_
 The displayed text.

Detailed Description

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.


Member Typedef Documentation

Coordinate type.

Intensity type.

typedef DPosition<2> PointType

Type of the Points.


Constructor & Destructor Documentation

virtual ~Annotation1DItem (  )  [virtual]

Destructor.

Annotation1DItem ( const QString &  text  )  [protected]

Constructor.

Annotation1DItem ( const Annotation1DItem rhs  )  [protected]

Copy constructor.


Member Function Documentation

const QRectF& boundingBox (  )  const

Returns the current bounding box of this item on the canvas where it has last been drawn.

virtual void draw ( Spectrum1DCanvas *const   canvas,
QPainter &  painter,
bool  flipped = false 
) [pure virtual]

Draws the item on painter.

Implemented in Annotation1DDistanceItem, Annotation1DPeakItem, and Annotation1DTextItem.

void drawBoundingBox_ ( QPainter &  painter  )  [protected]

Draws the bounding_box_.

virtual void ensureWithinDataRange ( Spectrum1DCanvas *const   canvas  )  [pure virtual]

Ensures that the item has coordinates within the visible area of the canvas.

Implemented in Annotation1DDistanceItem, Annotation1DPeakItem, and Annotation1DTextItem.

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.

virtual void move ( const PointType delta  )  [pure virtual]

Moves the item; behaviour depends on item type and is implemented in the subclasses.

Implemented in Annotation1DDistanceItem, 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.


Member Data Documentation

QRectF bounding_box_ [protected]

The current bounding box of this item on the canvas where it has last been drawn.

bool selected_ [protected]

Determines whether this item is currently selected on the canvas.

QString text_ [protected]

The displayed text.


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:57 using doxygen 1.7.1