Avogadro
1.1.0
|
Encapsulates a point in the plot. More...
#include <avogadro/plotpoint.h>
Public Member Functions | |
PlotPoint () | |
PlotPoint (double x, double y, const QString &label=QString(), double width=0.0) | |
PlotPoint (const QPointF &p, const QString &label=QString(), double width=0.0) | |
~PlotPoint () | |
QPointF | position () const |
void | setPosition (const QPointF &pos) |
double | x () const |
void | setX (double x) |
double | y () const |
void | setY (double y) |
QString | label () const |
void | setLabel (const QString &label) |
double | barWidth () const |
void | setBarWidth (double w) |
QVariant | customData () const |
void | setCustomData (QVariant v) |
Encapsulates a point in the plot.
A PlotPoint consists of X and Y coordinates (in Data units), an optional label string, and an optional bar-width, The bar-width is only used for plots of type PlotObject::Bars, and it allows the width of each bar to be set manually. If bar-widths are omitted, then the widths will be set automatically, based on the halfway-mark between adjacent points.
Avogadro::PlotPoint::PlotPoint | ( | ) | [explicit] |
Default constructor.
Avogadro::PlotPoint::PlotPoint | ( | double | x, |
double | y, | ||
const QString & | label = QString() , |
||
double | width = 0.0 |
||
) |
Constructor. Sets the PlotPoint according to the given arguments
x | the X-position for the point, in Data units |
y | the Y-position for the point, in Data units |
label | the label string for the point. If the string is defined, the point will be labeled in the plot. |
width | the bar width to use for this point (only used for plots of type PlotObject::Bars) |
Avogadro::PlotPoint::PlotPoint | ( | const QPointF & | p, |
const QString & | label = QString() , |
||
double | width = 0.0 |
||
) | [explicit] |
Constructor. Sets the PlotPoint according to the given arguments
p | the position for the point, in Data units |
label | the label string for the point. If the string is defined, the point will be labeled in the plot. |
width | the bar width to use for this point (only used for plots of type PlotObject::Bars) |
Destructor
double Avogadro::PlotPoint::barWidth | ( | ) | const |
QVariant Avogadro::PlotPoint::customData | ( | ) | const |
QString Avogadro::PlotPoint::label | ( | ) | const |
Referenced by Avogadro::PlotObject::draw(), Avogadro::PlotObject::drawImage(), Avogadro::PlotWidget::placeLabel(), and setLabel().
QPointF Avogadro::PlotPoint::position | ( | ) | const |
Referenced by Avogadro::PlotObject::draw(), Avogadro::PlotObject::drawImage(), Avogadro::PlotWidget::placeLabel(), Avogadro::PlotWidget::pointNearestPoint(), and Avogadro::PlotWidget::pointsUnderPoint().
void Avogadro::PlotPoint::setBarWidth | ( | double | w | ) |
Set the bar-width for the point
void Avogadro::PlotPoint::setCustomData | ( | QVariant | v | ) |
Associate arbitrary data with the point
void Avogadro::PlotPoint::setLabel | ( | const QString & | label | ) |
Set the label for the point
References label().
void Avogadro::PlotPoint::setPosition | ( | const QPointF & | pos | ) |
Set the position of the point, in data units
pos | the new position for the point. |
void Avogadro::PlotPoint::setX | ( | double | x | ) |
Set the X-position of the point, in Data units
void Avogadro::PlotPoint::setY | ( | double | y | ) |
Set the Y-position of the point, in Data units
double Avogadro::PlotPoint::x | ( | ) | const |
Referenced by Avogadro::PlotWidget::clearAndSelectPoint(), Avogadro::PlotWidget::mouseMoveEvent(), Avogadro::PlotWidget::scaleLimits(), and Avogadro::PlotWidget::selectPoint().
double Avogadro::PlotPoint::y | ( | ) | const |
Referenced by Avogadro::PlotWidget::clearAndSelectPoint(), Avogadro::PlotWidget::mouseMoveEvent(), Avogadro::PlotWidget::scaleLimits(), and Avogadro::PlotWidget::selectPoint().