Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkHistogram.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QMITKHISTOGRAM_H
18 #define QMITKHISTOGRAM_H
19 
20 #include <qcolor.h>
21 #include <qglobal.h>
22 
23 #include <qwt_plot_item.h>
24 #include <qwt_series_data.h>
25 
31 class QmitkHistogram : public QwtPlotItem
32 {
33 public:
34  explicit QmitkHistogram(const QString &title = QString::null);
35  explicit QmitkHistogram(const QwtText &title);
36  virtual ~QmitkHistogram();
37 
38  void setData(const QwtIntervalSeriesData &data);
39  const QwtIntervalSeriesData &data() const;
40 
41  void setColor(const QColor &);
42  QColor color() const;
43 
44  virtual QRectF boundingRect() const override;
45 
46  virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const override;
47 
48  void setBaseline(double reference);
49  double baseline() const;
50 
51 protected:
52  virtual void drawBar(QPainter *, Qt::Orientation o, const QRect &) const;
53 
54 private:
55  void init();
56 
57  class HistogramData;
58  HistogramData *m_Data;
59 };
60 
61 #endif
virtual void drawBar(QPainter *, Qt::Orientation o, const QRect &) const
QColor color() const
void setColor(const QColor &)
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const override
virtual ~QmitkHistogram()
QmitkHistogram(const QString &title=QString::null)
virtual QRectF boundingRect() const override
void setData(const QwtIntervalSeriesData &data)
Used to create a histogram that can be shown in a Qwt Plot. See QmitkHistogramWidget for an example o...
const QwtIntervalSeriesData & data() const
void setBaseline(double reference)
double baseline() const