QwtHistogram.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : QwtHistogram.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr, thzs*gmx.net
00007     Description          : Histogram class
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program 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  *  This program 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,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
00027  *                                                                         *
00028  ***************************************************************************/
00029 #include "QwtBarCurve.h"
00030 
00031 class Matrix;
00032 
00034 class QwtHistogram: public QwtBarCurve
00035 {
00036 public:
00037     QwtHistogram(Table *t, const QString& xColName, const QString& name, int startRow, int endRow);
00038     QwtHistogram(Matrix *m);
00039 
00040     void copy(QwtHistogram *h);
00041 
00042     QwtDoubleRect boundingRect() const;
00043 
00044     void setBinning(bool autoBin, double size, double begin, double end);
00045     bool autoBinning(){return d_autoBin;};
00046     double begin(){return d_begin;};
00047     double end(){return d_end;};
00048     double binSize(){return d_bin_size;};
00049 
00050     void loadData();
00051     void initData(double* Y, int size);
00052 
00053     double mean(){return d_mean;};
00054     double standardDeviation(){return d_standard_deviation;};
00055     double minimum(){return d_min;};
00056     double maximum(){return d_max;};
00057 
00058     Matrix* matrix(){return d_matrix;};
00059 
00060 private:
00061     void draw(QPainter *painter,const QwtScaleMap &xMap,
00062         const QwtScaleMap &yMap, int from, int to) const;
00063 
00064     void loadDataFromMatrix();
00065     Matrix *d_matrix;
00066 
00067     bool d_autoBin;
00068     double d_bin_size, d_begin, d_end;
00069 
00071     double d_mean, d_standard_deviation, d_min, d_max;
00072 };

Generated on Sun Jun 15 21:32:18 2008 for QtiPlot by  doxygen 1.5.6