Avogadro  1.1.0
Public Member Functions
Avogadro::PlotPoint Class Reference

Encapsulates a point in the plot. More...

#include <avogadro/plotpoint.h>

List of all members.

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)

Detailed Description

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.


Constructor & Destructor Documentation

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

Parameters:
xthe X-position for the point, in Data units
ythe Y-position for the point, in Data units
labelthe label string for the point. If the string is defined, the point will be labeled in the plot.
widththe 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

Parameters:
pthe position for the point, in Data units
labelthe label string for the point. If the string is defined, the point will be labeled in the plot.
widththe bar width to use for this point (only used for plots of type PlotObject::Bars)

Destructor


Member Function Documentation

Returns:
the bar-width for the point
Returns:
a QVariant holding arbitrary data associated with the point

Set the bar-width for the point

Associate arbitrary data with the point

void Avogadro::PlotPoint::setLabel ( const QString label)

Set the label for the point

References label().

Set the position of the point, in data units

Parameters:
posthe 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
double Avogadro::PlotPoint::y ( ) const

The documentation for this class was generated from the following files: