Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QMITKHISTOGRAM_H
14 #define QMITKHISTOGRAM_H
15 
16 #include <qcolor.h>
17 #include <qglobal.h>
18 
19 #include <qwt_plot_item.h>
20 #include <qwt_series_data.h>
21 
27 class QmitkHistogram : public QwtPlotItem
28 {
29 public:
30  explicit QmitkHistogram(const QString &title = QString::null);
31  explicit QmitkHistogram(const QwtText &title);
32  ~QmitkHistogram() override;
33 
34  void setData(const QwtIntervalSeriesData &data);
35  const QwtIntervalSeriesData &data() const;
36 
37  void setColor(const QColor &);
38  QColor color() const;
39 
40  QRectF boundingRect() const override;
41 
42  void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const override;
43 
44  void setBaseline(double reference);
45  double baseline() const;
46 
47 protected:
48  virtual void drawBar(QPainter *, Qt::Orientation o, const QRect &) const;
49 
50 private:
51  void init();
52 
53  class HistogramData;
54  HistogramData *m_Data;
55 };
56 
57 #endif
const QwtIntervalSeriesData & data() const
void setColor(const QColor &)
void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const override
QmitkHistogram(const QString &title=QString::null)
QRectF boundingRect() const override
void setData(const QwtIntervalSeriesData &data)
~QmitkHistogram() override
Used to create a histogram that can be shown in a Qwt Plot. See QmitkHistogramWidget for an example o...
double baseline() const
QColor color() const
virtual void drawBar(QPainter *, Qt::Orientation o, const QRect &) const
void setBaseline(double reference)