Avogadro  1.1.0
/home/kitware/dashboards/avogadro/libavogadro/src/plotaxis.h
00001 /**********************************************************************
00002   PlotAxis -- 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 PLOTAXIS_H
00030 #define PLOTAXIS_H
00031 
00032 #include <QtCore/QString>
00033 #include <QtCore/QList>
00034 
00035 #include <avogadro/global.h>
00036 
00037 namespace Avogadro {
00038 
00048   class A_EXPORT PlotAxis {
00049   public:
00050 
00054     explicit PlotAxis( const QString& label = QString() );
00055 
00059     ~PlotAxis();
00060 
00064     bool isVisible() const;
00065 
00070     void setVisible( bool visible );
00071 
00075     bool areTickLabelsShown() const;
00076 
00081     void setTickLabelsShown( bool b );
00082 
00088     void setLabel( const QString& label );
00089 
00093     QString label() const;
00094 
00101     QString tickLabel( double value ) const;
00102 
00122     void setTickLabelFormat( char format = 'g', int fieldWidth = 0, int precision = -1 );
00123 
00127     int tickLabelWidth() const;
00128 
00132     char tickLabelFormat() const;
00133 
00137     int tickLabelPrecision() const;
00138 
00148     void setTickMarks( double x0, double length );
00149 
00156     QList< double > majorTickMarks() const;
00157 
00164     QList< double > minorTickMarks() const;
00165 
00166   private:
00167     class Private;
00168     Private * const d;
00169 
00170     Q_DISABLE_COPY( PlotAxis )
00171   };
00172 
00173 }
00174 
00175 #endif // PLOTAXIS_H