OpenMS
|
An annotation item which represents a measured distance between two peaks. More...
#include <OpenMS/VISUAL/ANNOTATION/Annotation1DDistanceItem.h>
Public Member Functions | |
Annotation1DDistanceItem (const QString &text, const PointXYType &start_point, const PointXYType &end_point, const bool swap_ends_if_negative=true) | |
Annotation1DDistanceItem (const Annotation1DDistanceItem &rhs)=default | |
Copy constructor. More... | |
~Annotation1DDistanceItem () override=default | |
Destructor. More... | |
void | ensureWithinDataRange (Plot1DCanvas *const canvas, const int layer_index) 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 PointXYType delta, const Gravitator &gr, const DimMapper< 2 > &dim_mapper) override |
Moves the item on the drawing canvas; behavior depends on item type and is implemented in the subclasses. More... | |
const PointXYType & | getStartPoint () const |
Returns the start point. More... | |
const PointXYType & | getEndPoint () const |
Returns the end point. More... | |
double | getDistance () const |
Compute the (negative) euclidean distance between start and endpoint. More... | |
void | setTicks (const std::vector< PointXYType > &ticks) |
Set tick lines for the distance item in unit XY coordinates (the gravity dimension is ignored) More... | |
Annotation1DItem * | clone () const override |
Creates a copy of the item on the heap and returns a pointer. 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 | |
PointXYType | start_point_ |
The start point of the measured distance line (in XY data coordinates) More... | |
PointXYType | end_point_ |
The end point of the measured distance line (in XY data coordinates) More... | |
std::vector< PointXYType > | ticks_ |
Additional tick lines for the distance item (the gravity dimension is ignored) 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... | |
An annotation item which represents a measured distance between two peaks.
Annotation1DDistanceItem | ( | const QString & | text, |
const PointXYType & | start_point, | ||
const PointXYType & | end_point, | ||
const bool | swap_ends_if_negative = true |
||
) |
text | The text to display between the two points |
start_point | Start point in XY unit coordinates |
end_point | End point in XY unit coordinates |
swap_ends_if_negative | Make sure the distance is positive when creating the distance item? |
Referenced by Annotation1DDistanceItem::clone().
|
default |
Copy constructor.
|
overridedefault |
Destructor.
|
inlineoverridevirtual |
Creates a copy of the item on the heap and returns a pointer.
Implements Annotation1DItem.
References Annotation1DDistanceItem::Annotation1DDistanceItem().
|
overridevirtual |
Draws the item on painter
.
Implements Annotation1DItem.
|
overridevirtual |
Ensures that the item has coordinates within the visible area of the canvas.
Implements Annotation1DItem.
double getDistance | ( | ) | const |
Compute the (negative) euclidean distance between start and endpoint.
If the startpoint is closer to (0,0) than the endpoint, the distance will be positive; otherwise negative.
|
inline |
Returns the end point.
References Annotation1DDistanceItem::end_point_.
|
inline |
Returns the start point.
References Annotation1DDistanceItem::start_point_.
|
overridevirtual |
Moves the item on the drawing canvas; behavior depends on item type and is implemented in the subclasses.
Implements Annotation1DItem.
void setTicks | ( | const std::vector< PointXYType > & | ticks | ) |
Set tick lines for the distance item in unit XY coordinates (the gravity dimension is ignored)
|
protected |
The end point of the measured distance line (in XY data coordinates)
Referenced by Annotation1DDistanceItem::getEndPoint().
|
protected |
The start point of the measured distance line (in XY data coordinates)
Referenced by Annotation1DDistanceItem::getStartPoint().
|
protected |
Additional tick lines for the distance item (the gravity dimension is ignored)