ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
AnglesCustomPlot.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <qcustomplot.h>
11 
12 #include <QWidget>
13 
14 namespace Ui {
15 class AnglesCustomPlot;
16 }
17 
18 class AnglesCustomPlot : public QCustomPlot {
19  Q_OBJECT
20 public:
21  explicit AnglesCustomPlot(const QVector<double>& data,
22  const QString& xLabel,
23  int nbBins,
24  QWidget* parent = nullptr);
26 
27  bool computeHistogram(const QVector<double>& data);
28 
29  void createQCPBars(const QString& xLabel);
30 
31  void rescale();
32 
33  QSharedPointer<QCPBarsDataContainer> dataContainer() {
34  return m_bars->data();
35  }
36 
37  void emitCloseTab() { emit closeTab(); }
38 
39  void mouseDoubleClickEvent(QMouseEvent* event) override;
40 
41  void mousePressEvent(QMouseEvent* event) override;
42 
43 signals:
44  void closeTab();
45 
46 private:
47  Ui::AnglesCustomPlot* ui;
48 
49  QVector<double> m_axis;
50 
51  QVector<double> m_histogram;
52 
53  QString m_label;
54 
55  QCPBars* m_bars;
56 
57  int m_nbBins;
58 };
MouseEvent event
#define signals
void mousePressEvent(QMouseEvent *event) override
QSharedPointer< QCPBarsDataContainer > dataContainer()
bool computeHistogram(const QVector< double > &data)
AnglesCustomPlot(const QVector< double > &data, const QString &xLabel, int nbBins, QWidget *parent=nullptr)
void mouseDoubleClickEvent(QMouseEvent *event) override
void createQCPBars(const QString &xLabel)
A plottable representing a bar chart in a plot.
Definition: qcustomplot.h:6449
QSharedPointer< QCPBarsDataContainer > data() const
Definition: qcustomplot.h:6489
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: qcustomplot.h:4167
GraphType data
Definition: graph_cut.cc:138
Definition: sfEditDlg.h:16