OpenMS  2.8.0
Public Member Functions | Protected Attributes | List of all members
Annotation1DDistanceItem Class Reference

An annotation item which represents a measured distance between two peaks. More...

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

Inheritance diagram for Annotation1DDistanceItem:
[legend]
Collaboration diagram for Annotation1DDistanceItem:
[legend]

Public Member Functions

 Annotation1DDistanceItem (const QString &text, const PointType &start_point, const PointType &end_point)
 Constructor. More...
 
 Annotation1DDistanceItem (const Annotation1DDistanceItem &rhs)
 Copy constructor. More...
 
 ~Annotation1DDistanceItem () override
 Destructor. More...
 
void ensureWithinDataRange (Plot1DCanvas *const canvas) override
 Ensures that the item has coordinates within the visible area of the canvas. More...
 
void draw (Plot1DCanvas *const canvas, QPainter &painter, bool flipped=false) override
 Draws the item on painter. More...
 
void move (const PointType &delta) override
 Moves the item; behaviour depends on item type and is implemented in the subclasses. More...
 
void setStartPoint (const PointType &start)
 Sets the start point of the measured distance line. More...
 
void setEndPoint (const PointType &end)
 Sets the peak index of the end peak of the measurement. More...
 
const PointTypegetStartPoint () const
 Returns the start point as (MZ,intensity) More...
 
const PointTypegetEndPoint () const
 Returns the end point as (MZ,intensity) More...
 
void setTicks (const std::vector< double > &ticks)
 Set tick lines for the distance item. More...
 
- 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...
 
bool editText ()
 

Protected Attributes

PointType start_point_
 The start point of the measured distance line. More...
 
PointType end_point_
 The end point of the measured distance line. More...
 
std::vector< double > ticks_
 Additional tick lines for the distance item. 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

- 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...
 
- 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 represents a measured distance between two peaks.

See also
Annotation1DItem

Constructor & Destructor Documentation

◆ Annotation1DDistanceItem() [1/2]

Annotation1DDistanceItem ( const QString &  text,
const PointType start_point,
const PointType end_point 
)

Constructor.

◆ Annotation1DDistanceItem() [2/2]

Copy constructor.

◆ ~Annotation1DDistanceItem()

~Annotation1DDistanceItem ( )
override

Destructor.

Member Function Documentation

◆ draw()

void draw ( Plot1DCanvas *const  canvas,
QPainter &  painter,
bool  flipped = false 
)
overridevirtual

Draws the item on painter.

Implements Annotation1DItem.

◆ ensureWithinDataRange()

void ensureWithinDataRange ( Plot1DCanvas *const  canvas)
overridevirtual

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

Implements Annotation1DItem.

◆ getEndPoint()

const PointType& getEndPoint ( ) const

Returns the end point as (MZ,intensity)

◆ getStartPoint()

const PointType& getStartPoint ( ) const

Returns the start point as (MZ,intensity)

◆ move()

void move ( const PointType delta)
overridevirtual

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

Implements Annotation1DItem.

◆ setEndPoint()

void setEndPoint ( const PointType end)

Sets the peak index of the end peak of the measurement.

◆ setStartPoint()

void setStartPoint ( const PointType start)

Sets the start point of the measured distance line.

◆ setTicks()

void setTicks ( const std::vector< double > &  ticks)

Set tick lines for the distance item.

Member Data Documentation

◆ end_point_

PointType end_point_
protected

The end point of the measured distance line.

◆ start_point_

PointType start_point_
protected

The start point of the measured distance line.

◆ ticks_

std::vector<double> ticks_
protected

Additional tick lines for the distance item.