Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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>
17 
18 #include <qwt_plot_item.h>
19 #include <qwt_series_data.h>
20 #include <qwt_text.h>
21 
27 class QmitkHistogram : public QwtPlotItem
28 {
29 public:
30  explicit QmitkHistogram(const QString &title = QString());
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
QmitkHistogram::drawBar
virtual void drawBar(QPainter *, Qt::Orientation o, const QRect &) const
QmitkHistogram::setColor
void setColor(const QColor &)
QmitkHistogram
Used to create a histogram that can be shown in a Qwt Plot. See QmitkHistogramWidget for an example o...
Definition: QmitkHistogram.h:27
QmitkHistogram::QmitkHistogram
QmitkHistogram(const QString &title=QString())
QmitkHistogram::draw
void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const override
QmitkHistogram::color
QColor color() const
QmitkHistogram::~QmitkHistogram
~QmitkHistogram() override
QmitkHistogram::setBaseline
void setBaseline(double reference)
QmitkHistogram::boundingRect
QRectF boundingRect() const override
QmitkHistogram::baseline
double baseline() const
QmitkHistogram::setData
void setData(const QwtIntervalSeriesData &data)
QmitkHistogram::data
const QwtIntervalSeriesData & data() const