BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The DistributionPlot class plots 1d functions corresponding to domain's Distribution1D.
Definition at line 30 of file DistributionPlot.h.
Public Slots | |
void | onMouseMove (QMouseEvent *event) |
Generates label with current mouse position. More... | |
void | onMousePress (QMouseEvent *event) |
Public Member Functions | |
DistributionPlot (QWidget *parent=nullptr) | |
void | plotItem () |
void | setItem (DistributionItem *item) |
void | setShowMouseCoords (bool b) |
void | setXAxisName (const QString &xAxisName) |
Private Slots | |
void | resetView () |
Reset zoom range to initial state. More... | |
Private Member Functions | |
void | init_plot () |
Clears all plottables, resets axes to initial state. More... | |
void | plot_distributions () |
void | plot_multiple_values () |
void | plot_single_value () |
Plots a single bar corresponding to the value in DistributionNoteItem. More... | |
void | plotBars (const QVector< double > &xbars, const QVector< double > &ybars) |
void | plotFunction (const QVector< double > &xFunc, const QVector< double > &yFunc) |
void | plotLimits (const RealLimits &limits) |
Plots red line denoting lower and upper limits, if any. More... | |
void | plotVerticalLine (double xMin, double yMin, double xMax, double yMax, const QColor &color=Qt::blue) |
QPoint | positionForCautionSign () |
void | setPlotRange (const QPair< double, double > &xRange, const QPair< double, double > &yRange) |
Private Attributes | |
CautionSign * | m_cautionSign |
DistributionItem * | m_item |
QLabel * | m_label |
QCustomPlot * | m_plot |
QAction * | m_resetAction |
QCPRange | m_xRange |
QCPRange | m_yRange |
DistributionPlot::DistributionPlot | ( | QWidget * | parent = nullptr | ) |
Definition at line 39 of file DistributionPlot.cpp.
References m_label, m_plot, m_resetAction, onMouseMove(), onMousePress(), and resetView().
|
private |
Clears all plottables, resets axes to initial state.
Definition at line 130 of file DistributionPlot.cpp.
References CautionSign::clear(), m_cautionSign, m_plot, and setPlotRange().
Referenced by plotItem().
|
slot |
Generates label with current mouse position.
Definition at line 97 of file DistributionPlot.cpp.
References m_label, and m_plot.
Referenced by DistributionPlot().
|
slot |
Definition at line 109 of file DistributionPlot.cpp.
References m_resetAction.
Referenced by DistributionPlot().
|
private |
Definition at line 150 of file DistributionPlot.cpp.
References DistributionItem::is(), m_item, plot_multiple_values(), and plot_single_value().
Referenced by plotItem().
|
private |
Definition at line 174 of file DistributionPlot.cpp.
References DistributionItem::createDistribution(), DistributionItem::hasSigmaFactor(), DistributionItem::is(), DistributionItem::limits(), m_item, plotBars(), plotFunction(), and plotLimits().
Referenced by plot_distributions().
|
private |
Plots a single bar corresponding to the value in DistributionNoteItem.
Definition at line 161 of file DistributionPlot.cpp.
References DistributionItem::is(), m_item, plotBars(), and plotVerticalLine().
Referenced by plot_distributions().
|
private |
Definition at line 238 of file DistributionPlot.cpp.
References m_plot, and setPlotRange().
Referenced by plot_multiple_values(), and plot_single_value().
|
private |
Definition at line 258 of file DistributionPlot.cpp.
References m_plot, and setPlotRange().
Referenced by plot_multiple_values().
void DistributionPlot::plotItem | ( | ) |
Definition at line 79 of file DistributionPlot.cpp.
References init_plot(), m_cautionSign, m_plot, plot_distributions(), and CautionSign::setCautionMessage().
Referenced by setItem(), DistributionEditor::updatePlot(), and InclinationAnglesEditor::updatePlot().
|
private |
Plots red line denoting lower and upper limits, if any.
Definition at line 283 of file DistributionPlot.cpp.
References plotVerticalLine().
Referenced by plot_multiple_values().
|
private |
Definition at line 268 of file DistributionPlot.cpp.
References m_plot.
Referenced by plot_single_value(), and plotLimits().
|
private |
|
privateslot |
Reset zoom range to initial state.
Definition at line 121 of file DistributionPlot.cpp.
References m_plot, m_xRange, and m_yRange.
Referenced by DistributionPlot().
void DistributionPlot::setItem | ( | DistributionItem * | item | ) |
Definition at line 69 of file DistributionPlot.cpp.
References m_item, and plotItem().
Referenced by DistributionEditor::updatePlot(), and InclinationAnglesEditor::updatePlot().
|
private |
Definition at line 229 of file DistributionPlot.cpp.
References m_plot, m_xRange, and m_yRange.
Referenced by init_plot(), plotBars(), and plotFunction().
void DistributionPlot::setShowMouseCoords | ( | bool | b | ) |
Definition at line 301 of file DistributionPlot.cpp.
References m_label.
Referenced by DistributionEditor::DistributionEditor(), and InclinationAnglesEditor::InclinationAnglesEditor().
void DistributionPlot::setXAxisName | ( | const QString & | xAxisName | ) |
Definition at line 296 of file DistributionPlot.cpp.
References m_plot.
|
private |
Definition at line 66 of file DistributionPlot.h.
Referenced by init_plot(), and plotItem().
|
private |
Definition at line 62 of file DistributionPlot.h.
Referenced by plot_distributions(), plot_multiple_values(), plot_single_value(), and setItem().
|
private |
Definition at line 63 of file DistributionPlot.h.
Referenced by DistributionPlot(), onMouseMove(), and setShowMouseCoords().
|
private |
Definition at line 61 of file DistributionPlot.h.
Referenced by DistributionPlot(), init_plot(), onMouseMove(), plotBars(), plotFunction(), plotItem(), plotVerticalLine(), resetView(), setPlotRange(), and setXAxisName().
|
private |
Definition at line 64 of file DistributionPlot.h.
Referenced by DistributionPlot(), and onMousePress().
|
private |
Definition at line 65 of file DistributionPlot.h.
Referenced by resetView(), and setPlotRange().
|
private |
Definition at line 65 of file DistributionPlot.h.
Referenced by resetView(), and setPlotRange().