casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QtPlotHistogram.h
Go to the documentation of this file.
1 //# QtPlotHistogram.h: QwtPlotItem specialization for histograms
2 //# with surrounding Gui functionality
3 //# Copyright (C) 2010
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id: QtPlotServer.qo.h,v 1.7 2006/10/10 21:42:05 dking Exp $
28 
29 #ifndef QTPLOTHISTOGRAM_H_
30 #define QTPLOTHISTOGRAM_H_
31 
32 #include <qglobal.h>
33 #include <qcolor.h>
34 #include <qwt_plot_item.h>
35 #include <casaqt/QwtConfig.h>
36 
37 class QtPlotHistogram: public QwtPlotItem {
38  public:
39  explicit QtPlotHistogram( const QString &label = QString::null );
40  explicit QtPlotHistogram( const QwtText &title );
42 
43  void setData( const qwt_interval_t &data );
44  const qwt_interval_t &data( ) const { return data_; }
45 
46  QwtDoubleRect boundingRect( ) const;
47  int rtti( ) const { return QwtPlotItem::Rtti_PlotHistogram; }
48 
49 #if QWT_VERSION >= 0x060000
50  void draw( QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF & ) const;
51 #else
52  void draw( QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect & ) const;
53 #endif
54 
55  void setBaseline(double reference);
56  double baseline() const { return reference_; }
57 
58  void setColor(const QColor &c);
59  QColor color() const { return color_; }
60 
61 
62  private:
63  virtual void draw_bar( QPainter *, Qt::Orientation orientation, const QRect & ) const;
65  double reference_;
66  QColor color_;
67 };
68 
69 #endif
void setColor(const QColor &c)
QtPlotHistogram(const QString &label=QString::null)
int rtti() const
each selection effectively specify the desired channel data in a specified spectral window If the user uses the FrequencySelectionChannel class then the selection simply selects a range of channels The other derived class is FrequencySelectionReferential which specifies a range of frequencies in a specified frame of reference(e.g., LSRK).Unlike the other first method
QwtDoubleRect boundingRect() const
void setData(const qwt_interval_t &data)
void setBaseline(double reference)
virtual void draw_bar(QPainter *, Qt::Orientation orientation, const QRect &) const
void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &) const
qwt_interval_t data_
QColor color() const
const qwt_interval_t & data() const
double baseline() const
const Double c
Fundamental physical constants (SI units):
QwtIntervalData qwt_interval_t
Definition: QwtConfig.h:28