BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
PlotEventInfo.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/PlotUtil/PlotEventInfo.cpp
6 //! @brief Implementation of the class PlotEventInfo
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
16 #include "Base/Py/PyFmt.h"
17 
19  : m_in_axes_range(false)
20  , m_log_valued_axis(false)
21  , m_x(0.0)
22  , m_y(0.0)
23  , m_value(0.0)
24  , m_nx(0)
25  , m_ny(0)
26  , m_info_type(type)
27 {
28 }
29 
31 {
32  QString result;
33  result = m_info_type == PLOT_TYPE::Plot1D
34  ? QString(" [x: %1, y: %2] [binx: %3]")
35  .arg(QString::number(x(), 'f', 4))
36  .arg(valueToString())
37  .arg(m_nx, 2)
38  : QString(" [x: %1, y: %2] [binx: %3, biny:%4] [value: %5]")
39  .arg(QString::number(x(), 'f', 4))
40  .arg(QString::number(y(), 'f', 4), 2)
41  .arg(m_nx, 2)
42  .arg(m_ny, 2)
43  .arg(valueToString());
44 
45  return result;
46 }
47 
49 {
51  ? QString::fromStdString(Py::Fmt::printScientificDouble(m_value))
52  : QString::number(m_value, 'f', 2);
53 }
Defines the class PlotEventInfo.
double x() const
Definition: PlotEventInfo.h:42
bool m_log_valued_axis
Definition: PlotEventInfo.h:57
QString valueToString() const
double y() const
Definition: PlotEventInfo.h:44
PLOT_TYPE m_info_type
Definition: PlotEventInfo.h:60
PlotEventInfo(PLOT_TYPE type)
QString statusString() const