Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
Annotation1DCaret Class Reference

An annotation item which paints a set of carets on the canvas. More...

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

Inheritance diagram for Annotation1DCaret:
Annotation1DItem

Public Types

typedef Annotation1DItem::PointType PointType
 
typedef std::vector< PointTypePositionsType
 
- Public Types inherited from Annotation1DItem
typedef DPosition< 2 > PointType
 Type of the Points. More...
 
typedef float IntensityType
 Intensity type. More...
 
typedef double CoordinateType
 Coordinate type. More...
 

Public Member Functions

 Annotation1DCaret (const PositionsType &poly_positions, const QString &text, const QColor &colour)
 Constructor. More...
 
 Annotation1DCaret (const Annotation1DCaret &rhs)
 Copy constructor. More...
 
virtual ~Annotation1DCaret ()
 Destructor. More...
 
virtual void ensureWithinDataRange (Spectrum1DCanvas *const canvas)
 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)
 Draws the item on painter. More...
 
virtual void move (const PointType &delta)
 Moves the item; behaviour depends on item type and is implemented in the subclasses. More...
 
const PositionsTypegetCaretPositions () const
 Returns the positions of the lines (in MZ / intensity coordinates) More...
 
void setPosition (const PointType &position)
 Sets the position of the label (in MZ / intensity coordinates) More...
 
const PointTypegetPosition () const
 Returns the position of the annotated peak (in MZ / intensity coordinates) More...
 
void setColor (const QColor &color)
 Set the colour of the carets (colour of text must be set using html) More...
 
const QColor & getColor () const
 Returns the colour of the carets. More...
 
void setRichText (const QString &text)
 
- Public Member Functions inherited from Annotation1DItem
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...
 

Protected Attributes

PositionsType caret_positions_
 
PointType position_
 The position of the label (in MZ/intensity coordinates) More...
 
QColor color_
 The colour of the label. More...
 
QStaticText st_
 Holds the (rich) text. More...
 
- Protected Attributes inherited from Annotation1DItem
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...
 

Additional Inherited Members

- Protected Member Functions inherited from Annotation1DItem
 Annotation1DItem (const QString &text)
 Constructor. More...
 
 Annotation1DItem (const Annotation1DItem &rhs)
 Copy constructor. More...
 
void drawBoundingBox_ (QPainter &painter)
 Draws the bounding_box_. More...
 

Detailed Description

An annotation item which paints a set of carets on the canvas.

Most useful to visualize (theoretical) isotope distributions. Additionally, a text annotation can be provided

See also
Annotation1DItem

Member Typedef Documentation

typedef std::vector<PointType> PositionsType

Constructor & Destructor Documentation

Annotation1DCaret ( const PositionsType poly_positions,
const QString &  text,
const QColor &  colour 
)

Constructor.

Copy constructor.

virtual ~Annotation1DCaret ( )
virtual

Destructor.

Member Function Documentation

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

Draws the item on painter.

Implements Annotation1DItem.

virtual void ensureWithinDataRange ( Spectrum1DCanvas *const  canvas)
virtual

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

Implements Annotation1DItem.

const PositionsType& getCaretPositions ( ) const

Returns the positions of the lines (in MZ / intensity coordinates)

const QColor& getColor ( ) const

Returns the colour of the carets.

const PointType& getPosition ( ) const

Returns the position of the annotated peak (in MZ / intensity coordinates)

virtual void move ( const PointType delta)
virtual

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

Implements Annotation1DItem.

void setColor ( const QColor &  color)

Set the colour of the carets (colour of text must be set using html)

void setPosition ( const PointType position)

Sets the position of the label (in MZ / intensity coordinates)

void setRichText ( const QString &  text)

The text to display (optional). Rendered using QStaticText, so HTML formatting is allowed.

Member Data Documentation

PositionsType caret_positions_
protected

The positions of points (in MZ/intensity coordinates) Ensure positions are sorted by m/z when assigning

QColor color_
protected

The colour of the label.

PointType position_
protected

The position of the label (in MZ/intensity coordinates)

QStaticText st_
protected

Holds the (rich) text.


OpenMS / TOPP release 2.0.0 Documentation generated on Wed Mar 30 2016 12:49:26 using doxygen 1.8.11