Avogadro  1.1.0
/home/kitware/dashboards/avogadro/libavogadro/src/plotpoint.h
00001 /**********************************************************************
00002   PlotPoint -- Part of the Avogadro 2D plotting interface
00003 
00004   Copyright (C) 2003 Jason Harris <[email protected]> (KDE)
00005   Copyright (C) 2008 David Lonie <[email protected]> (Avogadro)
00006 
00007   This file is part of the Avogadro molecular editor project.
00008   For more information, see <http://avogadro.openmolecules.net/>
00009 
00010   This file is based on KPlotWidget from the KDE library. For more
00011   information see <http://www.kde.org/>
00012 
00013   Avogadro is free software; you can redistribute it and/or modify
00014   it under the terms of the GNU General Public License as published by
00015   the Free Software Foundation; either version 2 of the License, or
00016   (at your option) any later version.
00017 
00018   Avogadro is distributed in the hope that it will be useful,
00019   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021   GNU General Public License for more details.
00022 
00023   You should have received a copy of the GNU General Public License
00024   along with this program; if not, write to the Free Software
00025   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00026   02110-1301, USA.
00027  **********************************************************************/
00028 
00029 #ifndef PLOTPOINT_H
00030 #define PLOTPOINT_H
00031 
00032 #include <avogadro/global.h>
00033 
00034 #include <QtCore/QString>
00035 #include <QtCore/QVariant>
00036 
00037 class QPointF;
00038 
00039 namespace Avogadro {
00040 
00052   class A_EXPORT PlotPoint {
00053   public:
00057     explicit PlotPoint();
00058 
00068     PlotPoint( double x, double y, const QString &label = QString(), double width = 0.0 );
00069 
00078     explicit PlotPoint( const QPointF &p, const QString &label = QString(), double width = 0.0 );
00079 
00083     ~PlotPoint();
00084 
00088     QPointF position() const;
00089 
00094     void setPosition( const QPointF &pos );
00095 
00099     double x() const;
00100 
00104     void setX( double x );
00105 
00109     double y() const;
00110 
00114     void setY( double y );
00115 
00119     QString label() const;
00120 
00124     void setLabel( const QString &label );
00125 
00129     double barWidth() const;
00130 
00134     void setBarWidth( double w );
00135 
00139     QVariant customData() const;
00140 
00144     void setCustomData(QVariant v);
00145 
00146   private:
00147     class Private;
00148     Private * const d;
00149 
00150     Q_DISABLE_COPY( PlotPoint )
00151   };
00152 
00153 }
00154 #endif