QtPlotHistogram.h

Go to the documentation of this file.
00001 //# QtPlotHistogram.h: QwtPlotItem specialization for histograms
00002 //# with surrounding Gui functionality
00003 //# Copyright (C) 2010
00004 //# Associated Universities, Inc. Washington DC, USA.
00005 //#
00006 //# This library is free software; you can redistribute it and/or modify it
00007 //# under the terms of the GNU Library General Public License as published by
00008 //# the Free Software Foundation; either version 2 of the License, or (at your
00009 //# option) any later version.
00010 //#
00011 //# This library is distributed in the hope that it will be useful, but WITHOUT
00012 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00014 //# License for more details.
00015 //#
00016 //# You should have received a copy of the GNU Library General Public License
00017 //# along with this library; if not, write to the Free Software Foundation,
00018 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00019 //#
00020 //# Correspondence concerning AIPS++ should be addressed as follows:
00021 //#        Internet email: aips2-request@nrao.edu.
00022 //#        Postal address: AIPS++ Project Office
00023 //#                        National Radio Astronomy Observatory
00024 //#                        520 Edgemont Road
00025 //#                        Charlottesville, VA 22903-2475 USA
00026 //#
00027 //# $Id: QtPlotServer.qo.h,v 1.7 2006/10/10 21:42:05 dking Exp $
00028 
00029 #ifndef QTPLOTHISTOGRAM_H_
00030 #define QTPLOTHISTOGRAM_H_
00031 
00032 #include <qglobal.h>
00033 #include <qcolor.h>
00034 #include <qwt_plot_item.h>
00035 #include <casaqt/QwtConfig.h>
00036 
00037 class QtPlotHistogram: public QwtPlotItem {
00038     public:
00039         explicit QtPlotHistogram( const QString &label = QString::null );
00040         explicit QtPlotHistogram( const QwtText &title );
00041         ~QtPlotHistogram( ) { }
00042 
00043         void setData( const qwt_interval_t &data );
00044         const qwt_interval_t &data( ) const { return data_; }
00045 
00046         QwtDoubleRect boundingRect( ) const;
00047         int rtti( ) const { return QwtPlotItem::Rtti_PlotHistogram; }
00048 
00049 #if QWT_VERSION >= 0x060000
00050         void draw( QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF & ) const;
00051 #else
00052         void draw( QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect & ) const;
00053 #endif
00054 
00055         void setBaseline(double reference);
00056         double baseline() const { return reference_; }
00057 
00058         void setColor(const QColor &c);
00059         QColor color() const { return color_; }
00060 
00061 
00062     private:
00063         virtual void draw_bar( QPainter *, Qt::Orientation orientation, const QRect & ) const;
00064         qwt_interval_t data_;
00065         double reference_;
00066         QColor color_;
00067 };
00068 
00069 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1