Isis 3 Programmer Reference
HistogramItem.h
1 
2 #ifndef HISTOGRAM_ITEM_H
3 #define HISTOGRAM_ITEM_H
4 
5 #include <qglobal.h>
6 #include <qcolor.h>
7 
8 #include "qwt_plot_item.h"
9 #include "CubeViewport.h"
10 
11 class QRectF;
12 
13 class QwtIntervalSeriesData;
14 
15 namespace Isis {
24  class HistogramItem: public QObject, public QwtPlotItem {
25  Q_OBJECT
26 
27  public:
28  explicit HistogramItem(const QString &title = QString::null);
29  explicit HistogramItem(const QwtText &title);
30  virtual ~HistogramItem();
31 
32  void setData(const QwtIntervalSeriesData &data);
33  const QwtIntervalSeriesData &data() const;
35  void setVertices(const QList <QPoint> &points);
36  CubeViewport *getViewPort() const;
37  void setViewPort(CubeViewport *cvp);
38 
39  void setColor(const QColor &);
40  QColor color() const;
41 
42  virtual QRectF boundingRect() const;
43 
44  virtual int rtti() const;
45 
46  virtual void draw(QPainter *, const QwtScaleMap &xMap,
47  const QwtScaleMap &yMap, const QRectF &) const;
48 
49  void setBaseline(double reference);
50  double baseline() const;
51 
52  enum HistogramAttribute {
53  Auto = 0,
54  Xfy = 1
55  };
56 
57  void setHistogramAttribute(HistogramAttribute, bool on = true);
58  bool testHistogramAttribute(HistogramAttribute) const;
59 
60  protected:
61  virtual void drawBar(QPainter *,
62  Qt::Orientation o, const QRect &) const;
63 
64  private:
65  void init();
66 
67  class PrivateData;
68  PrivateData *d_data;
71  };
72 
73 };
74 
75 #endif
Isis::HistogramItem::baseline
double baseline() const
Returns the baseline.
Definition: HistogramItem.cpp:97
Isis::HistogramItem::boundingRect
virtual QRectF boundingRect() const
Returns the bounding rectangle of the item.
Definition: HistogramItem.cpp:156
Isis::HistogramItem::p_cvp
CubeViewport * p_cvp
Viewport the data is from.
Definition: HistogramItem.h:70
Isis::HistogramItem::setVertices
void setVertices(const QList< QPoint > &points)
This method sets the vertices of the selected area on the cvp.
Definition: HistogramItem.cpp:367
QList< QPointF >
Isis::HistogramItem::color
QColor color() const
Return the color of the item.
Definition: HistogramItem.cpp:145
Isis::HistogramItem::setBaseline
void setBaseline(double reference)
Definition: HistogramItem.cpp:83
Isis::HistogramItem::PrivateData
Definition: HistogramItem.cpp:21
QwtPlotItem
Isis::HistogramItem::setColor
void setColor(const QColor &)
Set the color of the hist.
Definition: HistogramItem.cpp:131
Isis::HistogramItem::setData
void setData(const QwtIntervalSeriesData &data)
Overridden method to set the data in the histogram.
Definition: HistogramItem.cpp:108
Isis::HistogramItem::~HistogramItem
virtual ~HistogramItem()
Destructor.
Definition: HistogramItem.cpp:55
Isis::HistogramItem
This is the (qwt) plot item for a histogram.
Definition: HistogramItem.h:24
Isis::HistogramItem::testHistogramAttribute
bool testHistogramAttribute(HistogramAttribute) const
Definition: HistogramItem.cpp:220
Isis::HistogramItem::HistogramItem
HistogramItem(const QString &title=QString::null)
Constructor 2.
Definition: HistogramItem.cpp:46
Isis::HistogramItem::setViewPort
void setViewPort(CubeViewport *cvp)
This method sets the view port.
Definition: HistogramItem.cpp:392
Isis::CubeViewport
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
Isis::HistogramItem::p_pointList
QList< QPointF > p_pointList
List of data points.
Definition: HistogramItem.h:69
Isis::HistogramItem::data
const QwtIntervalSeriesData & data() const
Returns this item's data.
Definition: HistogramItem.cpp:120
Isis::HistogramItem::getViewPort
CubeViewport * getViewPort() const
This method returns the cube view port associated with the curve.
Definition: HistogramItem.cpp:383
Isis::HistogramItem::drawBar
virtual void drawBar(QPainter *, Qt::Orientation o, const QRect &) const
This method draws the bars of the bar graph.
Definition: HistogramItem.cpp:308
QObject
Isis::HistogramItem::setHistogramAttribute
void setHistogramAttribute(HistogramAttribute, bool on=true)
Definition: HistogramItem.cpp:199
Isis::HistogramItem::rtti
virtual int rtti() const
Definition: HistogramItem.cpp:187
Isis::HistogramItem::init
void init()
Initialization method.
Definition: HistogramItem.cpp:64
Isis::HistogramItem::draw
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const
Definition: HistogramItem.cpp:233
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::HistogramItem::getVertices
QList< QPointF > getVertices() const
This method returns a list of points which are the vertices of the selected area (by the rubberband) ...
Definition: HistogramItem.cpp:357